-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Handle certain empty subfiling environment variables #4038
Changes from 20 commits
74573e7
9659199
69112cd
2a3d6f1
110ab36
88c5e94
08e6cf5
8770bc6
b768e0e
abf4d99
653f3d0
bb26dfa
ea17485
03d6798
4dd9238
e49c046
a596187
ee7bb78
b3389aa
dd5c687
62e71a6
10c6aaf
ccd9299
8971492
329ba12
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 |
---|---|---|
|
@@ -6185,8 +6185,13 @@ main(int argc, char **argv) | |
{ | ||
|
||
#ifdef H5_HAVE_SUBFILING_VFD | ||
int required = MPI_THREAD_MULTIPLE; | ||
int provided = 0; | ||
int required = MPI_THREAD_MULTIPLE; | ||
int provided = 0; | ||
char *subfiling_subfile_prefix_saved; | ||
char *subfiling_ioc_selection_criteria_saved; | ||
char *subfiling_ioc_per_node_saved; | ||
char *subfiling_stripe_size_saved; | ||
char *subfiling_config_file_prefix_saved; | ||
#endif | ||
int mpi_size; | ||
int mpi_rank = 0; | ||
|
@@ -6250,6 +6255,68 @@ main(int argc, char **argv) | |
|
||
test_vector_io(mpi_rank, mpi_size); | ||
|
||
#ifdef H5_HAVE_SUBFILING_VFD | ||
|
||
if (mpi_rank == 0) | ||
printf("\n --- TESTING SUBFILING VFD: environment variables set to empty --- \n"); | ||
|
||
subfiling_subfile_prefix_saved = getenv("H5FD_SUBFILING_SUBFILE_PREFIX"); | ||
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. I believe that you need to strdup these 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. True, although in this case we probably don't even need to try to save the values. @glennsong09 I think we can update this to just have the setenv/unsetenv pairs. 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. Okay, I removed the value saving code. |
||
subfiling_ioc_selection_criteria_saved = getenv("H5FD_SUBFILING_IOC_SELECTION_CRITERIA"); | ||
subfiling_ioc_per_node_saved = getenv("H5FD_SUBFILING_IOC_PER_NODE"); | ||
subfiling_stripe_size_saved = getenv("H5FD_SUBFILING_STRIPE_SIZE"); | ||
subfiling_config_file_prefix_saved = getenv("H5FD_SUBFILING_CONFIG_FILE_PREFIX"); | ||
|
||
HDsetenv("H5FD_SUBFILING_SUBFILE_PREFIX", "", 1); | ||
HDsetenv("H5FD_SUBFILING_IOC_SELECTION_CRITERIA", "", 1); | ||
HDsetenv("H5FD_SUBFILING_IOC_PER_NODE", "", 1); | ||
HDsetenv("H5FD_SUBFILING_STRIPE_SIZE", "", 1); | ||
HDsetenv("H5FD_SUBFILING_CONFIG_FILE_PREFIX", "", 1); | ||
|
||
MPI_Barrier(comm); | ||
|
||
if (mpi_rank == 0) | ||
printf("\n --- TESTING MPIO VFD: selection I/O --- \n"); | ||
|
||
test_selection_io(mpi_rank, mpi_size); | ||
|
||
if (mpi_rank == 0) | ||
printf("\n --- TESTING MPIO VFD: vector I/O --- \n"); | ||
|
||
if (mpi_size < 2) { | ||
if (mpi_rank == 0) { | ||
printf(" Need at least 2 processes to run tests for vector I/O."); | ||
SKIPPED(); | ||
} | ||
printf("\n"); | ||
goto finish; | ||
} | ||
|
||
test_vector_io(mpi_rank, mpi_size); | ||
|
||
HDunsetenv("H5FD_SUBFILING_SUBFILE_PREFIX"); | ||
HDunsetenv("H5FD_SUBFILING_IOC_SELECTION_CRITERIA"); | ||
HDunsetenv("H5FD_SUBFILING_IOC_PER_NODE"); | ||
HDunsetenv("H5FD_SUBFILING_STRIPE_SIZE"); | ||
HDunsetenv("H5FD_SUBFILING_CONFIG_FILE_PREFIX"); | ||
|
||
if (subfiling_subfile_prefix_saved) { | ||
HDsetenv("H5FD_SUBFILING_SUBFILE_PREFIX", subfiling_subfile_prefix_saved, 1); | ||
} | ||
if (subfiling_ioc_selection_criteria_saved) { | ||
HDsetenv("H5FD_SUBFILING_IOC_SELECTION_CRITERIA", subfiling_ioc_selection_criteria_saved, 1); | ||
} | ||
if (subfiling_ioc_per_node_saved) { | ||
HDsetenv("H5FD_SUBFILING_IOC_PER_NODE", subfiling_ioc_per_node_saved, 1); | ||
} | ||
if (subfiling_stripe_size_saved) { | ||
HDsetenv("H5FD_SUBFILING_STRIPE_SIZE", subfiling_stripe_size_saved, 1); | ||
} | ||
if (subfiling_config_file_prefix_saved) { | ||
HDsetenv("H5FD_SUBFILING_CONFIG_FILE_PREFIX", subfiling_config_file_prefix_saved, 1); | ||
} | ||
|
||
#endif | ||
|
||
finish: | ||
/* make sure all processes are finished before final report, cleanup | ||
* and exit. | ||
|
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.
Same fix here? (Either not saving the values or strdup'ing them)
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.
Do you think saving the values is necessary? I wasn't sure. If you don't think so, I can just remove it there too.
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.
For the time being, we don't really need to save the values since this is the last set of tests that run. If another set of tests is interested in the values from the environment in the future we may need to save the values, but otherwise it's fine to remove them for now.
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.
Okay, I can remove it from this test too.