diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-06 18:31:40 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-06 18:31:40 (GMT) |
commit | 8266f69f5eb1511e207d7956e70d65f9a00af917 (patch) | |
tree | be85f52da22c1eb122724fdf1ea31caca95e7d97 /testpar | |
parent | b3a2bd81a1c2d27ea9e34e833149401e340bdc92 (diff) | |
download | hdf5-8266f69f5eb1511e207d7956e70d65f9a00af917.zip hdf5-8266f69f5eb1511e207d7956e70d65f9a00af917.tar.gz hdf5-8266f69f5eb1511e207d7956e70d65f9a00af917.tar.bz2 |
[svn-r24614] Bring 24612 from trunk:
fix bugs in parallel tests exposed in corner cases when running with 1 or 2 processes.
First bug is in testpar/t_mdset.c, where the test reports an error in addition to skipping the test if there are less than three procs. Fix to just skip the test.
Second bug is in testpar/t_dset.c in actual_io_mode tests, where incorrect expected value for IO mode was set if the number of procs running the test is 1.
tested with h5committest.
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_dset.c | 31 | ||||
-rw-r--r-- | testpar/t_mdset.c | 9 | ||||
-rw-r--r-- | testpar/testphdf5.c | 18 |
3 files changed, 30 insertions, 28 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 743de3a..fca87f6 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -2703,7 +2703,10 @@ test_actual_io_mode(int selection_mode) { test_name = "Multi Chunk - Collective"; actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK; - actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + if(mpi_size > 1) + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + else + actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT; break; /* Mixed I/O with optimization */ @@ -2780,11 +2783,14 @@ test_actual_io_mode(int selection_mode) { test_name = "Multi Chunk - Mixed (Disagreement)"; actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK; - - if(mpi_rank == 0) - actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + if(mpi_size > 1) { + if(mpi_rank == 0) + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + else + actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED; + } else - actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED; + actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT; break; @@ -2843,7 +2849,6 @@ test_actual_io_mode(int selection_mode) { ret = H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - /* Get the number of elements in the selection */ length = dim0 * dim1; @@ -2921,7 +2926,6 @@ test_actual_io_mode(int selection_mode) { VRFY((actual_chunk_opt_mode_read == actual_chunk_opt_mode_write), "reading and writing are the same for actual_chunk_opt_mode"); - /* Test values */ if(actual_chunk_opt_mode_expected != (unsigned) -1 && actual_io_mode_expected != (unsigned) -1) { sprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name); @@ -3012,7 +3016,7 @@ actual_io_mode_tests(void) { */ test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_IND); test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_COL); - + /* The Multi Chunk Mixed test requires atleast three processes. */ if (mpi_size > 2) test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX); @@ -3110,8 +3114,8 @@ test_no_collective_cause_mode(int selection_mode) int length; int * buffer; int i; - MPI_Comm mpi_comm = MPI_COMM_NULL; - MPI_Info mpi_info = MPI_INFO_NULL; + MPI_Comm mpi_comm; + MPI_Info mpi_info; hid_t fid = -1; hid_t sid = -1; hid_t dataset = -1; @@ -3138,7 +3142,7 @@ test_no_collective_cause_mode(int selection_mode) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Barrier(MPI_COMM_WORLD); - + HDassert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; @@ -3675,11 +3679,6 @@ test_no_collective_cause_mode_filter(int selection_mode) void no_collective_cause_tests(void) { - int mpi_size = -1; - int mpi_rank = -1; - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank); - /* * Test individual cause */ diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 8fc739e..516cc2f 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -1779,12 +1779,9 @@ void rr_obj_hdr_flush_confusion(void) */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - if (mpi_size < 3){ - HDfprintf(stdout, "%s needs at least 3 processes to run. Terminated.\n", - fcn_name); - nerrors++; - return; - } + + HDassert(mpi_size > 2); + is_reader = mpi_rank % 2; mrc = MPI_Comm_split(MPI_COMM_WORLD, is_reader, mpi_rank, &comm); VRFY((mrc==MPI_SUCCESS), "MPI_Comm_split"); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index b594053..3c5f91d 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -342,7 +342,7 @@ int main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("Failed to turn off atexit processing. Continue.\n", mpi_rank); + printf("Failed to turn off atexit processing. Continue.\n"); }; H5open(); h5_show_hostname(); @@ -486,11 +486,17 @@ int main(int argc, char **argv) "I/O mode confusion test -- hangs quickly on failure", &io_mode_confusion_params); - rr_obj_flush_confusion_params.name = PARATESTFILE; - rr_obj_flush_confusion_params.count = 0; /* value not used */ - AddTest("rrobjflushconf", rr_obj_hdr_flush_confusion, NULL, - "round robin object header flush confusion test", - &rr_obj_flush_confusion_params); + if((mpi_size < 3) && MAINPROCESS) { + printf("rr_obj_hdr_flush_confusion test needs at least 3 processes.\n"); + printf("rr_obj_hdr_flush_confusion test will be skipped \n"); + } + if(mpi_size > 2) { + rr_obj_flush_confusion_params.name = PARATESTFILE; + rr_obj_flush_confusion_params.count = 0; /* value not used */ + AddTest("rrobjflushconf", rr_obj_hdr_flush_confusion, NULL, + "round robin object header flush confusion test", + &rr_obj_flush_confusion_params); + } AddTest("tldsc", lower_dim_size_comp_test, NULL, |