[mpich2-dev] ROMIO: Interleaving test

Pascal Deveze Pascal.Deveze at bull.net
Wed Sep 1 08:37:30 CDT 2010


 Hi,

There is one test that I do not understand. This test is used
in the collective read/write to detect if the data are interleaved:

       /* are the accesses of different processes interleaved? */
        for (i=1; i<nprocs; i++)
            if ((st_offsets[i] < end_offsets[i-1]) &&
                (st_offsets[i] <= end_offsets[i]))
                interleave_count++;
        /* This is a rudimentary check for interleaving, but should suffice
           for the moment. */
    }

The second member of the if statement (st_offsets[i] <= end_offsets[i]) 
is always verified.
I think this should be (st_offsets[i-1] <= end_offsets[i]).

Do I miss something ?
And as the interleave_count is always tested with 0, it should be 
possible to break the loop
after the incrementation of interleave_count.

In my point of view, the test could be something like:
       /* are the accesses of different processes interleaved? */
        for (i=1; i<nprocs; i++)
            if ((st_offsets[i] < end_offsets[i-1]) &&
                (st_offsets[i-1] <= end_offsets[i])) {
                          interleave_count=1;
                          break;
            }
        /* This is a rudimentary check for interleaving, but should suffice
           for the moment. */
    }

Pascal



More information about the mpich2-dev mailing list