diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2012-10-29 18:59:05 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2012-10-29 18:59:05 (GMT) |
commit | 0cf58a4755eb6f3e7be64b0f05f2bb8ef6f7ad0d (patch) | |
tree | 7f5576b9ed8e414606093b6872ced10dd0f5bf0e /testpar/t_dset.c | |
parent | 78b07da7aea98598a74bce25335b9435aa29cdb9 (diff) | |
download | hdf5-0cf58a4755eb6f3e7be64b0f05f2bb8ef6f7ad0d.zip hdf5-0cf58a4755eb6f3e7be64b0f05f2bb8ef6f7ad0d.tar.gz hdf5-0cf58a4755eb6f3e7be64b0f05f2bb8ef6f7ad0d.tar.bz2 |
[svn-r22987] ported revisions from 22742 to 22986 from the trunk
Diffstat (limited to 'testpar/t_dset.c')
-rw-r--r-- | testpar/t_dset.c | 94 |
1 files changed, 45 insertions, 49 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c index d9139d3..22eefbc 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -3107,12 +3107,12 @@ actual_io_mode_tests(void) { static void test_no_collective_cause_mode(int selection_mode) { - int no_collective_cause_local_write = 0; - int no_collective_cause_local_read = 0; - int no_collective_cause_local_expected = 0; - int no_collective_cause_global_write = 0; - int no_collective_cause_global_read = 0; - int no_collective_cause_global_expected = 0; + uint32_t no_collective_cause_local_write = 0; + uint32_t no_collective_cause_local_read = 0; + uint32_t no_collective_cause_local_expected = 0; + uint32_t no_collective_cause_global_write = 0; + uint32_t no_collective_cause_global_read = 0; + uint32_t no_collective_cause_global_expected = 0; hsize_t coord[NELM][RANK]; const char * filename; @@ -3145,6 +3145,18 @@ test_no_collective_cause_mode(int selection_mode) #endif /* set to global value as default */ int l_facc_type = facc_type; + char message[256]; + + /* Set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + MPI_Barrier(MPI_COMM_WORLD); + + HDassert(mpi_size >= 1); + + mpi_comm = MPI_COMM_WORLD; + mpi_info = MPI_INFO_NULL; /* Create the dataset creation plist */ dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -3193,15 +3205,6 @@ test_no_collective_cause_mode(int selection_mode) VRFY((sid >= 0), "H5Screate_simple succeeded"); } - /* Set up MPI parameters */ - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - - - HDassert(mpi_size >= 1); - - mpi_comm = MPI_COMM_WORLD; - mpi_info = MPI_INFO_NULL; filename = (const char *)GetTestParameters(); HDassert(filename != NULL); @@ -3399,17 +3402,12 @@ test_no_collective_cause_mode(int selection_mode) "reading and writing are the same for global cause of Broken Collective I/O"); /* Test values */ - if(no_collective_cause_local_expected != (unsigned) -1 && no_collective_cause_global_expected != (unsigned) -1) { - char message[100]; - sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name); - VRFY((no_collective_cause_local_write == no_collective_cause_local_expected), message); - sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name); - VRFY((no_collective_cause_global_write == no_collective_cause_global_expected), message); - } else { - HDfprintf(stderr, "%s %d -> (%d,%d)\n", test_name, mpi_rank, - test_no_collective_cause_mode, no_collective_cause_local_write); - } - + memset (message, 0, sizeof (message)); + sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name); + VRFY((no_collective_cause_local_write == no_collective_cause_local_expected), message); + memset (message, 0, sizeof (message)); + sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name); + VRFY((no_collective_cause_global_write == no_collective_cause_global_expected), message); /* Release some resources */ if (sid) @@ -3463,10 +3461,10 @@ test_no_collective_cause_mode(int selection_mode) static void test_no_collective_cause_mode_filter(int selection_mode) { - int no_collective_cause_local_read = 0; - int no_collective_cause_local_expected = 0; - int no_collective_cause_global_read = 0; - int no_collective_cause_global_expected = 0; + uint32_t no_collective_cause_local_read = 0; + uint32_t no_collective_cause_local_expected = 0; + uint32_t no_collective_cause_global_read = 0; + uint32_t no_collective_cause_global_expected = 0; const char * filename; const char * test_name; @@ -3495,7 +3493,18 @@ test_no_collective_cause_mode_filter(int selection_mode) #ifdef H5_HAVE_FILTER_FLETCHER32 H5Z_filter_t filter_info; #endif + char message[256]; + + /* Set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + MPI_Barrier(MPI_COMM_WORLD); + + HDassert(mpi_size >= 1); + mpi_comm = MPI_COMM_WORLD; + mpi_info = MPI_INFO_NULL; /* Create the dataset creation plist */ dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -3523,15 +3532,6 @@ test_no_collective_cause_mode_filter(int selection_mode) sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); - /* Set up MPI parameters */ - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - - - HDassert(mpi_size >= 1); - - mpi_comm = MPI_COMM_WORLD; - mpi_info = MPI_INFO_NULL; filename = (const char *)GetTestParameters(); HDassert(filename != NULL); @@ -3651,16 +3651,12 @@ test_no_collective_cause_mode_filter(int selection_mode) VRFY((ret >= 0), "retriving no collective cause succeeded" ); /* Test values */ - if(no_collective_cause_local_expected != (unsigned) -1 && no_collective_cause_global_expected != (unsigned) -1) { - char message[100]; - sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name); - VRFY((no_collective_cause_local_read == no_collective_cause_local_expected), message); - sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name); - VRFY((no_collective_cause_global_read == no_collective_cause_global_expected), message); - } else { - HDfprintf(stderr, "%s %d -> (%d,%d)\n", test_name, mpi_rank, - test_no_collective_cause_mode_filter, no_collective_cause_local_read); - } + memset (message, 0, sizeof (message)); + sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name); + VRFY((no_collective_cause_local_read == (uint32_t)no_collective_cause_local_expected), message); + memset (message, 0, sizeof (message)); + sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name); + VRFY((no_collective_cause_global_read == (uint32_t)no_collective_cause_global_expected), message); /* Release some resources */ if (sid) |