summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorMike McGreevy <mamcgree@hdfgroup.org>2011-10-05 22:00:35 (GMT)
committerMike McGreevy <mamcgree@hdfgroup.org>2011-10-05 22:00:35 (GMT)
commitd3b7ce468989bea9ef4e8f78e53b52b2ae766da3 (patch)
treec2a88d0f4d9a211f22df18842815ef8fac0fa8a5 /testpar
parent3389fa88ee3b63f4eb8c8887f8411cc37ec86c2f (diff)
downloadhdf5-d3b7ce468989bea9ef4e8f78e53b52b2ae766da3.zip
hdf5-d3b7ce468989bea9ef4e8f78e53b52b2ae766da3.tar.gz
hdf5-d3b7ce468989bea9ef4e8f78e53b52b2ae766da3.tar.bz2
[svn-r21479] Merge revision 21101 from trunk to 1.8 branch:
HDFFV-7639 Purpose: Remove H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS and H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS #defines from source. Description: Two advanced parallel functionalities, special collective IO and complex derived datatypes, are not supported by older implementations of mpi, and thus our code limits the use of these features with #ifdefs and has checks in configure to set them (or not). Unfortunately, configure can't actually run a parallel check to see if these features are working (nor not) so it resorts to looking in the config files where they are explicity enabled or disabled based on versions of mpi, sytems being built on, or for no documented reason at all (i.e. just set to on or off as some 'default'). Overriding these settings is easy if need be, provided it is known that it needs to be done to get improved performance, and oftentimes it is not. Most new MPI implementations successfully handle the functionality requested when these #defines are set, and many of the "turn these features off" cases in the config files are for old (> 5 years) versions of MPI and retired systems (such as NCSA's tungsten). Therefore, the decision has been made to remove the support for these old versions of MPI and systems that cannot handle these behaviors. The #ifdefs and supporting setup in the config/ files and configure script has been removed, and the code executed when these options were not set removed from the source. In passing, this commit also cleans up some whitespace issues in both t_mpi.c and H5Dmpio.c. Furthermore, in t_mpi.c, the special collective IO test was not getting regularly run due to it being written to work only with four processes (we regularly test with six, previously with three), and thus it failed when actually run due to an out of bounds data buffer assignment. It has been modified to run at any number of processes greater than four, and the memory problem has been fixed so the test passes. Tested: Jam, h5committest, Ember
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_mpi.c267
1 files changed, 105 insertions, 162 deletions
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 7f3fe17..f05eee2 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -843,33 +843,13 @@ static int test_mpio_derived_dtype(char *filename) {
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
-#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS
if(retcode == -1) {
- if(mpi_rank == 0) {
- printf("Complicated derived datatype is NOT working at this platform\n");
- printf("Go back to hdf5/config and find the corresponding\n");
- printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n");
- printf("hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype-works='no'}\n");
- printf(" at the end of the file.\n");
- printf(" Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
- }
- retcode = 1;
- }
-#else
- if(retcode == 0) {
- if(mpi_rank == 0) {
- printf(" This is NOT an error, What it really says is\n");
- printf("Complicated derived datatype is WORKING at this platform\n");
- printf(" Go back to hdf5/config and find the corresponding \n");
- printf(" configure-specific file (for example, powerpc-ibm-aix5.x) and delete the line\n");
- printf("hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype-works='no'}\n");
- printf(" at the end of the file.\n");
- printf("Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
- }
- retcode = 1;
+ if(mpi_rank == 0) {
+ printf("Complicated derived datatype is NOT working at this platform\n");
+ printf(" Please report to help@hdfgroup.org about this problem.\n");
+ }
+ retcode = 1;
}
- if(retcode == -1) retcode = 0;
-#endif
return retcode;
}
/*
@@ -907,30 +887,29 @@ test_mpio_special_collective(char *filename)
char mpi_err_str[MPI_MAX_ERROR_STRING];
int mpi_err_strlen;
int mpi_err;
- char writedata[2];
- char *buf;
+ char writedata[2*DIMSIZE];
+ char filerep[7] = "native";
int i;
int count,bufcount;
int blocklens[2];
MPI_Aint offsets[2];
- MPI_Offset mpi_off;
+ MPI_Offset mpi_off = 0;
MPI_Status mpi_stat;
- int retcode;
+ int retcode = 0;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- retcode = 0;
/* create MPI data type */
etype = MPI_BYTE;
if(mpi_rank == 0 || mpi_rank == 1) {
count = DIMSIZE;
bufcount = 1;
- }
+ } /* end if */
else {
count = 0;
bufcount = 0;
- }
+ } /* end else */
blocklens[0] = count;
offsets[0] = mpi_rank*count;
@@ -938,108 +917,103 @@ test_mpio_special_collective(char *filename)
offsets[1] = (mpi_size+mpi_rank)*count;
if(count !=0) {
- if((mpi_err= MPI_Type_hindexed(2,blocklens,offsets,etype,&filetype))
- != MPI_SUCCESS){
+ if((mpi_err = MPI_Type_hindexed(2,
+ blocklens,
+ offsets,
+ etype,
+ &filetype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ return 1;
+ } /* end if */
+
+ if((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
+ } /* end if */
+
+ if((mpi_err = MPI_Type_hindexed(2,
+ blocklens,
+ offsets,
+ etype,
+ &buftype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ return 1;
+ } /* end if */
+
+ if((mpi_err = MPI_Type_commit(&buftype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
+ } /* end if */
+ } /* end if */
+ else {
+ filetype = MPI_BYTE;
+ buftype = MPI_BYTE;
+ } /* end else */
+
+ /* Open a file */
+ if ((mpi_err = MPI_File_open(MPI_COMM_WORLD,
+ filename,
+ MPI_MODE_RDWR | MPI_MODE_CREATE,
+ MPI_INFO_NULL,
+ &fh)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
- return 1;
- }
+ printf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
+ } /* end if */
- if((mpi_err=MPI_Type_commit(&filetype))!=MPI_SUCCESS){
+ /* each process writes some data */
+ for (i=0; i < 2*DIMSIZE; i++)
+ writedata[i] = (char)(mpi_rank*DIMSIZE + i);
+
+ /* Set the file view */
+ if((mpi_err = MPI_File_set_view(fh,
+ mpi_off,
+ MPI_BYTE,
+ filetype,
+ filerep,
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
- }
-
-
- if((mpi_err= MPI_Type_hindexed(2,blocklens,offsets,etype,&buftype))
- != MPI_SUCCESS){
+ printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
+ return 1;
+ } /* end if */
+
+ /* Collectively write into the file */
+ if ((mpi_err = MPI_File_write_at_all(fh,
+ mpi_off,
+ writedata,
+ bufcount,
+ buftype,
+ &mpi_stat)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
- return 1;
- }
+ printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
+ (long) mpi_off, bufcount, mpi_err_str);
+ return 1;
+ } /* end if */
- if((mpi_err=MPI_Type_commit(&buftype))!=MPI_SUCCESS){
+ /* Close the file */
+ if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
- }
- }
- else {
-
- filetype = MPI_BYTE;
- buftype = MPI_BYTE;
- }
-
- /* Open a file */
- if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE ,
- MPI_INFO_NULL, &fh))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
- }
-
- /* each process writes some data */
- for (i=0; i < 2*DIMSIZE; i++)
- writedata[i] = mpi_rank*DIMSIZE + i;
-
-
- mpi_off = 0;
- if((mpi_err = MPI_File_set_view(fh, mpi_off, MPI_BYTE, filetype, "native", MPI_INFO_NULL))
- != MPI_SUCCESS) {
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
- return 1;
- }
-
- buf = writedata;
- if ((mpi_err = MPI_File_write_at_all(fh, mpi_off, buf, bufcount, buftype,
- &mpi_stat))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, bufcount, mpi_err_str);
- return 1;
- };
-
- if ((mpi_err = MPI_File_close(&fh))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_close failed. \n");
- return 1;
- };
+ printf("MPI_File_close failed. \n");
+ return 1;
+ } /* end if */
+ /* Perform a barrier */
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
-#ifdef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS
if(retcode != 0) {
- if(mpi_rank == 0) {
- printf("special collective IO is NOT working at this platform\n");
- printf("Go back to hdf5/config and find the corresponding\n");
- printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n");
- printf("hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'}\n");
- printf(" at the end of the file.\n");
- printf(" Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
- }
- retcode = 1;
- }
-#else
- if(retcode == 0) {
- if(mpi_rank == 0) {
- printf(" This is NOT an error, What it really says is\n");
- printf("special collective IO is WORKING at this platform\n");
- printf(" Go back to hdf5/config and find the corresponding \n");
- printf(" configure-specific file (for example, powerpc-ibm-aix5.x) and delete the line\n");
- printf("hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'}\n");
- printf(" at the end of the file.\n");
- printf("Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
- }
- retcode = 1;
- }
-#endif
+ if(mpi_rank == 0) {
+ printf("special collective IO is NOT working at this platform\n");
+ printf(" Please report to help@hdfgroup.org about this problem.\n");
+ } /* end if */
+ retcode = 1;
+ } /* end if */
+
return retcode;
-}
+
+} /* test_mpio_special_collective */
/*
* parse the command line options
@@ -1226,22 +1200,8 @@ main(int argc, char **argv)
/*=======================================
* MPIO complicated derived datatype test
*=======================================*/
- /* test_mpio_derived_dtype often hangs when fails.
- * Do not run it if it is known NOT working unless ask to
- * run explicitly by high verbose mode.
- */
-#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS
MPI_BANNER("MPIO complicated derived datatype test...");
ret_code = test_mpio_derived_dtype(filenames[0]);
-#else
- if (VERBOSE_HI){
- MPI_BANNER("MPIO complicated derived datatype test...");
- ret_code = test_mpio_derived_dtype(filenames[0]);
- }else{
- MPI_BANNER("MPIO complicated derived datatype test SKIPPED.");
- ret_code = 0; /* fake ret_code */
- }
-#endif
ret_code = errors_sum(ret_code);
if (mpi_rank==0 && ret_code > 0){
printf("***FAILED with %d total errors\n", ret_code);
@@ -1251,34 +1211,17 @@ main(int argc, char **argv)
/*=======================================
* MPIO special collective IO test
*=======================================*/
- /* test_special_collective_io often hangs when fails.
- * Do not run it if it is known NOT working unless ask to
- * run explicitly by high verbose mode.
- */
- if(mpi_size !=4){
- MPI_BANNER("MPIO special collective io test SKIPPED.");
- if(mpi_rank == 0){
- printf("Use FOUR processes to run this test\n");
- printf("If you still see the <test SKIPPED>, use <-vh> option to verify the test\n");
- }
- ret_code = 0;
- goto sc_finish;
- }
+ if (mpi_size < 4) {
+ MPI_BANNER("MPIO special collective io test SKIPPED.");
+ if (mpi_rank == 0)
+ printf("This test needs at least four processes to run.\n");
+ ret_code = 0;
+ goto sc_finish;
+ } /* end if */
-#ifdef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS
MPI_BANNER("MPIO special collective io test...");
ret_code = test_mpio_special_collective(filenames[0]);
-#else
- if (VERBOSE_HI){
- MPI_BANNER("MPIO special collective io test...");
- ret_code = test_mpio_special_collective(filenames[0]);
- }else{
- MPI_BANNER("MPIO special collective io test SKIPPED.");
- ret_code = 0; /* fake ret_code */
- }
-#endif
-
sc_finish:
ret_code = errors_sum(ret_code);
if (mpi_rank==0 && ret_code > 0){