From 7ff7845b3a18a3e32fbf84f089f4a01ba9329274 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 18 Feb 2003 00:12:58 -0500 Subject: [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. --- testpar/testphdf5.c | 15 ++++++++++++--- 1 file 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); } -- cgit v0.12