-
-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow usage of page buffering for serial file access from parallel HDF5 builds #4568
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,6 @@ | |
#define FILENAME_LEN 1024 | ||
|
||
/* test routines */ | ||
#ifdef H5_HAVE_PARALLEL | ||
static unsigned verify_page_buffering_disabled(hid_t orig_fapl, const char *driver_name); | ||
#else | ||
#define NUM_DSETS 5 | ||
#define NX 100 | ||
#define NY 50 | ||
|
@@ -54,12 +51,9 @@ static unsigned test_stats_collection(hid_t orig_fapl, const char *driver_name); | |
/* helper routines */ | ||
static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl); | ||
static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size); | ||
#endif /* H5_HAVE_PARALLEL */ | ||
|
||
static const char *FILENAME[] = {"filepaged", NULL}; | ||
|
||
#ifndef H5_HAVE_PARALLEL | ||
|
||
/*------------------------------------------------------------------------- | ||
* Function: create_file() | ||
* | ||
|
@@ -289,7 +283,6 @@ open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size | |
H5E_END_TRY | ||
return 1; | ||
} | ||
#endif /* H5_HAVE_PARALLEL */ | ||
|
||
/* | ||
* | ||
|
@@ -353,8 +346,6 @@ set_multi_split(const char *driver_name, hid_t fapl, hsize_t pagesize) | |
|
||
} /* set_multi_split() */ | ||
|
||
#ifndef H5_HAVE_PARALLEL | ||
|
||
/*------------------------------------------------------------------------- | ||
* Function: test_args() | ||
* | ||
|
@@ -2043,121 +2034,6 @@ test_stats_collection(hid_t orig_fapl, const char *driver_name) | |
|
||
return 1; | ||
} /* test_stats_collection */ | ||
#endif /* #ifndef H5_HAVE_PARALLEL */ | ||
|
||
/*------------------------------------------------------------------------- | ||
* Function: verify_page_buffering_disabled() | ||
* | ||
* Purpose: This function should only be called in parallel | ||
* builds. | ||
* | ||
* At present, page buffering should be disabled in parallel | ||
* builds. Verify this. | ||
* | ||
* Return: 0 if test is successful | ||
* 1 if test fails | ||
* | ||
*------------------------------------------------------------------------- | ||
*/ | ||
|
||
#ifdef H5_HAVE_PARALLEL | ||
static unsigned | ||
verify_page_buffering_disabled(hid_t orig_fapl, const char *driver_name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed in this serial test now. |
||
{ | ||
char filename[FILENAME_LEN]; /* Filename to use */ | ||
hid_t file_id = H5I_INVALID_HID; /* File ID */ | ||
hid_t fcpl = H5I_INVALID_HID; | ||
hid_t fapl = H5I_INVALID_HID; | ||
|
||
TESTING("Page Buffering Disabled"); | ||
h5_fixname(FILENAME[0], orig_fapl, filename, sizeof(filename)); | ||
|
||
/* first, try to create a file with page buffering enabled */ | ||
|
||
if ((fapl = H5Pcopy(orig_fapl)) < 0) | ||
TEST_ERROR; | ||
|
||
if (set_multi_split(driver_name, fapl, 4096) != 0) | ||
TEST_ERROR; | ||
|
||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
if (H5Pset_file_space_page_size(fcpl, 4096) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
if (H5Pset_page_buffer_size(fapl, 4096 * 8, 0, 0) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
/* try to create the file -- should fail */ | ||
H5E_BEGIN_TRY | ||
{ | ||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); | ||
} | ||
H5E_END_TRY | ||
|
||
if (file_id >= 0) | ||
TEST_ERROR; | ||
|
||
/* now, create a file, close it, and then try to open it with page | ||
* buffering enabled. | ||
*/ | ||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
if (H5Pset_file_space_page_size(fcpl, 4096) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
/* create the file */ | ||
if ((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
/* close the file */ | ||
if (H5Fclose(file_id) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
/* try to open the file using the fapl prepared above which enables | ||
* page buffering. Should fail. | ||
*/ | ||
H5E_BEGIN_TRY | ||
{ | ||
file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); | ||
} | ||
H5E_END_TRY | ||
|
||
if (file_id >= 0) | ||
TEST_ERROR; | ||
|
||
if (H5Pclose(fcpl) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
if (H5Pclose(fapl) < 0) | ||
FAIL_STACK_ERROR; | ||
|
||
PASSED(); | ||
|
||
return 0; | ||
|
||
error: | ||
|
||
H5E_BEGIN_TRY | ||
{ | ||
H5Pclose(fapl); | ||
H5Pclose(fcpl); | ||
H5Fclose(file_id); | ||
} | ||
H5E_END_TRY | ||
|
||
return 1; | ||
|
||
} /* verify_page_buffering_disabled() */ | ||
#endif /* H5_HAVE_PARALLEL */ | ||
|
||
/*------------------------------------------------------------------------- | ||
* Function: main() | ||
|
@@ -2203,22 +2079,13 @@ main(void) | |
FAIL_STACK_ERROR; | ||
api_ctx_pushed = true; | ||
|
||
#ifdef H5_HAVE_PARALLEL | ||
|
||
puts("Page Buffering is disabled for parallel."); | ||
nerrors += verify_page_buffering_disabled(fapl, driver_name); | ||
|
||
#else /* H5_HAVE_PARALLEL */ | ||
|
||
nerrors += test_args(fapl, driver_name); | ||
nerrors += test_raw_data_handling(fapl, driver_name); | ||
nerrors += test_lru_processing(fapl, driver_name); | ||
nerrors += test_min_threshold(fapl, driver_name); | ||
nerrors += test_stats_collection(fapl, driver_name); | ||
nerrors += test_pb_fapl_tolerance_at_open(); | ||
|
||
#endif /* H5_HAVE_PARALLEL */ | ||
|
||
h5_clean_files(FILENAME, fapl); | ||
|
||
if (nerrors) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,9 +402,7 @@ main(int argc, char **argv) | |
AddTest("split", test_split_comm_access, NULL, "dataset using split communicators", PARATESTFILE); | ||
AddTest("h5oflusherror", test_oflush, NULL, "H5Oflush failure", PARATESTFILE); | ||
|
||
#ifdef PB_OUT /* temporary: disable page buffering when parallel */ | ||
AddTest("page_buffer", test_page_buffer_access, NULL, "page buffer usage in parallel", PARATESTFILE); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure that we're always testing page buffer access, even if that means that in parallel we're just making sure it's disabled. |
||
#endif | ||
|
||
AddTest("props", test_file_properties, NULL, "Coll Metadata file property settings", PARATESTFILE); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved these checks down to a single
H5_HAVE_PARALLEL
block below.