diff options
Diffstat (limited to 'testpar/t_shapesame.c')
-rw-r--r-- | testpar/t_shapesame.c | 132 |
1 files changed, 86 insertions, 46 deletions
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 0a3d3d0..4f48f93 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -24,6 +24,21 @@ #include "H5Spkg.h" /* Dataspaces */ #include "testphdf5.h" +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif + +/* FILENAME and filenames must have the same number of names. + * Use PARATESTFILE in general and use a separated filename only if the file + * created in one test is accessed by a different test. + * filenames[0] is reserved as the file name for PARATESTFILE. + */ +#define NFILENAME 2 +#define PARATESTFILE filenames[0] +const char *FILENAME[NFILENAME] = {"ShapeSameTest", NULL}; +char *filenames[NFILENAME]; +hid_t fapl; /* file access property list */ + /* On Lustre (and perhaps other parallel file systems?), we have severe * slow downs if two or more processes attempt to access the same file system * block. To minimize this problem, we set alignment in the shape same tests @@ -1685,7 +1700,8 @@ static void contig_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const int chunk_edge_size, const int small_rank, const int large_rank, const bool use_collective_io, const hid_t dset_type, int express_test, int *skips_ptr, int max_skips, - int64_t *total_tests_ptr, int64_t *tests_run_ptr, int64_t *tests_skipped_ptr) + int64_t *total_tests_ptr, int64_t *tests_run_ptr, int64_t *tests_skipped_ptr, + int mpi_rank) { #if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; @@ -1751,6 +1767,10 @@ contig_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i /* int64_t tests_skipped = */ 0}; struct hs_dr_pio_test_vars_t *tv_ptr = &test_vars; + if (MAINPROCESS) + printf("\r - running test #%lld: small rank = %d, large rank = %d", (long long)(test_num + 1), + small_rank, large_rank); + hs_dr_pio_test__setup(test_num, edge_size, -1, chunk_edge_size, small_rank, large_rank, use_collective_io, dset_type, express_test, tv_ptr); @@ -1923,9 +1943,9 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) /* contiguous data set, independent I/O */ chunk_edge_size = 0; - contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, - large_rank, false, dset_type, express_test, &skips, - max_skips, &total_tests, &tests_run, &tests_skipped); + contig_hs_dr_pio_test__run_test( + test_num, edge_size, chunk_edge_size, small_rank, large_rank, false, dset_type, + express_test, &skips, max_skips, &total_tests, &tests_run, &tests_skipped, mpi_rank); test_num++; break; /* end of case IND_CONTIG */ @@ -1934,9 +1954,9 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) /* contiguous data set, collective I/O */ chunk_edge_size = 0; - contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, - large_rank, true, dset_type, express_test, &skips, - max_skips, &total_tests, &tests_run, &tests_skipped); + contig_hs_dr_pio_test__run_test( + test_num, edge_size, chunk_edge_size, small_rank, large_rank, true, dset_type, + express_test, &skips, max_skips, &total_tests, &tests_run, &tests_skipped, mpi_rank); test_num++; break; /* end of case COL_CONTIG */ @@ -1945,9 +1965,9 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) /* chunked data set, independent I/O */ chunk_edge_size = 5; - contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, - large_rank, false, dset_type, express_test, &skips, - max_skips, &total_tests, &tests_run, &tests_skipped); + contig_hs_dr_pio_test__run_test( + test_num, edge_size, chunk_edge_size, small_rank, large_rank, false, dset_type, + express_test, &skips, max_skips, &total_tests, &tests_run, &tests_skipped, mpi_rank); test_num++; break; /* end of case IND_CHUNKED */ @@ -1956,9 +1976,9 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) /* chunked data set, collective I/O */ chunk_edge_size = 5; - contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, - large_rank, true, dset_type, express_test, &skips, - max_skips, &total_tests, &tests_run, &tests_skipped); + contig_hs_dr_pio_test__run_test( + test_num, edge_size, chunk_edge_size, small_rank, large_rank, true, dset_type, + express_test, &skips, max_skips, &total_tests, &tests_run, &tests_skipped, mpi_rank); test_num++; break; /* end of case COL_CHUNKED */ @@ -1977,9 +1997,13 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) } } - if ((MAINPROCESS) && (tests_skipped > 0)) { - fprintf(stdout, " %" PRId64 " of %" PRId64 " subtests skipped to expedite testing.\n", - tests_skipped, total_tests); + if (MAINPROCESS) { + if (tests_skipped > 0) { + fprintf(stdout, " %" PRId64 " of %" PRId64 " subtests skipped to expedite testing.\n", + tests_skipped, total_tests); + } + else + printf("\n"); } return; @@ -3609,7 +3633,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i const int chunk_edge_size, const int small_rank, const int large_rank, const bool use_collective_io, const hid_t dset_type, const int express_test, int *skips_ptr, int max_skips, int64_t *total_tests_ptr, - int64_t *tests_run_ptr, int64_t *tests_skipped_ptr) + int64_t *tests_run_ptr, int64_t *tests_skipped_ptr, int mpi_rank) { #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG @@ -3676,6 +3700,10 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i /* int64_t tests_skipped = */ 0}; struct hs_dr_pio_test_vars_t *tv_ptr = &test_vars; + if (MAINPROCESS) + printf("\r - running test #%lld: small rank = %d, large rank = %d", (long long)(test_num + 1), + small_rank, large_rank); + hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, chunk_edge_size, small_rank, large_rank, use_collective_io, dset_type, express_test, tv_ptr); @@ -3840,7 +3868,7 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) ckrbrd_hs_dr_pio_test__run_test(test_num, edge_size, checker_edge_size, chunk_edge_size, small_rank, large_rank, false, dset_type, express_test, &skips, max_skips, &total_tests, &tests_run, - &tests_skipped); + &tests_skipped, mpi_rank); test_num++; break; /* end of case IND_CONTIG */ @@ -3848,9 +3876,10 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) case COL_CONTIG: /* contiguous data set, collective I/O */ chunk_edge_size = 0; - ckrbrd_hs_dr_pio_test__run_test( - test_num, edge_size, checker_edge_size, chunk_edge_size, small_rank, large_rank, true, - dset_type, express_test, &skips, max_skips, &total_tests, &tests_run, &tests_skipped); + ckrbrd_hs_dr_pio_test__run_test(test_num, edge_size, checker_edge_size, chunk_edge_size, + small_rank, large_rank, true, dset_type, express_test, + &skips, max_skips, &total_tests, &tests_run, + &tests_skipped, mpi_rank); test_num++; break; /* end of case COL_CONTIG */ @@ -3861,7 +3890,7 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) ckrbrd_hs_dr_pio_test__run_test(test_num, edge_size, checker_edge_size, chunk_edge_size, small_rank, large_rank, false, dset_type, express_test, &skips, max_skips, &total_tests, &tests_run, - &tests_skipped); + &tests_skipped, mpi_rank); test_num++; break; /* end of case IND_CHUNKED */ @@ -3869,9 +3898,10 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) case COL_CHUNKED: /* chunked data set, collective I/O */ chunk_edge_size = 5; - ckrbrd_hs_dr_pio_test__run_test( - test_num, edge_size, checker_edge_size, chunk_edge_size, small_rank, large_rank, true, - dset_type, express_test, &skips, max_skips, &total_tests, &tests_run, &tests_skipped); + ckrbrd_hs_dr_pio_test__run_test(test_num, edge_size, checker_edge_size, chunk_edge_size, + small_rank, large_rank, true, dset_type, express_test, + &skips, max_skips, &total_tests, &tests_run, + &tests_skipped, mpi_rank); test_num++; break; /* end of case COL_CHUNKED */ @@ -3890,9 +3920,13 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) } } - if ((MAINPROCESS) && (tests_skipped > 0)) { - fprintf(stdout, " %" PRId64 " of %" PRId64 " subtests skipped to expedite testing.\n", - tests_skipped, total_tests); + if (MAINPROCESS) { + if (tests_skipped > 0) { + fprintf(stdout, " %" PRId64 " of %" PRId64 " subtests skipped to expedite testing.\n", + tests_skipped, total_tests); + } + else + printf("\n"); } return; @@ -3905,12 +3939,6 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) * Main driver of the Parallel HDF5 tests */ -#include "testphdf5.h" - -#ifndef PATH_MAX -#define PATH_MAX 512 -#endif /* !PATH_MAX */ - /* global variables */ int dim0; int dim1; @@ -3928,17 +3956,6 @@ void *old_client_data; /* previous error handler arg.*/ /* other option flags */ -/* FILENAME and filenames must have the same number of names. - * Use PARATESTFILE in general and use a separated filename only if the file - * created in one test is accessed by a different test. - * filenames[0] is reserved as the file name for PARATESTFILE. - */ -#define NFILENAME 2 -#define PARATESTFILE filenames[0] -const char *FILENAME[NFILENAME] = {"ShapeSameTest", NULL}; -char *filenames[NFILENAME]; -hid_t fapl; /* file access property list */ - #ifdef USE_PAUSE /* pause the process for a moment to allow debugger to attach if desired. */ /* Will pause more if greenlight file is not present but will eventually */ @@ -4289,6 +4306,28 @@ main(int argc, char **argv) H5open(); h5_show_hostname(); + fapl = H5Pcreate(H5P_FILE_ACCESS); + + /* Get the capability flag of the VOL connector being used */ + if (H5Pget_vol_cap_flags(fapl, &vol_cap_flags_g) < 0) { + if (MAINPROCESS) + printf("Failed to get the capability flag of the VOL connector being used\n"); + + MPI_Finalize(); + return -1; + } + + /* Make sure the connector supports the API functions being tested. This test only + * uses a few API functions, such as H5Fcreate/close/delete, H5Dcreate/write/read/close, + */ + if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC)) { + if (MAINPROCESS) + printf("API functions for basic file and dataset aren't supported with this connector\n"); + + MPI_Finalize(); + return 0; + } + memset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { if (NULL == (filenames[i] = malloc(PATH_MAX))) { @@ -4316,7 +4355,6 @@ main(int argc, char **argv) TestInfo(argv[0]); /* setup file access property list */ - fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL); /* Parse command line arguments */ @@ -4343,6 +4381,8 @@ main(int argc, char **argv) /* Clean up test files */ h5_clean_files(FILENAME, fapl); + H5Pclose(fapl); + nerrors += GetTestNumErrs(); /* Gather errors from all processes */ |