[MOAB-dev] r3348 - MOAB/trunk/parallel
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Mon Nov 16 08:27:49 CST 2009
Author: kraftche
Date: 2009-11-16 08:27:49 -0600 (Mon, 16 Nov 2009)
New Revision: 3348
Modified:
MOAB/trunk/parallel/mhdf_parallel.c
Log:
patch from Jed Brown: make sure root proc is done writing file before others try to read it
Modified: MOAB/trunk/parallel/mhdf_parallel.c
===================================================================
--- MOAB/trunk/parallel/mhdf_parallel.c 2009-11-16 14:24:17 UTC (rev 3347)
+++ MOAB/trunk/parallel/mhdf_parallel.c 2009-11-16 14:27:49 UTC (rev 3348)
@@ -268,7 +268,12 @@
if (RANK == 0)
create_file();
-
+
+ /* Wait for rank 0 to finish creating the file, otherwise rank 1 may find it to be invalid */
+ rval = MPI_Barrier(MPI_COMM_WORLD);
+ if (rval)
+ return rval;
+
write_file_data();
MPI_Finalize();
More information about the moab-dev
mailing list