[mpich-discuss] MPI_File_sync and MPI_File_set_size

Rob Latham robl at mcs.anl.gov
Wed Dec 9 09:55:44 CST 2009


On Wed, Dec 09, 2009 at 01:35:58AM -0600, Wei-keng Liao wrote:
> In ROMIO, when the hint romio_no_indep_rw is set to true,
> only the IO aggregators open/read/write/close the file.
> 
> In MPI_File_sync, ADIOI_TEST_DEFERRED() is called before
> ADIO_Flush(), to check if the file is opened, which forces
> all non-aggregators to open the file. I think it is not
> necessary. A simple check for open status can fix this, eg.
>   if ( (fh)->is_open ) ADIO_Flush(fh, &error_code);

Good point.  Furthermore, in most of the drivers (except ad_nfs and
ad_bgl) we flush from rank 0 and broadcast the result.  And even in
ad_nfs and ad_bgl, if the file isn't opened then there's nothing to
flush from the cache.

> Also, the similar issue happens for MPI_File_set_size().
> The current implementation lets aggregator 0 to call
> ftruncate() and then broadcast the result to all processes.
> It is also not necessary to call ADIOI_TEST_DEFERRED().
> The fix is simply remove the call.

again, the only tricky point is AD_NFS, but if the file hasn't been
opened yet, then the client can't have cached a file size.

==rob

-- 
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA


More information about the mpich-discuss mailing list