diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-06 17:56:45 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-06 17:56:45 (GMT) |
commit | 6ceb9711b8f891229cf4206417a824ffb7850c3d (patch) | |
tree | 7b837f45ff5605abd1a51d918b98790dfa8488ca /testpar/t_dset.c | |
parent | 1febc8a4531e221c468c55a1f367b110d15094b9 (diff) | |
download | hdf5-6ceb9711b8f891229cf4206417a824ffb7850c3d.zip hdf5-6ceb9711b8f891229cf4206417a824ffb7850c3d.tar.gz hdf5-6ceb9711b8f891229cf4206417a824ffb7850c3d.tar.bz2 |
[svn-r24612] 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/t_dset.c')
-rw-r--r-- | testpar/t_dset.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 34ccab7..246d2d9 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 */ |