summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2003-02-18 05:12:58 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2003-02-18 05:12:58 (GMT)
commit7ff7845b3a18a3e32fbf84f089f4a01ba9329274 (patch)
tree72f7127f5b8ea27ffc30d5573c93e041bbff18f0
parenta3254796e975022fd83cdd9125f87b0cab369c2a (diff)
downloadhdf5-7ff7845b3a18a3e32fbf84f089f4a01ba9329274.zip
hdf5-7ff7845b3a18a3e32fbf84f089f4a01ba9329274.tar.gz
hdf5-7ff7845b3a18a3e32fbf84f089f4a01ba9329274.tar.bz2
[svn-r6414] Purpose:
Bug fix (no id, just noticed myself) Description: Added a barrier before doing file cleanup to ensure all tests are completed by then. Moved the MPI_Finalize to be very end and insert an H5close before it to ensure all potential MPI activities by HDF5 are done by then. Platforms tested: Tested h5committest {arabica (fortran), eirene (fortran, C++) modi4 (parallel, fortran)}? Yes.
-rw-r--r--testpar/testphdf5.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 0f0e723..95dbf03 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -409,11 +409,20 @@ finish:
}
printf("===================================\n");
}
- MPI_Finalize();
- if (dowrite)
+
+ /* make sure all processes are finished before starting cleanup and exit */
+ MPI_Barrier(MPI_COMM_WORLD);
+ if (dowrite){
h5_cleanup(FILENAME, fapl);
- else
+ } else {
+ /* h5_cleanup would have closed fapl. Now must do it explicitedly */
H5Pclose(fapl);
+ }
+
+ /* close HDF5 library */
+ H5close();
+ /* MPI_Finalize must be called AFTER H5close which may use MPI calls */
+ MPI_Finalize();
return(nerrors);
}