[Mpi-comments] non-collective version of MPI_File_set_view

Wei-Keng Liao wkliao at northwestern.edu
Sat Feb 26 14:15:04 CST 2022


I notice the following statement in the MPI standard.
"MPI_FILE_SET_VIEW is collective; the values for datarep and the extents
of etype in the file data representation must be identical on all
processes in the group; values for disp, filetype, and info may vary."

Is it safe to say the requirement of identical etype extents applies
only when shared file pointer is used?

For individual file pointers, it looks like this requirement is not necessary.

Wei-keng

> On Feb 25, 2022, at 3:04 PM, Wei-Keng Liao via mpi-comments <mpi-comments at lists.mpi-forum.org> wrote:
> 
> I would like to suggest a non-collective version of MPI_File_set_view.
> The current MPI_File_set_view is defines as the following.
>    MPI_FILE_SET_VIEW(fh, disp, etype, filetype, datarep, info)
> 
> The last two arguments, datarep and info, may be necessary to be
> set collectively, but disp, etype, and filetype are only relevant
> to the calling process.
> 
> It is not rare to see in today's MPI-IO programs the interleaved
> calls to collective and independent file read/write functions.
> For example, an application writes to multiple variables of different 
> sizes. Large variables are partitioned among processes while small
> ones are read/written by rank 0 only. Accessing partitioned variables
> often uses filetype, such as MPI_Type_create_subarray, to set the view.  
> Having only the collective version of MPI_File_set_view introduces a
> penalty for processes not accessing small variables in this scenario.
> To deal with this issue, PnetCDF opens the file twice, one with
> MPI_COMM_WORLD and the other with MPI_COMM_SELF, so the latter can
> be used to do independent I/O.
> 
> A non-collective version of MPI_File_set_view can look similar, but
> without the last two arguments, datarep and info.
> 
> An alternative is to create a new set of MPI I/O functions that add
> the three arguments disp, etype, and filetype. For example, a new
> write function corresponds to
>    MPI_FILE_WRITE(fh, buf, count, datatype, status)
> will be
>    MPI_FILE_WRITE_x(fh, buf, count, datatype, disp, etype, filetype, status)
> 
> 
> Wei-keng Liao
> 
> _______________________________________________
> mpi-comments mailing list
> mpi-comments at lists.mpi-forum.org
> https://urldefense.com/v3/__https://lists.mpi-forum.org/mailman/listinfo/mpi-comments__;!!Dq0X2DkFhyF93HkjWTBQKhk!DubBpzuoiLT-FOwCFmdQpOErL5ced5-IoG306ZnZNIqdiDKmKj_dhQxw7JqziR-3Y2lH$ 



More information about the mpi-comments mailing list