Hi Scott,

You're right, in fact the simul test does do a barrier after the stat. In the code below, the end() function does an MPI_Barrier.

-sam

void simul_file_stat(int shared) {
    char *filename;
    struct stat buf;

    begin("setup");
    filename = create_files("simul_file_stat", 0, shared);
    end("setup");

    begin("test");
    /* All stat the file */
    if (stat(filename, &buf) == -1) {
        FAIL("stat failed");
    }
    end("test");

    begin("cleanup");
    remove_files("simul_file_stat", shared);
    end("cleanup");

On Aug 15, 2007, at 7:37 PM, Scott Atchley wrote:

On Aug 15, 2007, at 6:53 PM, Pete Wyckoff wrote:

    if (task == 0)
        mkdir("foo");

    MPI_Barrier();
    sleep(3);

    stat("foo");

    if (task == 0)
        rmdir("foo");


Hi Pete,

Isn't there a race condition between task 0 and the others after the barrier? Can 0 stat the file and rmdir it before another task can stat() it? If so, should there be a barrier after the stat() and before the rmdir?

Scott
_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers


_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to