summaryrefslogtreecommitdiffstats
path: root/testpar/t_mpi.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-08-11 10:34:58 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-08-11 10:34:58 (GMT)
commit5aa72127e6577068d848219f1c3feabf62a0cc1d (patch)
tree460d22d38b4932943e8d2653553914e3a7fc5b65 /testpar/t_mpi.c
parent908ce6d7214948e71dbeb01f129789c4c669861a (diff)
downloadhdf5-5aa72127e6577068d848219f1c3feabf62a0cc1d.zip
hdf5-5aa72127e6577068d848219f1c3feabf62a0cc1d.tar.gz
hdf5-5aa72127e6577068d848219f1c3feabf62a0cc1d.tar.bz2
[svn-r17317] Did some code cleanup.
t_file.c: replace the old variable, color, with a more meaningfule name of is_old. t_mpi.c: use the official mpi_file_delete, instead of remove, to delete a file in MPI environment. Tested: Only jam in parallel as changes are trivial.
Diffstat (limited to 'testpar/t_mpi.c')
-rw-r--r--testpar/t_mpi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 2195c32..09283e6 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -286,8 +286,9 @@ test_mpio_gb_file(char *filename)
VRFY((buf!=NULL), "malloc succeed");
/* open a new file. Remove it first in case it exists. */
- if (MAINPROCESS)
- remove(filename);
+ /* Must delete because MPI_File_open does not have a Truncate mode. */
+ /* Don't care if it has error. */
+ MPI_File_delete(filename, MPI_INFO_NULL);
MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
@@ -490,6 +491,7 @@ test_mpio_1wMr(char *filename, int special_request)
/* Must delete because MPI_File_open does not have a Truncate mode. */
/* Don't care if it has error. */
MPI_File_delete(filename, MPI_INFO_NULL);
+ MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
MPI_MODE_RDWR | MPI_MODE_CREATE ,