Add expedited testing support to t_filters_parallel (#3665)

This commit is contained in:
jhendersonHDF 2023-10-12 16:12:57 -05:00 committed by GitHub
parent 72f94bc1f5
commit 3ec119b558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,8 @@ static MPI_Info info = MPI_INFO_NULL;
static int mpi_rank = 0;
static int mpi_size = 0;
static int test_express_level_g;
int nerrors = 0;
/* Arrays of filter ID values and filter names (should match each other) */
@ -9713,6 +9715,7 @@ main(int argc, char **argv)
hid_t fapl_id = H5I_INVALID_HID;
hid_t dxpl_id = H5I_INVALID_HID;
hid_t dcpl_id = H5I_INVALID_HID;
bool expedite_testing = false;
int mpi_code;
/* Initialize MPI */
@ -9763,6 +9766,17 @@ main(int argc, char **argv)
TestAlarmOn();
/*
* Get the TestExpress level setting
*/
test_express_level_g = GetTestExpress();
if ((test_express_level_g >= 1) && MAINPROCESS) {
printf("** Some tests will be skipped due to TestExpress setting.\n");
printf("** Exhaustive tests will only be performed for the first available filter.\n");
printf("** Set the HDF5TestExpress environment variable to 0 to perform exhaustive testing for all "
"available filters.\n\n");
}
/*
* Obtain and broadcast seed value since ranks
* aren't guaranteed to arrive here at exactly
@ -9829,9 +9843,26 @@ main(int argc, char **argv)
dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dcpl_id >= 0), "DCPL creation succeeded");
/* Add a space after the HDF5_PARAPREFIX notice from h5_fixname */
if (MAINPROCESS)
puts("");
/* Run tests with all available filters */
for (cur_filter_idx = 0; cur_filter_idx < num_filters; cur_filter_idx++) {
H5D_selection_io_mode_t sel_io_mode;
H5Z_filter_t cur_filter = filterIDs[cur_filter_idx];
htri_t filter_avail;
/* Make sure current filter is available before testing with it */
filter_avail = H5Zfilter_avail(cur_filter);
VRFY((filter_avail >= 0), "H5Zfilter_avail succeeded");
if (!filter_avail) {
if (MAINPROCESS)
printf("== SKIPPED tests with filter '%s' - filter unavailable ==\n\n",
filterNames[cur_filter_idx]);
continue;
}
/* Run tests with different selection I/O modes */
for (sel_io_mode = H5D_SELECTION_IO_MODE_DEFAULT; sel_io_mode <= H5D_SELECTION_IO_MODE_ON;
@ -9849,12 +9880,10 @@ main(int argc, char **argv)
/* Run with each of the test modes (single dataset, multiple datasets, etc.) */
for (test_mode = USE_SINGLE_DATASET; test_mode < TEST_MODE_SENTINEL; test_mode++) {
H5Z_filter_t cur_filter = filterIDs[cur_filter_idx];
const char *sel_io_str;
const char *alloc_time;
const char *mode;
unsigned filter_config;
htri_t filter_avail;
char group_name[512];
switch (sel_io_mode) {
@ -9902,6 +9931,23 @@ main(int argc, char **argv)
mode = "unknown";
}
/*
* If expediting the remaining tests, just run with a single
* configuration that is interesting enough. In this case,
* run with:
*
* - A single dataset
* - Incremental file space allocation timing
* - Linked-chunk (single) I/O
* - The default setting for selection I/O
*/
if (expedite_testing) {
if (test_mode != USE_SINGLE_DATASET || space_alloc_time != H5D_ALLOC_TIME_INCR ||
chunk_opt != H5FD_MPIO_CHUNK_ONE_IO ||
sel_io_mode != H5D_SELECTION_IO_MODE_DEFAULT)
continue;
}
if (MAINPROCESS)
printf("== Running tests in mode '%s' with filter '%s' using selection I/O mode "
"'%s', '%s' and '%s' allocation time ==\n\n",
@ -9910,17 +9956,6 @@ main(int argc, char **argv)
: "Multi-Chunk I/O",
alloc_time);
/* Make sure current filter is available before testing with it */
filter_avail = H5Zfilter_avail(cur_filter);
VRFY((filter_avail >= 0), "H5Zfilter_avail succeeded");
if (!filter_avail) {
if (MAINPROCESS)
printf(" ** SKIPPED tests with filter '%s' - filter unavailable **\n\n",
filterNames[cur_filter_idx]);
continue;
}
/* Get the current filter's info */
VRFY((H5Zget_filter_info(cur_filter, &filter_config) >= 0),
"H5Zget_filter_info succeeded");
@ -9987,6 +10022,13 @@ main(int argc, char **argv)
}
}
}
/*
* If the TestExpress level setting isn't set for exhaustive
* testing, run smoke checks for the other filters
*/
if (!expedite_testing && (test_express_level_g >= 1))
expedite_testing = true;
}
VRFY((H5Pclose(dcpl_id) >= 0), "DCPL close succeeded");