Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prov/gni: fix a problem with progress #1347

Merged
merged 1 commit into from May 20, 2017

Conversation

hppritcha
Copy link
Member

Turns out that the VC refactor had another impact,
it causes all data progress to be delayed until
the app starts calling fi_cq_read, etc. This
brings out all kind of issues with one-sided
program models.

Fix verified by SOS developers.

Signed-off-by: Howard Pritchard howardp@lanl.gov

@sungeunchoi
Copy link

Is this for manual or our pseudo-auto progress?

@chuckfossen
Copy link

Are you saying that we used to progress before the vc refactor even in manual progress mode? Or is this auto progress? What happens to the SOS app? Does it fail before it starts calling cq read?

@hppritcha
Copy link
Member Author

hppritcha commented May 18, 2017

I've attached the SOS app. Note it uses extensions to OpenSHMEM but you can see what its trying to do, namely post a whole bunch of non blocking AMOs, then go into a shmem quiet.

#include <shmem.h>
#include <shmemx.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/time.h>
#include <time.h>

double get_wtime(void)
{
    double wtime = 0.0;

#ifdef CLOCK_MONOTONIC
    struct timespec tv;
    clock_gettime(CLOCK_MONOTONIC, &tv);
    wtime = tv.tv_sec * 1e6;
    wtime += (double)tv.tv_nsec / 1000.0;
#else
    struct timeval tv;
    gettimeofday(&tv, NULL);
    wtime = tv.tv_sec * 1e6;
    wtime += (double)tv.tv_usec;
#endif
    return wtime;
}

int main(int argc, char **argv) {
    if (argc != 2) {
        fprintf(stderr, "usage: %s natomics-per-pe\n", argv[0]);
        return 1;
    }

    const int natomics_per_pe = atoi(argv[1]);

    shmem_init();

    const int target_pe = (shmem_my_pe() + 1) % shmem_n_pes();
    unsigned long long *mem = (unsigned long long *)shmem_malloc(sizeof(*mem));
    assert(mem);

    double start_time, mid_time, start_quiet_time, end_time;

    // Warm up
    start_time = get_wtime();
    for (int i = 0; i < natomics_per_pe; i++) {
        shmemx_ulonglong_atomic_or(mem, 0xff, target_pe);
    }
    mid_time = get_wtime();
    shmem_quiet();
    end_time = get_wtime();


    start_time = get_wtime();
    for (int i = 0; i < natomics_per_pe; i++) {
        shmemx_ulonglong_atomic_or(mem, 0xff, target_pe);
    }
    mid_time = get_wtime();
    while (get_wtime() - mid_time < 2.0) ;
    start_quiet_time = get_wtime();
    shmem_quiet();
    end_time = get_wtime();
    printf("PE %d took %f seconds to issue, slept for %f seconds, %f seconds "
            "to complete\n", shmem_my_pe(), mid_time - start_time,
            start_quiet_time - mid_time, end_time - start_quiet_time);

    shmem_barrier_all();

    if (shmem_my_pe() == 0) {
        printf("\n");
    }
    shmem_barrier_all();

    start_time = get_wtime();
    for (int i = 0; i < natomics_per_pe; i++) {
        shmemx_ulonglong_atomic_or(mem, 0xff, target_pe);
    }
    mid_time = get_wtime();
    shmem_quiet();
    end_time = get_wtime();
    printf("PE %d took %f seconds to issue, did not sleep, %f seconds "
            "to complete\n", shmem_my_pe(), mid_time - start_time,
            end_time - mid_time);

    shmem_finalize();

    return 0;
}

sung: this is for either progress model.

If one tries to post many millions of atomic ops, OOM's are observed.

@chuckfossen
Copy link

Normally the progress happens in a separate thread, true? Is it ok to call gnix_nic_progress in the sender's thread?

@hppritcha
Copy link
Member Author

no progress for small atomics doesn't happen from the progress thread unless you turn on zti's irq for every op option - then you get high latency and a nose-dive in message throughput rates.

@chuckfossen
Copy link

So, I'm hearing this won't affect latency.

@chuckfossen
Copy link

Should we have a similar addition to _gnix_sendv as well?

@hppritcha
Copy link
Member Author

I'll add one for _gnix_sendv too. good catch.

Turns out that the VC refactor had another impact,
it causes all data progress to be delayed until
the app starts calling fi_cq_read, etc.  This
brings out all kind of issues with one-sided
program models.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
@hppritcha
Copy link
Member Author

add similar code in sendv code.

@hppritcha hppritcha merged commit 93c083b into ofi-cray:master May 20, 2017
hppritcha added a commit to hppritcha/libfabric that referenced this pull request May 25, 2017
Turns out that the VC refactor had another impact,
it causes all data progress to be delayed until
the app starts calling fi_cq_read, etc.  This
brings out all kind of issues with one-sided
program models.

upstream merge of ofi-cray#1347

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit ofi-cray/libfabric-cray@83b9c8f)
@hppritcha hppritcha deleted the topic/fix_progress_problem branch September 21, 2017 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants