Integrate API tests with testing framework (#5133)

Allows skipping of individual tests by interface or by name
This commit is contained in:
jhendersonHDF
2024-11-26 07:34:52 -06:00
committed by GitHub
parent cf222df941
commit fd7aef59ed
43 changed files with 3507 additions and 3000 deletions
-5
View File
@@ -394,11 +394,6 @@ if (HDF5_EXPORTED_TARGETS AND HDF5_TEST_API_INSTALL)
foreach (api_test_extra ${HDF5_API_PAR_TESTS_EXTRA})
if (TARGET ${api_test_extra})
set_target_properties (
${api_test_extra}
PROPERTIES
OUTPUT_NAME "h5_api_test_parallel_${api_test_extra}"
)
install (
TARGETS
${api_test_extra}
+257 -212
View File
@@ -12,42 +12,57 @@
#include "H5_api_async_test_parallel.h"
#ifdef H5ESpublic_H
static void print_async_test_header(const void *params);
static int test_one_dataset_io(void);
static int test_multi_dataset_io(void);
static int test_multi_file_dataset_io(void);
static int test_multi_file_grp_dset_io(void);
static int test_set_extent(void);
static int test_attribute_exists(void);
static int test_attribute_io(void);
static int test_attribute_io_tconv(void);
static int test_attribute_io_compound(void);
static int test_group(void);
static int test_link(void);
static int test_ocopy_orefresh(void);
static int test_file_reopen(void);
static void
print_async_test_header(const void *params)
{
bool coll_md_read = true;
/*
* The array of parallel async tests to be performed.
*/
static int (*par_async_tests[])(void) = {
test_one_dataset_io,
test_multi_dataset_io,
test_multi_file_dataset_io,
test_multi_file_grp_dset_io,
test_set_extent,
test_attribute_exists,
test_attribute_io,
test_attribute_io_tconv,
test_attribute_io_compound,
test_group,
test_link,
test_ocopy_orefresh,
test_file_reopen,
};
if (params)
coll_md_read = *(const bool *)params;
bool coll_metadata_read = true;
if (coll_md_read) {
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Async Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
#ifndef H5_API_TEST_HAVE_ASYNC
printf("SKIPPED due to no async support\n");
#endif
}
}
#ifdef H5_API_TEST_HAVE_ASYNC
else if (MAINPROCESS) {
printf("\n");
printf("****************************************************\n");
printf("* *\n");
printf("* Re-running tests with independent metadata reads *\n");
printf("* *\n");
printf("****************************************************\n\n");
}
#endif
}
#ifdef H5_API_TEST_HAVE_ASYNC
static void test_async_one_dataset_io(const void *params);
static void test_async_multi_dataset_io(const void *params);
static void test_async_multi_file_dataset_io(const void *params);
static void test_async_multi_file_grp_dset_io(const void *params);
static void test_async_set_extent(const void *params);
static void test_async_attribute_exists(const void *params);
static void test_async_attribute_io(const void *params);
static void test_async_attribute_io_tconv(const void *params);
static void test_async_attribute_io_compound(const void *params);
static void test_async_group(const void *params);
static void test_async_link(const void *params);
static void test_async_ocopy_orefresh(const void *params);
static void test_async_file_reopen(const void *params);
/* Highest "printf" file created (starting at 0) */
int max_printf_file = -1;
@@ -57,8 +72,8 @@ int max_printf_file = -1;
* of the dataset.
*/
#define ONE_DATASET_IO_TEST_SPACE_RANK 2
static int
test_one_dataset_io(void)
static void
test_async_one_dataset_io(const void *params)
{
hsize_t *dims = NULL;
hsize_t start[ONE_DATASET_IO_TEST_SPACE_RANK];
@@ -79,8 +94,11 @@ test_one_dataset_io(void)
TESTING_MULTIPART("single dataset I/O");
TESTING_2("test setup");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (MAINPROCESS) {
SKIPPED();
@@ -88,12 +106,10 @@ test_one_dataset_io(void)
" API functions for basic file, dataset, or flush aren't supported with this connector\n");
}
return 0;
return;
}
TESTING_2("test setup");
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -389,7 +405,7 @@ test_one_dataset_io(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -410,7 +426,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef ONE_DATASET_IO_TEST_SPACE_RANK
@@ -421,8 +437,8 @@ error:
*/
#define MULTI_DATASET_IO_TEST_SPACE_RANK 2
#define MULTI_DATASET_IO_TEST_NDSETS 5
static int
test_multi_dataset_io(void)
static void
test_async_multi_dataset_io(const void *params)
{
hsize_t *dims = NULL;
hsize_t start[MULTI_DATASET_IO_TEST_SPACE_RANK];
@@ -444,8 +460,11 @@ test_multi_dataset_io(void)
TESTING_MULTIPART("multi dataset I/O");
TESTING_2("test setup");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (MAINPROCESS) {
SKIPPED();
@@ -453,12 +472,10 @@ test_multi_dataset_io(void)
" API functions for basic file, dataset, or flush aren't supported with this connector\n");
}
return 0;
return;
}
TESTING_2("test setup");
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -712,7 +729,7 @@ test_multi_dataset_io(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -734,7 +751,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef MULTI_DATASET_IO_TEST_SPACE_RANK
#undef MULTI_DATASET_IO_TEST_NDSETS
@@ -745,8 +762,8 @@ error:
*/
#define MULTI_FILE_DATASET_IO_TEST_SPACE_RANK 2
#define MULTI_FILE_DATASET_IO_TEST_NFILES 5
static int
test_multi_file_dataset_io(void)
static void
test_async_multi_file_dataset_io(const void *params)
{
hsize_t *dims = NULL;
hsize_t start[MULTI_FILE_DATASET_IO_TEST_SPACE_RANK];
@@ -770,8 +787,11 @@ test_multi_file_dataset_io(void)
TESTING_MULTIPART("multi file dataset I/O");
TESTING_2("test setup");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (MAINPROCESS) {
SKIPPED();
@@ -779,12 +799,10 @@ test_multi_file_dataset_io(void)
" API functions for basic file, dataset, or flush aren't supported with this connector\n");
}
return 0;
return;
}
TESTING_2("test setup");
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -1136,7 +1154,7 @@ test_multi_file_dataset_io(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -1159,7 +1177,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef MULTI_FILE_DATASET_IO_TEST_SPACE_RANK
#undef MULTI_FILE_DATASET_IO_TEST_NFILES
@@ -1170,8 +1188,8 @@ error:
*/
#define MULTI_FILE_GRP_DSET_IO_TEST_SPACE_RANK 2
#define MULTI_FILE_GRP_DSET_IO_TEST_NFILES 5
static int
test_multi_file_grp_dset_io(void)
static void
test_async_multi_file_grp_dset_io(const void *params)
{
hsize_t *dims = NULL;
hsize_t start[MULTI_FILE_GRP_DSET_IO_TEST_SPACE_RANK];
@@ -1193,21 +1211,21 @@ test_multi_file_grp_dset_io(void)
TESTING_MULTIPART("multi file dataset I/O with groups");
TESTING_2("test setup");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC)) {
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC)) {
if (MAINPROCESS) {
SKIPPED();
printf(
" API functions for basic file, group, or dataset aren't supported with this connector\n");
}
return 0;
return;
}
TESTING_2("test setup");
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -1552,7 +1570,7 @@ test_multi_file_grp_dset_io(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -1574,7 +1592,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef MULTI_FILE_GRP_DSET_IO_TEST_SPACE_RANK
#undef MULTI_FILE_GRP_DSET_IO_TEST_NFILES
@@ -1587,8 +1605,8 @@ error:
*/
#define SET_EXTENT_TEST_SPACE_RANK 2
#define SET_EXTENT_TEST_NUM_EXTENDS 6
static int
test_set_extent(void)
static void
test_async_set_extent(const void *params)
{
hsize_t *dims = NULL;
hsize_t *maxdims = NULL;
@@ -1615,7 +1633,8 @@ test_set_extent(void)
TESTING("extending dataset");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
if (MAINPROCESS) {
SKIPPED();
@@ -1623,10 +1642,10 @@ test_set_extent(void)
"with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -1891,7 +1910,7 @@ test_set_extent(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -1918,7 +1937,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef SET_EXTENT_TEST_SPACE_RANK
#undef SET_EXTENT_TEST_NUM_EXTENDS
@@ -1929,8 +1948,8 @@ error:
* attribute on the dataset.
*/
#define ATTRIBUTE_EXISTS_TEST_SPACE_RANK 2
static int
test_attribute_exists(void)
static void
test_async_attribute_exists(const void *params)
{
hsize_t *dims = NULL;
bool op_failed = false;
@@ -1948,7 +1967,8 @@ test_attribute_exists(void)
TESTING("H5Aexists()");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) {
if (MAINPROCESS) {
SKIPPED();
@@ -1956,10 +1976,10 @@ test_attribute_exists(void)
"supported with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -2054,7 +2074,7 @@ test_attribute_exists(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -2071,7 +2091,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef ATTRIBUTE_EXISTS_TEST_SPACE_RANK
@@ -2081,8 +2101,8 @@ error:
* verifies the data is correct.
*/
#define ATTRIBUTE_IO_TEST_SPACE_RANK 2
static int
test_attribute_io(void)
static void
test_async_attribute_io(const void *params)
{
hsize_t *dims = NULL;
bool op_failed = false;
@@ -2101,7 +2121,8 @@ test_attribute_io(void)
TESTING("attribute I/O");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) {
if (MAINPROCESS) {
SKIPPED();
@@ -2109,10 +2130,10 @@ test_attribute_io(void)
"supported with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -2259,7 +2280,7 @@ test_attribute_io(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -2280,7 +2301,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -2289,8 +2310,8 @@ error:
* attribute and verifies the data is correct.
*/
#define ATTRIBUTE_IO_TCONV_TEST_SPACE_RANK 2
static int
test_attribute_io_tconv(void)
static void
test_async_attribute_io_tconv(const void *params)
{
hsize_t *dims = NULL;
bool op_failed;
@@ -2308,18 +2329,18 @@ test_attribute_io_tconv(void)
TESTING("attribute I/O with type conversion");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) {
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) || !(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) {
if (MAINPROCESS) {
SKIPPED();
printf(" API functions for basic file, attribute, or flush aren't supported with this "
"connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -2454,7 +2475,7 @@ test_attribute_io_tconv(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -2475,7 +2496,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -2489,8 +2510,8 @@ typedef struct tattr_cmpd_t {
} tattr_cmpd_t;
#define ATTRIBUTE_IO_COMPOUND_TEST_SPACE_RANK 2
static int
test_attribute_io_compound(void)
static void
test_async_attribute_io_compound(const void *params)
{
hsize_t *dims = NULL;
bool op_failed;
@@ -2512,18 +2533,18 @@ test_attribute_io_compound(void)
TESTING("attribute I/O with compound type conversion");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) {
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) || !(vol_cap_flags_g & H5VL_CAP_FLAG_ATTR_BASIC)) {
if (MAINPROCESS) {
SKIPPED();
printf(" API functions for basic file, dataset, dataset more, attribute, or flush aren't "
"supported with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create dataspace */
@@ -2861,7 +2882,7 @@ test_attribute_io_compound(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -2887,14 +2908,14 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
* Tests async group interfaces in parallel
*/
static int
test_group(void)
static void
test_async_group(const void *params)
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -2912,18 +2933,19 @@ test_group(void)
TESTING("group operations");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_MORE) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_MORE) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (MAINPROCESS) {
SKIPPED();
printf(" API functions for basic file, group, group more or flush aren't "
"supported with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create GCPL */
@@ -3048,7 +3070,7 @@ test_group(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3064,14 +3086,14 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
* Tests async link interfaces in parallel
*/
static int
test_link(void)
static void
test_async_link(const void *params)
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -3092,9 +3114,9 @@ test_link(void)
TESTING("link operations");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_LINK_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_HARD_LINKS) || !(vol_cap_flags_g & H5VL_CAP_FLAG_SOFT_LINKS) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_LINK_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_HARD_LINKS) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_SOFT_LINKS) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
if (MAINPROCESS) {
SKIPPED();
@@ -3102,10 +3124,10 @@ test_link(void)
"aren't supported with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create GCPL */
@@ -3309,7 +3331,7 @@ test_link(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3324,15 +3346,15 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
* Tests H5Ocopy_async and H5Orefresh_async in parallel
*/
#define OCOPY_REFRESH_TEST_SPACE_RANK 2
static int
test_ocopy_orefresh(void)
static void
test_async_ocopy_orefresh(const void *params)
{
hsize_t *dims = NULL;
hid_t file_id = H5I_INVALID_HID;
@@ -3342,24 +3364,27 @@ test_ocopy_orefresh(void)
hid_t space_id = H5I_INVALID_HID;
hid_t es_id = H5I_INVALID_HID;
size_t num_in_progress;
bool op_failed = false;
bool is_native_vol = false;
bool coll_metadata_read = false;
bool op_failed = false;
bool is_native_vol = false;
TESTING("H5Ocopy() and H5Orefresh()");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_OBJECT_MORE) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_OBJECT_MORE) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FLUSH_REFRESH)) {
if (MAINPROCESS) {
SKIPPED();
printf(" API functions for basic file, group, dataset, object more, flush, or refresh "
"aren't supported with this connector\n");
}
return 0;
return;
}
coll_metadata_read = *(const bool *)params;
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
TEST_ERROR;
@@ -3468,7 +3493,7 @@ test_ocopy_orefresh(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3485,15 +3510,15 @@ error:
}
H5E_END_TRY
return 1;
return;
}
#undef OCOPY_REFRESH_TEST_SPACE_RANK
/*
* Tests H5Freopen_async in parallel
*/
static int
test_file_reopen(void)
static void
test_async_file_reopen(const void *params)
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -3505,16 +3530,17 @@ test_file_reopen(void)
TESTING("H5Freopen()");
/* Make sure the connector supports the API functions being tested */
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_MORE)) {
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) ||
!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_MORE)) {
if (MAINPROCESS) {
SKIPPED();
printf(" API functions for basic file or file more aren't supported with this connector\n");
}
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, coll_metadata_read)) < 0)
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, *(const bool *)params)) < 0)
TEST_ERROR;
/* Create event stack */
@@ -3554,7 +3580,7 @@ test_file_reopen(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3567,107 +3593,126 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
* Cleanup temporary test files
*/
static void
cleanup_files(void)
test_async_file_cleanup(const void H5_ATTR_UNUSED *params)
{
char file_name[64];
int i;
if (MAINPROCESS) {
H5Fdelete(PAR_ASYNC_API_TEST_FILE, H5P_DEFAULT);
remove_test_file(NULL, PAR_ASYNC_API_TEST_FILE);
for (i = 0; i <= max_printf_file; i++) {
snprintf(file_name, sizeof(file_name), PAR_ASYNC_API_TEST_FILE_PRINTF, i);
H5Fdelete(file_name, H5P_DEFAULT);
} /* end for */
remove_test_file(NULL, file_name);
}
}
}
int
H5_api_async_test_parallel(void)
void
H5_api_async_test_parallel_add(void)
{
size_t i;
int nerrors;
bool coll_metadata_read = true;
if (MAINPROCESS) {
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Async Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_async_test_header (coll)", print_async_test_header, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "Prints header for async tests");
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_ASYNC)) {
if (MAINPROCESS) {
SKIPPED();
printf(" Async APIs aren't supported with this connector\n");
}
/* Add tests using collective metadata reads */
AddTest("test_async_one_dataset_io (coll)", test_async_one_dataset_io, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async single dataset I/O (collective metadata reads)");
AddTest("test_async_multi_dataset_io (coll)", test_async_multi_dataset_io, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async multi dataset I/O (collective metadata reads)");
AddTest("test_async_multi_file_dataset_io (coll)", test_async_multi_file_dataset_io, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async multi file dataset I/O (collective metadata reads)");
AddTest("test_async_multi_file_grp_dset_io (coll)", test_async_multi_file_grp_dset_io, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async multi file dataset I/O with groups (collective metadata reads)");
AddTest("test_async_set_extent (coll)", test_async_set_extent, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async extending dataset (collective metadata reads)");
AddTest("test_async_attribute_exists (coll)", test_async_attribute_exists, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read), "async H5Aexists() (collective metadata reads)");
AddTest("test_async_attribute_io (coll)", test_async_attribute_io, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async attribute I/O (collective metadata reads)");
AddTest("test_async_attribute_io_tconv (coll)", test_async_attribute_io_tconv, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async attribute I/O with type conversion (collective metadata reads)");
AddTest("test_async_attribute_io_compound (coll)", test_async_attribute_io_compound, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async attribute I/O with compound type conversion (collective metadata reads)");
AddTest("test_async_group (coll)", test_async_group, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async group operations (collective metadata reads)");
AddTest("test_async_link (coll)", test_async_link, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async link operations (collective metadata reads)");
AddTest("test_async_ocopy_orefresh (coll)", test_async_ocopy_orefresh, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async H5Ocopy() and H5Orefresh() (collective metadata reads)");
AddTest("test_async_file_reopen (coll)", test_async_file_reopen, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async H5Freopen() (collective metadata reads)");
return 0;
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_async_tests); i++) {
nerrors += (*par_async_tests[i])() ? 1 : 0;
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS) {
printf("\n");
printf("Cleaning up testing files\n");
}
cleanup_files();
if (MAINPROCESS) {
printf("\n * Re-testing with independent metadata reads *\n");
}
/* Add a fake test to cleanup test files due to current test interdependencies */
AddTest("test_async_file_cleanup (coll)", test_async_file_cleanup, NULL, NULL, NULL, 0,
"cleanup async test files");
/* Re-run tests with independent metadata reads */
coll_metadata_read = false;
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_async_tests); i++) {
nerrors += (*par_async_tests[i])() ? 1 : 0;
/* Add a fake test to print out that tests are being re-run with independent metadata reads */
AddTest("print_async_test_header (ind)", print_async_test_header, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "Prints header for async tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
/* Add tests using independent metadata reads */
AddTest("test_async_one_dataset_io (ind)", test_async_one_dataset_io, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async single dataset I/O (independent metadata reads)");
AddTest("test_async_multi_dataset_io (ind)", test_async_multi_dataset_io, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async multi dataset I/O (independent metadata reads)");
AddTest("test_async_multi_file_dataset_io (ind)", test_async_multi_file_dataset_io, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async multi file dataset I/O (independent metadata reads)");
AddTest("test_async_multi_file_grp_dset_io (ind)", test_async_multi_file_grp_dset_io, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async multi file dataset I/O with groups (independent metadata reads)");
AddTest("test_async_set_extent (ind)", test_async_set_extent, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async extending dataset (independent metadata reads)");
AddTest("test_async_attribute_exists (ind)", test_async_attribute_exists, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async H5Aexists() (independent metadata reads)");
AddTest("test_async_attribute_io (ind)", test_async_attribute_io, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async attribute I/O (independent metadata reads)");
AddTest("test_async_attribute_io_tconv (ind)", test_async_attribute_io_tconv, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async attribute I/O with type conversion (independent metadata reads)");
AddTest("test_async_attribute_io_compound (ind)", test_async_attribute_io_compound, NULL, NULL,
&coll_metadata_read, sizeof(coll_metadata_read),
"async attribute I/O with compound type conversion (independent metadata reads)");
AddTest("test_async_group (ind)", test_async_group, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async group operations (independent metadata reads)");
AddTest("test_async_link (ind)", test_async_link, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async link operations (independent metadata reads)");
AddTest("test_async_ocopy_orefresh (ind)", test_async_ocopy_orefresh, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async H5Ocopy() and H5Orefresh() (independent metadata reads)");
AddTest("test_async_file_reopen (ind)", test_async_file_reopen, NULL, NULL, &coll_metadata_read,
sizeof(coll_metadata_read), "async H5Freopen() (independent metadata reads)");
if (MAINPROCESS) {
printf("\n");
printf("Cleaning up testing files\n");
}
cleanup_files();
return nerrors;
/* Add a fake test to cleanup test files due to current test interdependencies */
AddTest("test_async_file_cleanup (ind)", test_async_file_cleanup, NULL, NULL, NULL, 0,
"cleanup async test files");
}
#else /* H5ESpublic_H */
#else /* H5_API_TEST_HAVE_ASYNC */
int
H5_api_async_test_parallel(void)
void
H5_api_async_test_parallel_add(void)
{
if (MAINPROCESS) {
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Async Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
printf("SKIPPED due to no async support in HDF5 library\n");
return 0;
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_async_test_header", print_async_test_header, NULL, NULL, NULL, 0,
"Prints header for async tests");
}
#endif
+1 -1
View File
@@ -15,7 +15,7 @@
#include "H5_api_test_parallel.h"
int H5_api_async_test_parallel(void);
void H5_api_async_test_parallel_add(void);
/********************************************************
* *
+12 -21
View File
@@ -12,36 +12,27 @@
#include "H5_api_attribute_test_parallel.h"
/*
* The array of parallel attribute tests to be performed.
*/
static int (*par_attribute_tests[])(void) = {NULL};
static void print_attribute_test_header(const void *params);
int
H5_api_attribute_test_parallel(void)
static void
print_attribute_test_header(const void H5_ATTR_UNUSED *params)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Attribute Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_attribute_tests); i++) {
/* nerrors += (*par_attribute_tests[i])() ? 1 : 0; */
void
H5_api_attribute_test_parallel_add(void)
{
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_attribute_test_header", print_attribute_test_header, NULL, NULL, NULL, 0,
"Prints header for attribute tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
/* No tests yet */
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_attribute_test_parallel(void);
void H5_api_attribute_test_parallel_add(void);
#endif /* H5_API_ATTRIBUTE_TEST_PARALLEL_H_ */
+206 -192
View File
@@ -16,64 +16,48 @@
*/
#include "H5_api_dataset_test_parallel.h"
static int test_write_dataset_data_verification(void);
static int test_write_dataset_independent(void);
static int test_write_dataset_one_proc_0_selection(void);
static int test_write_dataset_one_proc_none_selection(void);
static int test_write_dataset_one_proc_all_selection(void);
static int test_write_dataset_hyper_file_all_mem(void);
static int test_write_dataset_all_file_hyper_mem(void);
static int test_write_dataset_point_file_all_mem(void);
static int test_write_dataset_all_file_point_mem(void);
static int test_write_dataset_hyper_file_point_mem(void);
static int test_write_dataset_point_file_hyper_mem(void);
static int test_read_dataset_one_proc_0_selection(void);
static int test_read_dataset_one_proc_none_selection(void);
static int test_read_dataset_one_proc_all_selection(void);
static int test_read_dataset_hyper_file_all_mem(void);
static int test_read_dataset_all_file_hyper_mem(void);
static int test_read_dataset_point_file_all_mem(void);
static int test_read_dataset_all_file_point_mem(void);
static int test_read_dataset_hyper_file_point_mem(void);
static int test_read_dataset_point_file_hyper_mem(void);
static void print_dataset_test_header(const void *params);
static void test_write_dataset_data_verification(const void *params);
static void test_write_dataset_independent(const void *params);
static void test_write_dataset_one_proc_0_selection(const void *params);
static void test_write_dataset_one_proc_none_selection(const void *params);
static void test_write_dataset_one_proc_all_selection(const void *params);
static void test_write_dataset_hyper_file_all_mem(const void *params);
static void test_write_dataset_all_file_hyper_mem(const void *params);
static void test_write_dataset_point_file_all_mem(const void *params);
static void test_write_dataset_all_file_point_mem(const void *params);
static void test_write_dataset_hyper_file_point_mem(const void *params);
static void test_write_dataset_point_file_hyper_mem(const void *params);
static void test_read_dataset_one_proc_0_selection(const void *params);
static void test_read_dataset_one_proc_none_selection(const void *params);
static void test_read_dataset_one_proc_all_selection(const void *params);
static void test_read_dataset_hyper_file_all_mem(const void *params);
static void test_read_dataset_all_file_hyper_mem(const void *params);
static void test_read_dataset_point_file_all_mem(const void *params);
static void test_read_dataset_all_file_point_mem(const void *params);
static void test_read_dataset_hyper_file_point_mem(const void *params);
static void test_read_dataset_point_file_hyper_mem(const void *params);
/*
* Chunking tests
*/
static int test_write_multi_chunk_dataset_same_shape_read(void);
static int test_write_multi_chunk_dataset_diff_shape_read(void);
static int test_overwrite_multi_chunk_dataset_same_shape_read(void);
static int test_overwrite_multi_chunk_dataset_diff_shape_read(void);
static void test_write_multi_chunk_dataset_same_shape_read(const void *params);
static void test_write_multi_chunk_dataset_diff_shape_read(const void *params);
static void test_overwrite_multi_chunk_dataset_same_shape_read(const void *params);
static void test_overwrite_multi_chunk_dataset_diff_shape_read(const void *params);
/*
* The array of parallel dataset tests to be performed.
*/
static int (*par_dataset_tests[])(void) = {
test_write_dataset_data_verification,
test_write_dataset_independent,
test_write_dataset_one_proc_0_selection,
test_write_dataset_one_proc_none_selection,
test_write_dataset_one_proc_all_selection,
test_write_dataset_hyper_file_all_mem,
test_write_dataset_all_file_hyper_mem,
test_write_dataset_point_file_all_mem,
test_write_dataset_all_file_point_mem,
test_write_dataset_hyper_file_point_mem,
test_write_dataset_point_file_hyper_mem,
test_read_dataset_one_proc_0_selection,
test_read_dataset_one_proc_none_selection,
test_read_dataset_one_proc_all_selection,
test_read_dataset_hyper_file_all_mem,
test_read_dataset_all_file_hyper_mem,
test_read_dataset_point_file_all_mem,
test_read_dataset_all_file_point_mem,
test_read_dataset_hyper_file_point_mem,
test_read_dataset_point_file_hyper_mem,
test_write_multi_chunk_dataset_same_shape_read,
test_write_multi_chunk_dataset_diff_shape_read,
test_overwrite_multi_chunk_dataset_same_shape_read,
test_overwrite_multi_chunk_dataset_diff_shape_read,
};
static void
print_dataset_test_header(const void H5_ATTR_UNUSED *params)
{
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Dataset Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
/*
* A test to ensure that data is read back correctly from
@@ -88,8 +72,8 @@ static int (*par_dataset_tests[])(void) = {
#define DATASET_WRITE_DATA_VERIFY_TEST_DSET_NAME1 "dataset_write_data_verification_all"
#define DATASET_WRITE_DATA_VERIFY_TEST_DSET_NAME2 "dataset_write_data_verification_hyperslab"
#define DATASET_WRITE_DATA_VERIFY_TEST_DSET_NAME3 "dataset_write_data_verification_points"
static int
test_write_dataset_data_verification(void)
static void
test_write_dataset_data_verification(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -115,7 +99,7 @@ test_write_dataset_data_verification(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
TESTING_2("test setup");
@@ -866,7 +850,7 @@ test_write_dataset_data_verification(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -889,7 +873,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -906,8 +890,8 @@ error:
#define DATASET_INDEPENDENT_WRITE_TEST_GROUP_NAME "independent_dataset_write_test"
#define DATASET_INDEPENDENT_WRITE_TEST_DSET_NAME1 "dset1"
#define DATASET_INDEPENDENT_WRITE_TEST_DSET_NAME2 "dset2"
static int
test_write_dataset_independent(void)
static void
test_write_dataset_independent(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -932,7 +916,7 @@ test_write_dataset_independent(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -1211,7 +1195,7 @@ test_write_dataset_independent(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -1233,7 +1217,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -1245,8 +1229,8 @@ error:
#define DATASET_WRITE_ONE_PROC_0_SEL_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_ONE_PROC_0_SEL_TEST_GROUP_NAME "one_rank_0_sel_write_test"
#define DATASET_WRITE_ONE_PROC_0_SEL_TEST_DSET_NAME "one_rank_0_sel_dset"
static int
test_write_dataset_one_proc_0_selection(void)
static void
test_write_dataset_one_proc_0_selection(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -1271,7 +1255,7 @@ test_write_dataset_one_proc_0_selection(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -1509,7 +1493,7 @@ test_write_dataset_one_proc_0_selection(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -1530,7 +1514,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -1542,8 +1526,8 @@ error:
#define DATASET_WRITE_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_ONE_PROC_NONE_SEL_TEST_GROUP_NAME "one_rank_none_sel_write_test"
#define DATASET_WRITE_ONE_PROC_NONE_SEL_TEST_DSET_NAME "one_rank_none_sel_dset"
static int
test_write_dataset_one_proc_none_selection(void)
static void
test_write_dataset_one_proc_none_selection(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -1568,7 +1552,7 @@ test_write_dataset_one_proc_none_selection(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -1822,7 +1806,7 @@ test_write_dataset_one_proc_none_selection(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -1843,7 +1827,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -1856,8 +1840,8 @@ error:
#define DATASET_WRITE_ONE_PROC_ALL_SEL_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_ONE_PROC_ALL_SEL_TEST_GROUP_NAME "one_rank_all_sel_write_test"
#define DATASET_WRITE_ONE_PROC_ALL_SEL_TEST_DSET_NAME "one_rank_all_sel_dset"
static int
test_write_dataset_one_proc_all_selection(void)
static void
test_write_dataset_one_proc_all_selection(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -1878,7 +1862,7 @@ test_write_dataset_one_proc_all_selection(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -2110,7 +2094,7 @@ test_write_dataset_one_proc_all_selection(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -2131,7 +2115,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -2148,8 +2132,8 @@ error:
#define DATASET_WRITE_HYPER_FILE_ALL_MEM_TEST_GROUP_NAME "hyper_sel_file_all_sel_mem_write_test"
#define DATASET_WRITE_HYPER_FILE_ALL_MEM_TEST_DSET_NAME "hyper_sel_file_all_sel_mem_dset"
#endif
static int
test_write_dataset_hyper_file_all_mem(void)
static void
test_write_dataset_hyper_file_all_mem(const void H5_ATTR_UNUSED *params)
{
#ifdef BROKEN
hssize_t space_npoints;
@@ -2177,7 +2161,7 @@ test_write_dataset_hyper_file_all_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -2387,7 +2371,7 @@ test_write_dataset_hyper_file_all_mem(void)
SKIPPED();
#endif
return 0;
return;
#ifdef BROKEN
error:
@@ -2409,7 +2393,7 @@ error:
}
H5E_END_TRY
return 1;
return;
#endif
}
@@ -2423,8 +2407,8 @@ error:
#define DATASET_WRITE_ALL_FILE_HYPER_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_ALL_FILE_HYPER_MEM_TEST_GROUP_NAME "all_sel_file_hyper_sel_mem_write_test"
#define DATASET_WRITE_ALL_FILE_HYPER_MEM_TEST_DSET_NAME "all_sel_file_hyper_sel_mem_dset"
static int
test_write_dataset_all_file_hyper_mem(void)
static void
test_write_dataset_all_file_hyper_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -2445,7 +2429,7 @@ test_write_dataset_all_file_hyper_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -2681,7 +2665,7 @@ test_write_dataset_all_file_hyper_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -2702,7 +2686,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -2710,14 +2694,14 @@ error:
* a point selection in the file dataspace and an all selection
* in the memory dataspace.
*/
static int
test_write_dataset_point_file_all_mem(void)
static void
test_write_dataset_point_file_all_mem(const void H5_ATTR_UNUSED *params)
{
TESTING("write to dataset with point sel. for file space; all sel. for memory");
SKIPPED();
return 0;
return;
}
/*
@@ -2730,8 +2714,8 @@ test_write_dataset_point_file_all_mem(void)
#define DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_GROUP_NAME "all_sel_file_point_sel_mem_write_test"
#define DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_DSET_NAME "all_sel_file_point_sel_mem_dset"
static int
test_write_dataset_all_file_point_mem(void)
static void
test_write_dataset_all_file_point_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *points = NULL;
@@ -2753,7 +2737,7 @@ test_write_dataset_all_file_point_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -3005,7 +2989,7 @@ test_write_dataset_all_file_point_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3028,7 +3012,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -3041,8 +3025,8 @@ error:
#define DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_GROUP_NAME "hyper_sel_file_point_sel_mem_write_test"
#define DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_DSET_NAME "hyper_sel_file_point_sel_mem_dset"
static int
test_write_dataset_hyper_file_point_mem(void)
static void
test_write_dataset_hyper_file_point_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -3068,7 +3052,7 @@ test_write_dataset_hyper_file_point_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -3329,7 +3313,7 @@ test_write_dataset_hyper_file_point_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3352,7 +3336,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -3365,8 +3349,8 @@ error:
#define DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_GROUP_NAME "point_sel_file_hyper_sel_mem_write_test"
#define DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_DSET_NAME "point_sel_file_hyper_sel_mem_dset"
static int
test_write_dataset_point_file_hyper_mem(void)
static void
test_write_dataset_point_file_hyper_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -3388,7 +3372,7 @@ test_write_dataset_point_file_hyper_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -3647,7 +3631,7 @@ test_write_dataset_point_file_hyper_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -3670,7 +3654,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -3682,8 +3666,8 @@ error:
#define DATASET_READ_ONE_PROC_0_SEL_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_ONE_PROC_0_SEL_TEST_GROUP_NAME "one_rank_0_sel_read_test"
#define DATASET_READ_ONE_PROC_0_SEL_TEST_DSET_NAME "one_rank_0_sel_dset"
static int
test_read_dataset_one_proc_0_selection(void)
static void
test_read_dataset_one_proc_0_selection(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -3708,7 +3692,7 @@ test_read_dataset_one_proc_0_selection(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_ONE_PROC_0_SEL_TEST_SPACE_RANK, &dims) < 0)
@@ -3983,7 +3967,7 @@ test_read_dataset_one_proc_0_selection(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -4004,7 +3988,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -4016,8 +4000,8 @@ error:
#define DATASET_READ_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_ONE_PROC_NONE_SEL_TEST_GROUP_NAME "one_rank_none_sel_read_test"
#define DATASET_READ_ONE_PROC_NONE_SEL_TEST_DSET_NAME "one_rank_none_sel_dset"
static int
test_read_dataset_one_proc_none_selection(void)
static void
test_read_dataset_one_proc_none_selection(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -4042,7 +4026,7 @@ test_read_dataset_one_proc_none_selection(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_ONE_PROC_NONE_SEL_TEST_SPACE_RANK, &dims) < 0)
@@ -4332,7 +4316,7 @@ test_read_dataset_one_proc_none_selection(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -4353,7 +4337,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -4366,8 +4350,8 @@ error:
#define DATASET_READ_ONE_PROC_ALL_SEL_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_ONE_PROC_ALL_SEL_TEST_GROUP_NAME "one_rank_all_sel_read_test"
#define DATASET_READ_ONE_PROC_ALL_SEL_TEST_DSET_NAME "one_rank_all_sel_dset"
static int
test_read_dataset_one_proc_all_selection(void)
static void
test_read_dataset_one_proc_all_selection(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -4388,7 +4372,7 @@ test_read_dataset_one_proc_all_selection(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_ONE_PROC_ALL_SEL_TEST_SPACE_RANK, &dims) < 0)
@@ -4669,7 +4653,7 @@ test_read_dataset_one_proc_all_selection(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -4690,7 +4674,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -4698,14 +4682,14 @@ error:
* a hyperslab selection in the file dataspace and an all
* selection in the memory dataspace.
*/
static int
test_read_dataset_hyper_file_all_mem(void)
static void
test_read_dataset_hyper_file_all_mem(const void H5_ATTR_UNUSED *params)
{
TESTING("read from dataset with hyperslab sel. for file space; all sel. for memory");
SKIPPED();
return 0;
return;
}
/*
@@ -4718,8 +4702,8 @@ test_read_dataset_hyper_file_all_mem(void)
#define DATASET_READ_ALL_FILE_HYPER_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_ALL_FILE_HYPER_MEM_TEST_GROUP_NAME "all_sel_file_hyper_sel_mem_read_test"
#define DATASET_READ_ALL_FILE_HYPER_MEM_TEST_DSET_NAME "all_sel_file_hyper_sel_mem_dset"
static int
test_read_dataset_all_file_hyper_mem(void)
static void
test_read_dataset_all_file_hyper_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -4740,7 +4724,7 @@ test_read_dataset_all_file_hyper_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_ALL_FILE_HYPER_MEM_TEST_SPACE_RANK, &dims) < 0)
@@ -5016,7 +5000,7 @@ test_read_dataset_all_file_hyper_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -5037,7 +5021,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -5045,14 +5029,14 @@ error:
* a point selection in the file dataspace and an all selection
* in the memory dataspace.
*/
static int
test_read_dataset_point_file_all_mem(void)
static void
test_read_dataset_point_file_all_mem(const void H5_ATTR_UNUSED *params)
{
TESTING("read from dataset with point sel. for file space; all sel. for memory");
SKIPPED();
return 0;
return;
}
/*
@@ -5065,8 +5049,8 @@ test_read_dataset_point_file_all_mem(void)
#define DATASET_READ_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_ALL_FILE_POINT_MEM_TEST_GROUP_NAME "all_sel_file_point_sel_mem_read_test"
#define DATASET_READ_ALL_FILE_POINT_MEM_TEST_DSET_NAME "all_sel_file_point_sel_mem_dset"
static int
test_read_dataset_all_file_point_mem(void)
static void
test_read_dataset_all_file_point_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *points = NULL;
@@ -5088,7 +5072,7 @@ test_read_dataset_all_file_point_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_ALL_FILE_POINT_MEM_TEST_SPACE_RANK, &dims) < 0)
@@ -5377,7 +5361,7 @@ test_read_dataset_all_file_point_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -5400,7 +5384,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -5413,8 +5397,8 @@ error:
#define DATASET_READ_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_HYPER_FILE_POINT_MEM_TEST_GROUP_NAME "hyper_sel_file_point_sel_mem_read_test"
#define DATASET_READ_HYPER_FILE_POINT_MEM_TEST_DSET_NAME "hyper_sel_file_point_sel_mem_dset"
static int
test_read_dataset_hyper_file_point_mem(void)
static void
test_read_dataset_hyper_file_point_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -5440,7 +5424,7 @@ test_read_dataset_hyper_file_point_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_HYPER_FILE_POINT_MEM_TEST_SPACE_RANK, &dims) < 0)
@@ -5735,7 +5719,7 @@ test_read_dataset_hyper_file_point_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -5758,7 +5742,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -5771,8 +5755,8 @@ error:
#define DATASET_READ_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE sizeof(int)
#define DATASET_READ_POINT_FILE_HYPER_MEM_TEST_GROUP_NAME "point_sel_file_hyper_sel_mem_read_test"
#define DATASET_READ_POINT_FILE_HYPER_MEM_TEST_DSET_NAME "point_sel_file_hyper_sel_mem_dset"
static int
test_read_dataset_point_file_hyper_mem(void)
static void
test_read_dataset_point_file_hyper_mem(const void H5_ATTR_UNUSED *params)
{
hssize_t space_npoints;
hsize_t *dims = NULL;
@@ -5794,7 +5778,7 @@ test_read_dataset_point_file_hyper_mem(void)
!(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) {
SKIPPED();
printf(" API functions for basic file, group, or dataset aren't supported with this connector\n");
return 0;
return;
}
if (generate_random_parallel_dimensions(DATASET_READ_POINT_FILE_HYPER_MEM_TEST_SPACE_RANK, &dims) < 0)
@@ -6092,7 +6076,7 @@ test_read_dataset_point_file_hyper_mem(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -6115,7 +6099,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -6134,8 +6118,8 @@ error:
#define DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_GROUP_NAME \
"multi_chunk_dataset_write_same_space_read_test"
#define DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_DSET_NAME "multi_chunk_dataset"
static int
test_write_multi_chunk_dataset_same_shape_read(void)
static void
test_write_multi_chunk_dataset_same_shape_read(const void H5_ATTR_UNUSED *params)
{
hsize_t *dims = NULL;
hsize_t *chunk_dims = NULL;
@@ -6162,7 +6146,7 @@ test_write_multi_chunk_dataset_same_shape_read(void)
SKIPPED();
printf(" API functions for basic file, group, dataset, or getting property list aren't "
"supported with this connector\n");
return 0;
return;
}
if (NULL ==
@@ -6553,7 +6537,7 @@ test_write_multi_chunk_dataset_same_shape_read(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -6575,7 +6559,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -6596,8 +6580,8 @@ error:
#define DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_GROUP_NAME \
"multi_chunk_dataset_write_diff_space_read_test"
#define DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_DSET_NAME "multi_chunk_dataset"
static int
test_write_multi_chunk_dataset_diff_shape_read(void)
static void
test_write_multi_chunk_dataset_diff_shape_read(const void H5_ATTR_UNUSED *params)
{
hsize_t *dims = NULL;
hsize_t *chunk_dims = NULL;
@@ -6625,7 +6609,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void)
SKIPPED();
printf(" API functions for basic file, group, dataset, or getting property list aren't "
"supported with this connector\n");
return 0;
return;
}
if (NULL ==
@@ -7018,7 +7002,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -7040,7 +7024,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -7061,8 +7045,8 @@ error:
"multi_chunk_dataset_same_space_overwrite_test"
#define DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_NAME "multi_chunk_dataset"
#define DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_NITERS 10
static int
test_overwrite_multi_chunk_dataset_same_shape_read(void)
static void
test_overwrite_multi_chunk_dataset_same_shape_read(const void H5_ATTR_UNUSED *params)
{
hsize_t *dims = NULL;
hsize_t *chunk_dims = NULL;
@@ -7090,7 +7074,7 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void)
SKIPPED();
printf(" API functions for basic file, group, dataset, or getting property list aren't "
"supported with this connector\n");
return 0;
return;
}
if (NULL == (dims = malloc(DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK *
@@ -7541,7 +7525,7 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -7563,7 +7547,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -7586,8 +7570,8 @@ error:
"multi_chunk_dataset_diff_space_overwrite_test"
#define DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_NAME "multi_chunk_dataset"
#define DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_NITERS 10
static int
test_overwrite_multi_chunk_dataset_diff_shape_read(void)
static void
test_overwrite_multi_chunk_dataset_diff_shape_read(const void H5_ATTR_UNUSED *params)
{
hsize_t *dims = NULL;
hsize_t *chunk_dims = NULL;
@@ -7616,7 +7600,7 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void)
SKIPPED();
printf(" API functions for basic file, group, dataset, or getting property list aren't "
"supported with this connector\n");
return 0;
return;
}
if (NULL == (dims = malloc(DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK *
@@ -8069,7 +8053,7 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -8091,34 +8075,64 @@ error:
}
H5E_END_TRY
return 1;
return;
}
int
H5_api_dataset_test_parallel(void)
void
H5_api_dataset_test_parallel_add(void)
{
size_t i;
int nerrors;
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_dataset_test_header", print_dataset_test_header, NULL, NULL, NULL, 0,
"Prints header for dataset tests");
if (MAINPROCESS) {
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Dataset Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_dataset_tests); i++) {
nerrors += (*par_dataset_tests[i])() ? 1 : 0;
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
AddTest("test_write_dataset_data_verification", test_write_dataset_data_verification, NULL, NULL, NULL, 0,
"verification of dataset data using H5Dwrite then H5Dread");
AddTest("test_write_dataset_independent", test_write_dataset_independent, NULL, NULL, NULL, 0,
"independent writing to different datasets by different ranks");
AddTest("test_write_dataset_one_proc_0_selection", test_write_dataset_one_proc_0_selection, NULL, NULL,
NULL, 0, "write to dataset with one rank selecting 0 rows");
AddTest("test_write_dataset_one_proc_none_selection", test_write_dataset_one_proc_none_selection, NULL,
NULL, NULL, 0, "write to dataset with one rank using 'none' selection");
AddTest("test_write_dataset_one_proc_all_selection", test_write_dataset_one_proc_all_selection, NULL,
NULL, NULL, 0, "write to dataset with one rank using all selection; others none selection");
AddTest("test_write_dataset_hyper_file_all_mem", test_write_dataset_hyper_file_all_mem, NULL, NULL, NULL,
0, "write to dataset with hyperslab sel. for file space; all sel. for memory");
AddTest("test_write_dataset_all_file_hyper_mem", test_write_dataset_all_file_hyper_mem, NULL, NULL, NULL,
0, "write to dataset with all sel. for file space; hyperslab sel. for memory");
AddTest("test_write_dataset_point_file_all_mem", test_write_dataset_point_file_all_mem, NULL, NULL, NULL,
0, "write to dataset with point sel. for file space; all sel. for memory");
AddTest("test_write_dataset_all_file_point_mem", test_write_dataset_all_file_point_mem, NULL, NULL, NULL,
0, "write to dataset with all sel. for file space; point sel. for memory");
AddTest("test_write_dataset_hyper_file_point_mem", test_write_dataset_hyper_file_point_mem, NULL, NULL,
NULL, 0, "write to dataset with hyperslab sel. for file space; point sel. for memory");
AddTest("test_write_dataset_point_file_hyper_mem", test_write_dataset_point_file_hyper_mem, NULL, NULL,
NULL, 0, "write to dataset with point sel. for file space; hyperslab sel. for memory");
AddTest("test_read_dataset_one_proc_0_selection", test_read_dataset_one_proc_0_selection, NULL, NULL,
NULL, 0, "read from dataset with one rank selecting 0 rows");
AddTest("test_read_dataset_one_proc_none_selection", test_read_dataset_one_proc_none_selection, NULL,
NULL, NULL, 0, "read from dataset with one rank using 'none' selection");
AddTest("test_read_dataset_one_proc_all_selection", test_read_dataset_one_proc_all_selection, NULL, NULL,
NULL, 0, "read from dataset with one rank using all selection; others none selection");
AddTest("test_read_dataset_hyper_file_all_mem", test_read_dataset_hyper_file_all_mem, NULL, NULL, NULL, 0,
"read from dataset with hyperslab sel. for file space; all sel. for memory");
AddTest("test_read_dataset_all_file_hyper_mem", test_read_dataset_all_file_hyper_mem, NULL, NULL, NULL, 0,
"read from dataset with all sel. for file space; hyperslab sel. for memory");
AddTest("test_read_dataset_point_file_all_mem", test_read_dataset_point_file_all_mem, NULL, NULL, NULL, 0,
"read from dataset with point sel. for file space; all sel. for memory");
AddTest("test_read_dataset_all_file_point_mem", test_read_dataset_all_file_point_mem, NULL, NULL, NULL, 0,
"read from dataset with all sel. for file space; point sel. for memory");
AddTest("test_read_dataset_hyper_file_point_mem", test_read_dataset_hyper_file_point_mem, NULL, NULL,
NULL, 0, "read from dataset with hyperslab sel. for file space; point sel. for memory");
AddTest("test_read_dataset_point_file_hyper_mem", test_read_dataset_point_file_hyper_mem, NULL, NULL,
NULL, 0, "read from dataset with point sel. for file space; hyperslab sel. for memory");
AddTest("test_write_multi_chunk_dataset_same_shape_read", test_write_multi_chunk_dataset_same_shape_read,
NULL, NULL, NULL, 0, "write to dataset with multiple chunks using same shaped dataspaces");
AddTest("test_write_multi_chunk_dataset_diff_shape_read", test_write_multi_chunk_dataset_diff_shape_read,
NULL, NULL, NULL, 0, "write to dataset with multiple chunks using differently shaped dataspaces");
AddTest("test_overwrite_multi_chunk_dataset_same_shape_read",
test_overwrite_multi_chunk_dataset_same_shape_read, NULL, NULL, NULL, 0,
"several overwrites to dataset with multiple chunks using same shaped dataspaces");
AddTest("test_overwrite_multi_chunk_dataset_diff_shape_read",
test_overwrite_multi_chunk_dataset_diff_shape_read, NULL, NULL, NULL, 0,
"several overwrites to dataset with multiple chunks using differently shaped dataspaces");
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_dataset_test_parallel(void);
void H5_api_dataset_test_parallel_add(void);
#endif /* H5_API_DATASET_TEST_PARALLEL_H_ */
+12 -21
View File
@@ -12,36 +12,27 @@
#include "H5_api_datatype_test_parallel.h"
/*
* The array of parallel datatype tests to be performed.
*/
static int (*par_datatype_tests[])(void) = {NULL};
static void print_datatype_test_header(const void *params);
int
H5_api_datatype_test_parallel(void)
static void
print_datatype_test_header(const void H5_ATTR_UNUSED *params)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Datatype Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_datatype_tests); i++) {
/* nerrors += (*par_datatype_tests[i])() ? 1 : 0; */
void
H5_api_datatype_test_parallel_add(void)
{
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_datatype_test_header", print_datatype_test_header, NULL, NULL, NULL, 0,
"Prints header for datatype tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
/* No tests yet */
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_datatype_test_parallel(void);
void H5_api_datatype_test_parallel_add(void);
#endif /* H5_API_DATATYPE_TEST_PARALLEL_H_ */
+51 -86
View File
@@ -12,25 +12,30 @@
#include "H5_api_file_test_parallel.h"
static int test_create_file(void);
static int test_open_file(void);
static int test_split_comm_file_access(void);
static void print_file_test_header(const void *params);
static void test_create_file(const void *params);
static void test_open_file(const void *params);
static void test_split_comm_file_access(const void *params);
/*
* The array of parallel file tests to be performed.
*/
static int (*par_file_tests[])(void) = {
test_create_file,
test_open_file,
test_split_comm_file_access,
};
static void
print_file_test_header(const void H5_ATTR_UNUSED *params)
{
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel File Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
/*
* A test to ensure that a file can be created in parallel.
*/
#define FILE_CREATE_TEST_FILENAME "test_file_parallel.h5"
static int
test_create_file(void)
static void
test_create_file(const void H5_ATTR_UNUSED *params)
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -41,7 +46,7 @@ test_create_file(void)
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC)) {
SKIPPED();
printf(" API functions for basic file aren't supported with this connector\n");
return 0;
return;
}
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0)
@@ -53,31 +58,35 @@ test_create_file(void)
goto error;
}
if (H5Pclose(fapl_id) < 0)
TEST_ERROR;
if (H5Fclose(file_id) < 0)
TEST_ERROR;
if (GetTestCleanup() && H5Fdelete(FILE_CREATE_TEST_FILENAME, fapl_id) < 0)
TEST_ERROR;
if (H5Pclose(fapl_id) < 0)
TEST_ERROR;
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
{
H5Pclose(fapl_id);
H5Fclose(file_id);
if (GetTestCleanup())
H5Fdelete(FILE_CREATE_TEST_FILENAME, fapl_id);
H5Pclose(fapl_id);
}
H5E_END_TRY
return 1;
return;
}
/*
* A test to ensure that a file can be opened in parallel.
*/
static int
test_open_file(void)
static void
test_open_file(const void H5_ATTR_UNUSED *params)
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -88,7 +97,7 @@ test_open_file(void)
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC)) {
SKIPPED();
printf(" API functions for basic file aren't supported with this connector\n");
return 0;
return;
}
TESTING_2("test setup");
@@ -159,7 +168,7 @@ test_open_file(void)
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
@@ -169,7 +178,7 @@ error:
}
H5E_END_TRY
return 1;
return;
}
/*
@@ -185,8 +194,8 @@ error:
* sooner or later due to MPI_Barrier calls being mixed up.
*/
#define SPLIT_FILE_COMM_TEST_FILE_NAME "split_comm_file.h5"
static int
test_split_comm_file_access(void)
static void
test_split_comm_file_access(const void H5_ATTR_UNUSED *params)
{
MPI_Comm comm;
MPI_Info info = MPI_INFO_NULL;
@@ -202,7 +211,7 @@ test_split_comm_file_access(void)
if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC)) {
SKIPPED();
printf(" API functions for basic file aren't supported with this connector\n");
return 0;
return;
}
/* set up MPI parameters */
@@ -251,7 +260,7 @@ test_split_comm_file_access(void)
}
/* delete the test file */
if (H5Fdelete(SPLIT_FILE_COMM_TEST_FILE_NAME, fapl_id) < 0) {
if (GetTestCleanup() && H5Fdelete(SPLIT_FILE_COMM_TEST_FILE_NAME, fapl_id) < 0) {
H5_FAILED();
printf(" failed to delete file '%s'\n", SPLIT_FILE_COMM_TEST_FILE_NAME);
err_occurred = 1;
@@ -294,74 +303,30 @@ access_end:
PASSED();
return 0;
return;
error:
H5E_BEGIN_TRY
{
H5Pclose(fapl_id);
H5Fclose(file_id);
if (GetTestCleanup())
H5Fdelete(SPLIT_FILE_COMM_TEST_FILE_NAME, fapl_id);
H5Pclose(fapl_id);
}
H5E_END_TRY
return 1;
return;
}
/*
* Cleanup temporary test files
*/
static void
cleanup_files(void)
void
H5_api_file_test_parallel_add(void)
{
hid_t fapl_id = H5I_INVALID_HID;
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_file_test_header", print_file_test_header, NULL, NULL, NULL, 0,
"Prints header for file tests");
if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, true)) < 0) {
if (MAINPROCESS)
printf(" failed to create FAPL for deleting test files\n");
return;
}
H5Fdelete(FILE_CREATE_TEST_FILENAME, fapl_id);
/* The below file is deleted as part of the test */
/* H5Fdelete(SPLIT_FILE_COMM_TEST_FILE_NAME, H5P_DEFAULT); */
if (H5Pclose(fapl_id) < 0) {
if (MAINPROCESS)
printf(" failed to close FAPL used for deleting test files\n");
return;
}
}
int
H5_api_file_test_parallel(void)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel File Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_file_tests); i++) {
nerrors += (*par_file_tests[i])() ? 1 : 0;
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS) {
printf("\n");
printf("Cleaning up testing files\n");
}
cleanup_files();
return nerrors;
AddTest("test_create_file", test_create_file, NULL, NULL, NULL, 0, "H5Fcreate");
AddTest("test_open_file", test_open_file, NULL, NULL, NULL, 0, "H5Fopen");
AddTest("test_split_comm_file_access", test_split_comm_file_access, NULL, NULL, NULL, 0,
"file access with a split communicator");
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_file_test_parallel(void);
void H5_api_file_test_parallel_add(void);
#endif /* H5_API_FILE_TEST_PARALLEL_H_ */
+12 -21
View File
@@ -12,36 +12,27 @@
#include "H5_api_group_test_parallel.h"
/*
* The array of parallel group tests to be performed.
*/
static int (*par_group_tests[])(void) = {NULL};
static void print_group_test_header(const void *params);
int
H5_api_group_test_parallel(void)
static void
print_group_test_header(const void H5_ATTR_UNUSED *params)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Group Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_group_tests); i++) {
/* nerrors += (*par_group_tests[i])() ? 1 : 0; */
void
H5_api_group_test_parallel_add(void)
{
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_group_test_header", print_group_test_header, NULL, NULL, NULL, 0,
"Prints header for group tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
/* No tests yet */
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_group_test_parallel(void);
void H5_api_group_test_parallel_add(void);
#endif /* H5_API_GROUP_TEST_PARALLEL_H_ */
+12 -21
View File
@@ -12,36 +12,27 @@
#include "H5_api_link_test_parallel.h"
/*
* The array of parallel link tests to be performed.
*/
static int (*par_link_tests[])(void) = {NULL};
static void print_link_test_header(const void *params);
int
H5_api_link_test_parallel(void)
static void
print_link_test_header(const void H5_ATTR_UNUSED *params)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Link Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_link_tests); i++) {
/* nerrors += (*par_link_tests[i])() ? 1 : 0; */
void
H5_api_link_test_parallel_add(void)
{
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_link_test_header", print_link_test_header, NULL, NULL, NULL, 0,
"Prints header for link tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
/* No tests yet */
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_link_test_parallel(void);
void H5_api_link_test_parallel_add(void);
#endif /* H5_API_LINK_TEST_PARALLEL_H_ */
+12 -21
View File
@@ -12,36 +12,27 @@
#include "H5_api_misc_test_parallel.h"
/*
* The array of parallel miscellaneous tests to be performed.
*/
static int (*par_misc_tests[])(void) = {NULL};
static void print_misc_test_header(const void *params);
int
H5_api_misc_test_parallel(void)
static void
print_misc_test_header(const void H5_ATTR_UNUSED *params)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Miscellaneous Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_misc_tests); i++) {
/* nerrors += (*par_misc_tests[i])() ? 1 : 0; */
void
H5_api_misc_test_parallel_add(void)
{
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_misc_test_header", print_misc_test_header, NULL, NULL, NULL, 0,
"Prints header for miscellaneous tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
/* No tests yet */
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_misc_test_parallel(void);
void H5_api_misc_test_parallel_add(void);
#endif /* H5_API_MISC_TEST_PARALLEL_H_ */
+12 -21
View File
@@ -12,36 +12,27 @@
#include "H5_api_object_test_parallel.h"
/*
* The array of parallel object tests to be performed.
*/
static int (*par_object_tests[])(void) = {NULL};
static void print_object_test_header(const void *params);
int
H5_api_object_test_parallel(void)
static void
print_object_test_header(const void H5_ATTR_UNUSED *params)
{
size_t i;
int nerrors;
if (MAINPROCESS) {
printf("\n");
printf("**********************************************\n");
printf("* *\n");
printf("* API Parallel Object Tests *\n");
printf("* *\n");
printf("**********************************************\n\n");
}
}
for (i = 0, nerrors = 0; i < ARRAY_LENGTH(par_object_tests); i++) {
/* nerrors += (*par_object_tests[i])() ? 1 : 0; */
void
H5_api_object_test_parallel_add(void)
{
/* Add a fake test to print out a header to distinguish different test interfaces */
AddTest("print_object_test_header", print_object_test_header, NULL, NULL, NULL, 0,
"Prints header for object tests");
if (MPI_SUCCESS != MPI_Barrier(MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" MPI_Barrier() failed!\n");
}
}
if (MAINPROCESS)
printf("\n");
return nerrors;
/* No tests yet */
}
+1 -1
View File
@@ -15,6 +15,6 @@
#include "H5_api_test_parallel.h"
int H5_api_object_test_parallel(void);
void H5_api_object_test_parallel_add(void);
#endif /* H5_API_OBJECT_TEST_PARALLEL_H_ */
+130 -38
View File
@@ -46,27 +46,27 @@ int mpi_rank;
#ifdef H5_API_TEST_HAVE_ASYNC
#define H5_API_PARALLEL_TESTS \
X(H5_API_TEST_NULL, "", NULL, 0) \
X(H5_API_TEST_FILE, "file", H5_api_file_test_parallel, 1) \
X(H5_API_TEST_GROUP, "group", H5_api_group_test_parallel, 1) \
X(H5_API_TEST_DATASET, "dataset", H5_api_dataset_test_parallel, 1) \
X(H5_API_TEST_DATATYPE, "datatype", H5_api_datatype_test_parallel, 1) \
X(H5_API_TEST_ATTRIBUTE, "attribute", H5_api_attribute_test_parallel, 1) \
X(H5_API_TEST_LINK, "link", H5_api_link_test_parallel, 1) \
X(H5_API_TEST_OBJECT, "object", H5_api_object_test_parallel, 1) \
X(H5_API_TEST_MISC, "misc", H5_api_misc_test_parallel, 1) \
X(H5_API_TEST_ASYNC, "async", H5_api_async_test_parallel, 1) \
X(H5_API_TEST_FILE, "file", H5_api_file_test_parallel_add, 1) \
X(H5_API_TEST_GROUP, "group", H5_api_group_test_parallel_add, 1) \
X(H5_API_TEST_DATASET, "dataset", H5_api_dataset_test_parallel_add, 1) \
X(H5_API_TEST_DATATYPE, "datatype", H5_api_datatype_test_parallel_add, 1) \
X(H5_API_TEST_ATTRIBUTE, "attribute", H5_api_attribute_test_parallel_add, 1) \
X(H5_API_TEST_LINK, "link", H5_api_link_test_parallel_add, 1) \
X(H5_API_TEST_OBJECT, "object", H5_api_object_test_parallel_add, 1) \
X(H5_API_TEST_MISC, "misc", H5_api_misc_test_parallel_add, 1) \
X(H5_API_TEST_ASYNC, "async", H5_api_async_test_parallel_add, 1) \
X(H5_API_TEST_MAX, "", NULL, 0)
#else
#define H5_API_PARALLEL_TESTS \
X(H5_API_TEST_NULL, "", NULL, 0) \
X(H5_API_TEST_FILE, "file", H5_api_file_test_parallel, 1) \
X(H5_API_TEST_GROUP, "group", H5_api_group_test_parallel, 1) \
X(H5_API_TEST_DATASET, "dataset", H5_api_dataset_test_parallel, 1) \
X(H5_API_TEST_DATATYPE, "datatype", H5_api_datatype_test_parallel, 1) \
X(H5_API_TEST_ATTRIBUTE, "attribute", H5_api_attribute_test_parallel, 1) \
X(H5_API_TEST_LINK, "link", H5_api_link_test_parallel, 1) \
X(H5_API_TEST_OBJECT, "object", H5_api_object_test_parallel, 1) \
X(H5_API_TEST_MISC, "misc", H5_api_misc_test_parallel, 1) \
X(H5_API_TEST_FILE, "file", H5_api_file_test_parallel_add, 1) \
X(H5_API_TEST_GROUP, "group", H5_api_group_test_parallel_add, 1) \
X(H5_API_TEST_DATASET, "dataset", H5_api_dataset_test_parallel_add, 1) \
X(H5_API_TEST_DATATYPE, "datatype", H5_api_datatype_test_parallel_add, 1) \
X(H5_API_TEST_ATTRIBUTE, "attribute", H5_api_attribute_test_parallel_add, 1) \
X(H5_API_TEST_LINK, "link", H5_api_link_test_parallel_add, 1) \
X(H5_API_TEST_OBJECT, "object", H5_api_object_test_parallel_add, 1) \
X(H5_API_TEST_MISC, "misc", H5_api_misc_test_parallel_add, 1) \
X(H5_API_TEST_MAX, "", NULL, 0)
#endif
@@ -77,7 +77,7 @@ enum H5_api_test_type { H5_API_PARALLEL_TESTS };
static const char *const H5_api_test_name[] = {H5_API_PARALLEL_TESTS};
#undef X
#define X(a, b, c, d) c,
static int (*H5_api_test_func[])(void) = {H5_API_PARALLEL_TESTS};
static void (*H5_api_test_add_func[])(void) = {H5_API_PARALLEL_TESTS};
#undef X
#define X(a, b, c, d) d,
static int H5_api_test_enabled[] = {H5_API_PARALLEL_TESTS};
@@ -95,13 +95,13 @@ H5_api_test_name_to_type(const char *test_name)
}
static void
H5_api_test_run(void)
H5_api_test_add(void)
{
enum H5_api_test_type i;
for (i = H5_API_TEST_FILE; i < H5_API_TEST_MAX; i++)
if (H5_api_test_enabled[i])
(void)H5_api_test_func[i]();
H5_api_test_add_func[i]();
}
hid_t
@@ -169,9 +169,40 @@ error:
return -1;
}
static int
parse_command_line(int argc, char **argv)
{
/* Simple argument checking, TODO can improve that later */
if (argc > 1) {
enum H5_api_test_type i = H5_api_test_name_to_type(argv[argc - 1]);
if (i != H5_API_TEST_NULL) {
/* Run only specific API test */
memset(H5_api_test_enabled, 0, sizeof(H5_api_test_enabled));
H5_api_test_enabled[i] = 1;
}
}
return 0;
}
static void
usage(FILE *stream)
{
fprintf(stream, "file run only the file interface tests\n");
fprintf(stream, "group run only the group interface tests\n");
fprintf(stream, "dataset run only the dataset interface tests\n");
fprintf(stream, "attribute run only the attribute interface tests\n");
fprintf(stream, "datatype run only the datatype interface tests\n");
fprintf(stream, "link run only the link interface tests\n");
fprintf(stream, "object run only the object interface tests\n");
fprintf(stream, "misc run only the miscellaneous tests\n");
fprintf(stream, "async run only the async interface tests\n");
}
int
main(int argc, char **argv)
{
H5E_auto2_t default_err_func;
const char *vol_connector_string;
const char *vol_connector_name;
unsigned seed;
@@ -180,6 +211,7 @@ main(int argc, char **argv)
hid_t registered_con_id = H5I_INVALID_HID;
char *vol_connector_string_copy = NULL;
char *vol_connector_info = NULL;
void *default_err_data = NULL;
int required = MPI_THREAD_MULTIPLE;
int provided;
@@ -200,16 +232,6 @@ main(int argc, char **argv)
printf("** INFO: couldn't initialize with MPI_THREAD_MULTIPLE threading support **\n");
}
/* Simple argument checking, TODO can improve that later */
if (argc > 1) {
enum H5_api_test_type i = H5_api_test_name_to_type(argv[1]);
if (i != H5_API_TEST_NULL) {
/* Run only specific API test */
memset(H5_api_test_enabled, 0, sizeof(H5_api_test_enabled));
H5_api_test_enabled[i] = 1;
}
}
/*
* Make sure that HDF5 is initialized on all MPI ranks before proceeding.
* This is important for certain VOL connectors which may require a
@@ -217,6 +239,43 @@ main(int argc, char **argv)
*/
H5open();
/* Store current error stack printing function since TestInit unsets it */
H5Eget_auto2(H5E_DEFAULT, &default_err_func, &default_err_data);
/* Initialize testing framework */
if (TestInit(argv[0], usage, NULL, NULL, NULL, mpi_rank) < 0) {
if (MAINPROCESS)
fprintf(stderr, "Couldn't initialize testing framework\n");
goto error;
}
/* Reset error stack printing function */
H5Eset_auto2(H5E_DEFAULT, default_err_func, default_err_data);
/* Hide all output from testing framework and replace with our own */
SetTestVerbosity(VERBO_NONE);
/* Parse command line separately from the test framework since
* tests need to be added before TestParseCmdLine in order for
* the -help option to show them, but we need to know ahead of
* time which tests to add if only a specific interface's tests
* are going to be run.
*/
parse_command_line(argc, argv);
/* Add tests */
H5_api_test_add();
/* Display testing information */
TestInfo(stdout);
/* Parse command line arguments */
if (TestParseCmdLine(argc, argv) < 0) {
if (MAINPROCESS)
fprintf(stderr, "Couldn't parse command-line arguments\n");
goto error;
}
n_tests_run_g = 0;
n_tests_passed_g = 0;
n_tests_failed_g = 0;
@@ -285,7 +344,7 @@ main(int argc, char **argv)
printf(" - Test file name: '%s'\n", H5_api_test_parallel_filename);
printf(" - Number of MPI ranks: %d\n", mpi_size);
printf(" - Test seed: %u\n", seed);
printf("\n\n");
printf("\n");
}
BEGIN_INDEPENDENT_OP(create_fapl)
@@ -389,19 +448,35 @@ main(int argc, char **argv)
}
END_INDEPENDENT_OP(create_test_container);
/* Run all the tests that are enabled */
H5_api_test_run();
MPI_Barrier(MPI_COMM_WORLD);
/* Perform tests */
if (PerformTests() < 0) {
if (MAINPROCESS)
fprintf(stderr, "Couldn't run tests\n");
goto error;
}
if (MAINPROCESS)
printf("Cleaning up testing files\n");
H5Fdelete(H5_api_test_parallel_filename, fapl_id);
printf("\n");
if (MAINPROCESS) {
/* Display test summary, if requested */
if (GetTestSummary())
TestSummary(stdout);
printf("Deleting container file for tests\n\n");
}
if (GetTestCleanup())
H5Fdelete(H5_api_test_parallel_filename, fapl_id);
if (n_tests_run_g > 0) {
if (MAINPROCESS)
printf("The below statistics are minimum values due to the possibility of some ranks failing a "
"test while others pass:\n");
if (MPI_SUCCESS != MPI_Allreduce(MPI_IN_PLACE, &n_tests_passed_g, 1, MPI_UNSIGNED_LONG_LONG, MPI_MIN,
if (MPI_SUCCESS != MPI_Allreduce(MPI_IN_PLACE, &n_tests_passed_g, 1, H5_SIZE_T_AS_MPI_TYPE, MPI_MIN,
MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" failed to collect consensus about the minimum number of tests that passed -- "
@@ -413,7 +488,7 @@ main(int argc, char **argv)
n_tests_passed_g > 0 ? "At least " : "", n_tests_passed_g, n_tests_run_g,
((double)n_tests_passed_g / (double)n_tests_run_g * 100.0), vol_connector_name);
if (MPI_SUCCESS != MPI_Allreduce(MPI_IN_PLACE, &n_tests_failed_g, 1, MPI_UNSIGNED_LONG_LONG, MPI_MIN,
if (MPI_SUCCESS != MPI_Allreduce(MPI_IN_PLACE, &n_tests_failed_g, 1, H5_SIZE_T_AS_MPI_TYPE, MPI_MIN,
MPI_COMM_WORLD)) {
if (MAINPROCESS)
printf(" failed to collect consensus about the minimum number of tests that failed -- "
@@ -446,11 +521,28 @@ main(int argc, char **argv)
fprintf(stderr, " failed to close MPI FAPL\n");
}
free(vol_connector_string_copy);
vol_connector_string_copy = NULL;
if (GetTestNumErrs() > 0)
n_tests_failed_g += (size_t)GetTestNumErrs();
/* Release test infrastructure */
if (TestShutdown() < 0) {
if (MAINPROCESS)
fprintf(stderr, "Couldn't shut down testing framework\n");
goto error;
}
H5close();
MPI_Finalize();
exit(EXIT_SUCCESS);
/* Exit failure if errors encountered; else exit success. */
if (n_tests_failed_g > 0)
exit(EXIT_FAILURE);
else
exit(EXIT_SUCCESS);
error:
free(vol_connector_string_copy);