diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2001-05-13 03:54:28 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2001-05-13 03:54:28 (GMT) |
commit | b6265298d8929f828798f83ab8568ef30b2f9177 (patch) | |
tree | d3b9f5039ed4c4ae49b5b21a39d3dea51776ccb7 /testpar | |
parent | 408161748ff89ad40675e78bc98f35734a2df594 (diff) | |
download | hdf5-b6265298d8929f828798f83ab8568ef30b2f9177.zip hdf5-b6265298d8929f828798f83ab8568ef30b2f9177.tar.gz hdf5-b6265298d8929f828798f83ab8568ef30b2f9177.tar.bz2 |
[svn-r3926] Description:
Changed MPI_File_seek then MPI_File_write or MPI_File_read to just
MPI_File_write_at and MPI_File_read_at. Some compiler, e.g., IBM
mpcc_r does not support MPI_File_seek and MPI_File_read or MPI_File_write.
This is a better measurement against HDF5 performance since HDF5
uses MPI_File_write_at and MPI_File_read_at all the times.
It is a more thread safe to use MPI_xxx_at than the other seek then
read/write approaches.
Platforms tested:
modi4 (irix64 parallel), IBM sp2.
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/mpi-perf.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/testpar/mpi-perf.c b/testpar/mpi-perf.c index 9e93a68..3d40eb8 100644 --- a/testpar/mpi-perf.c +++ b/testpar/mpi-perf.c @@ -4,6 +4,7 @@ * See COPYING in top-level directory. * * This is contributed by Robert Ross to the HDF5 software. + * and was called mpi-io-test.c */ /* mpi-perf.c @@ -24,6 +25,14 @@ * the processes that make up the parallel job, which isn't always the case. * So if it doesn't work on some platform, that might be why. */ +/* Modifications: + * Albert Cheng, Apr 30, 20001 + * Changed MPI_File_open to use MPI_COMM_WORLD (was MPI_COMM_SELF). + * Albert Cheng, May 5, 20001 + * Changed MPI_File_seek then MPI_File_write or MPI_File_read to just + * MPI_File_write_at and MPI_File_read_at. Some compiler, e.g., IBM + * mpcc_r does not support MPI_File_seek and MPI_File_read or MPI_File_write. + */ #include <stdio.h> #include <stdlib.h> @@ -33,7 +42,10 @@ #include <string.h> #include <sys/time.h> #include <mpi.h> -#include "mpio.h" +#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +# include <mpio.h> +#endif + /* DEFAULT VALUES FOR OPTIONS */ @@ -136,7 +148,7 @@ int main(int argc, char **argv) * rank of the current process */ seek_position = (j*iter_jump)+(mynod*opt_block); - MPI_File_seek(fh, seek_position, MPI_SEEK_SET); +/* MPI_File_seek(fh, seek_position, MPI_SEEK_SET);*/ if (opt_correct) /* fill in buffer for iteration */ { for (i=mynod+j, check=buf; i<opt_block; i++,check++) *check=(char)i; @@ -148,7 +160,7 @@ int main(int argc, char **argv) /* write out the data */ nchars = opt_block/sizeof(char); - err = MPI_File_write(fh, buf, nchars, MPI_CHAR, &status); + err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status); if(err){ fprintf(stderr, "node %d, write error: %s\n", mynod, strerror(errno)); @@ -185,7 +197,7 @@ int main(int argc, char **argv) /* seek to the appropriate spot give the current iteration and * rank within the MPI processes */ seek_position = (j*iter_jump)+(mynod*opt_block); - MPI_File_seek(fh, seek_position, MPI_SEEK_SET); +/* MPI_File_seek(fh, seek_position, MPI_SEEK_SET);*/ /* discover the start time */ MPI_Barrier(MPI_COMM_WORLD); @@ -193,10 +205,10 @@ int main(int argc, char **argv) /* read in the file data */ if (!opt_correct){ - err = MPI_File_read(fh, buf, nchars, MPI_CHAR, &status); + err = MPI_File_read_at(fh, seek_position, buf, nchars, MPI_CHAR, &status); } else{ - err = MPI_File_read(fh, buf2, nchars, MPI_CHAR, &status); + err = MPI_File_read_at(fh, seek_position, buf2, nchars, MPI_CHAR, &status); } myerrno = errno; |