how the collective io take effects?

Wei-keng Liao wkliao at ece.northwestern.edu
Mon Nov 26 09:38:00 CST 2012


Hi, Jialin,

Collective calls require the participation of all the processes that open the file together.
You need to make sure the number of the calls is the same across all processes. The MPI-IO
and PnetCDF internal optimizations, such as request aggregation, two-phase I/O, are designed
for individual collective call only. So, in you case, all 10 processes will cooperate to do
the I/O in each collective call, but not cross the calls. For optimization cross the calls,
you will need to us the PnetCDF nonblocking APIs. See the QuickTutorial page for examples.
http://trac.mcs.anl.gov/projects/parallel-netcdf/wiki/QuickTutorial 

Wei-keng

On Nov 26, 2012, at 1:02 AM, Liu, Jaln wrote:

> Hi all,
> 
> please see the following codes first,
> 
>   mpi_start[] = ..;
>   mpi_count[] = ..;
>   ncmpi_get_vara_float_all();
> 
> I can see the collective i/o is performed in the *_all function, which means all processes will call this function to do the i/o.
> 
> What if I write the code in the following way,
> 
>     loop_start=(int)(NREC/nprocs)*rank;
>     loop_length=(int)(NREC/nprocs);
>     /*parallel access datasets*/
>     for(rec = loop_start;rec <loop_start+loop_length; rec++)
>     {
>       for(lon = 0; lon < NLON; lon++){
>       mpi_start[0] = rec;
>       mpi_start[2] = lon;
>       ret = ncmpi_get_vara_float_all()
> ...
> 
> In the above codes, the outer loop is decomposed, then how the collective i/o will take effect in this case, if I specify mpirun -np 10 here.
> 
> In other word, can all the 10 processes cooperate with each other to do collective I/O anymore in this example?
> 
> If there is something wrong in my understanding, please point it out, thanks in advance.
> 
> Jialin
> 



More information about the parallel-netcdf mailing list