summaryrefslogtreecommitdiffstats
path: root/testpar/t_mpi.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2005-08-23 22:19:57 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2005-08-23 22:19:57 (GMT)
commit208436bfc4dc923e5908bf5933e4174c35f05633 (patch)
treef7520c2c388bd3d4a4936b158e42b2a6f6573dc7 /testpar/t_mpi.c
parentafe48303a983f6449000cf9088180a382928f8f8 (diff)
downloadhdf5-208436bfc4dc923e5908bf5933e4174c35f05633.zip
hdf5-208436bfc4dc923e5908bf5933e4174c35f05633.tar.gz
hdf5-208436bfc4dc923e5908bf5933e4174c35f05633.tar.bz2
[svn-r11291] Purpose:
Code cleaning. Description: The block of code that is conditioned by the H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS and manipulates the return code of test_mpio_derived_dtype, does not really belong in main. If return code of test_mpio_derived_dtype needs to be adjusted, it should be done in test_mpio_derived_dtype. Solution: Moved that block of code test_mpio_derived_dtype. Platforms tested: heping PP. Misc. update:
Diffstat (limited to 'testpar/t_mpi.c')
-rw-r--r--testpar/t_mpi.c65
1 files changed, 32 insertions, 33 deletions
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 0d373d6..0bf6d05 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -661,7 +661,7 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Aint offsets[1],adv_offsets[2];
int blocklens[1],adv_blocklens[2];
int count,outcount;
- int ret;
+ int retcode;
int mpi_rank,mpi_size;
@@ -669,7 +669,7 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- ret = 0;
+ retcode = 0;
for(i=0;i<2;i++)
buf[i] = i+1;
@@ -779,7 +779,7 @@ static int test_mpio_derived_dtype(char *filename) {
}
if(outbuf[1]==0) {
- ret = 0;
+ retcode = 0;
}
if(outbuf[1]==2) {
/* if(mpi_rank == 0) {
@@ -788,7 +788,7 @@ static int test_mpio_derived_dtype(char *filename) {
printf("configure-specific file and change ?????\n");
}
*/
- ret = -1;
+ retcode = -1;
}
if((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS){
@@ -799,7 +799,34 @@ static int test_mpio_derived_dtype(char *filename) {
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
- return ret;
+#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_mpi_complex_derived_datatype_works=${hdf5_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_mpi_complex_derived_datatype_works=${hdf5_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(retcode == -1) retcode = 0;
+#endif
+ return retcode;
}
/*
* parse the command line options
@@ -925,39 +952,11 @@ main(int argc, char **argv)
}else{
MPI_BANNER("MPIO complicated derived datatype test...");
ret_code = test_mpio_derived_dtype(filenames[0]);
-#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS
- if(ret_code == -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_mpi_complex_derived_datatype_works=${hdf5_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");
- }
- ret_code = 1;
- }
-#else
- if(ret_code == 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_mpi_complex_derived_datatype_works=${hdf5_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");
- }
- ret_code = 1;
- }
- if(ret_code == -1) ret_code = 0;
-
ret_code = errors_sum(ret_code);
if (mpi_rank==0 && ret_code > 0){
printf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
-#endif
}
MPI_BANNER("MPIO 1 write Many read test...");