summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2003-01-15 16:06:47 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2003-01-15 16:06:47 (GMT)
commita9c79d6b6168f6833a3683660ae2a15da4e2ec4e (patch)
tree0063ef5407c777c257167c1b80bca7acf7582baf
parentc41d62c8e5943cd4a129bce3b0b944cbc02c2d7b (diff)
downloadhdf5-a9c79d6b6168f6833a3683660ae2a15da4e2ec4e.zip
hdf5-a9c79d6b6168f6833a3683660ae2a15da4e2ec4e.tar.gz
hdf5-a9c79d6b6168f6833a3683660ae2a15da4e2ec4e.tar.bz2
[svn-r6286] Purpose:
bug fix Description: Added a barrier to ensure all processes have finished using the file before cleaning it away. Added H5close() to ensure all HDF5 stuff are closed before calling MPI_Finalize. Platforms tested: Tested h5committest {arabica (fortran), eirene (fortran, C++) modi4 (parallel, fortran)}? Yes
-rw-r--r--testpar/t_mpi.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 3a28146..2b5a4e3 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -1,3 +1,17 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
/*
* MPIO independent overlapping writes.
*
@@ -267,7 +281,7 @@ test_mpio_gb_file(char *filename)
mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
+ VRFY((mrc==MPI_SUCCESS), "MPI_FILE_OPEN");
printf("MPIO GB file write test %s\n", filename);
@@ -440,6 +454,7 @@ main(int argc, char **argv)
printf("MPI functionality tests\n");
printf("===================================\n");
}
+ H5open();
h5_show_hostname();
fapl = H5Pcreate (H5P_FILE_ACCESS);
@@ -457,6 +472,10 @@ main(int argc, char **argv)
test_mpio_overlap_writes(filenames[0]);
finish:
+ /* make sure all processes are finished before final report, cleanup
+ * and exit.
+ */
+ MPI_Barrier(MPI_COMM_WORLD);
if (MAINPROCESS){ /* only process 0 reports */
printf("===================================\n");
if (nerrors){
@@ -467,8 +486,13 @@ finish:
}
printf("===================================\n");
}
- MPI_Finalize();
+
h5_cleanup(FILENAME, fapl);
+ H5close();
+
+ /* MPI_Finalize must be called AFTER H5close which may use MPI calls */
+ MPI_Finalize();
+
/* always return 0 as this test is informational only. */
return(0);
}