From 4a67a056d55e132063e2c6ac5db139109260a1a1 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 24 Oct 2023 16:27:29 -0500 Subject: [PATCH 01/25] Create test and add to testphdf5 --- testpar/t_ph5basic.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ testpar/testphdf5.c | 1 + testpar/testphdf5.h | 1 + 3 files changed, 85 insertions(+) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index b627b7c40ef..c279e600b00 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -177,3 +177,86 @@ test_fapl_mpio_dup(void) VRFY((mrc == MPI_SUCCESS), "MPI_Info_free"); } } /* end test_fapl_mpio_dup() */ + +/*------------------------------------------------------------------------- + * Function: test_get_dxpl_mpio + * + * Purpose: Test that H5Pget_fxpl_mpio will properly return the data + * transfer mode of collective and independent I/O access + * after setting it and writing some data. + * + * Return: Success: None + * Failure: Abort + *------------------------------------------------------------------------- + */ +void +test_get_dxpl_mpio(void) +{ + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; + hsize_t dims[2] = {100, 100}; + hsize_t i, j; + int *data_g = NULL; + + if (VERBOSE_MED) + printf("Verify get_fxpl_mpio correctly gets the data transfer mode + set in the data transfer property list after a write\n"); + + if ((fid = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + goto error; + + /* Create a dataset */ + if ((sid = H5Screate_simple(2, dims, NULL)) < 0) + goto error; + if ((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Use collective I/O access */ + if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + /* Write some data */ + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + data_g[(i * 100) + j] = (int)(i + (i * j) + j); + + if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data_g) < 0) + goto error; + + /* Check to make sure the property is still correct */ + if (H5Pget_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + /* Use independent I/O access */ + if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT) < 0) + goto error; + + /* Write some data */ + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + data_g[(i * 100) + j] = (int)(i + (j * j) + i); + + /* Check to make sure the property is still correct */ + if (H5Pget_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT) < 0) + goto error; + + /* Pass in NULL */ + if (H5Pset_dxpl_mpio(dxpl_id, NULL) < 0) + goto error; + + /* Write some data */ + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + data_g[(i * 100) + j] = (int)(j + (i * i) + j); + + /* Check to make sure the property is still correct */ + if (H5Pget_dxpl_mpio(dxpl_id, NULL) < 0) + goto error; + +error: + return H5I_INVALID_HID; +} /* end test_get_dxpl_mpio() */ diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 2d85e1ae289..64264cc87ab 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -351,6 +351,7 @@ main(int argc, char **argv) /* Tests are generally arranged from least to most complexity... */ AddTest("mpiodup", test_fapl_mpio_dup, NULL, "fapl_mpio duplicate", NULL); + AddTest("getdxplmpio", test_get_dxpl_mpio, NULL, "dxpl_mpio get", NULL); AddTest("split", test_split_comm_access, NULL, "dataset using split communicators", PARATESTFILE); AddTest("h5oflusherror", test_oflush, NULL, "H5Oflush failure", PARATESTFILE); diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 5699760c61b..7b708edaa50 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -240,6 +240,7 @@ void collective_group_write_independent_group_read(void); void collective_group_write(void); void independent_group_read(void); void test_fapl_mpio_dup(void); +void test_get_dxpl_mpio(void); void test_split_comm_access(void); void test_page_buffer_access(void); void dataset_atomicity(void); From 420d91c8768fe0dd9b043b35c1c2acf379e19de4 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 21:29:51 +0000 Subject: [PATCH 02/25] Committing clang-format changes --- testpar/t_ph5basic.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index c279e600b00..fcd33680607 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -181,10 +181,10 @@ test_fapl_mpio_dup(void) /*------------------------------------------------------------------------- * Function: test_get_dxpl_mpio * - * Purpose: Test that H5Pget_fxpl_mpio will properly return the data - * transfer mode of collective and independent I/O access + * Purpose: Test that H5Pget_fxpl_mpio will properly return the data + * transfer mode of collective and independent I/O access * after setting it and writing some data. - * + * * Return: Success: None * Failure: Abort *------------------------------------------------------------------------- @@ -192,13 +192,13 @@ test_fapl_mpio_dup(void) void test_get_dxpl_mpio(void) { - hid_t fid = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t did = H5I_INVALID_HID; - hid_t dxpl_id = H5I_INVALID_HID; - hsize_t dims[2] = {100, 100}; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; + hsize_t dims[2] = {100, 100}; hsize_t i, j; - int *data_g = NULL; + int *data_g = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode From 71f95277c2edaa2e99f9b7cacf2ae947f9ce70b4 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Mon, 30 Oct 2023 19:55:55 -0500 Subject: [PATCH 03/25] Move changes to remote --- testpar/t_ph5basic.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index c279e600b00..571acd7878d 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -192,13 +192,14 @@ test_fapl_mpio_dup(void) void test_get_dxpl_mpio(void) { - hid_t fid = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t did = H5I_INVALID_HID; - hid_t dxpl_id = H5I_INVALID_HID; - hsize_t dims[2] = {100, 100}; - hsize_t i, j; - int *data_g = NULL; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; + hsize_t dims[2] = {100, 100}; + hsize_t i, j; + H5FD_mpio_xfer_t xfer_mode; + int *data_g = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode @@ -219,7 +220,7 @@ test_get_dxpl_mpio(void) if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) goto error; - /* Write some data */ + /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) data_g[(i * 100) + j] = (int)(i + (i * j) + j); @@ -228,8 +229,12 @@ test_get_dxpl_mpio(void) goto error; /* Check to make sure the property is still correct */ - if (H5Pget_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) + if (H5Pget_dxpl_mpio(dxpl_id, &xfer_mode) < 0) + goto error; + + if (xfer_mode != H5FD_MPIO_COLLECTIVE) { goto error; + } /* Use independent I/O access */ if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT) < 0) @@ -241,21 +246,16 @@ test_get_dxpl_mpio(void) data_g[(i * 100) + j] = (int)(i + (j * j) + i); /* Check to make sure the property is still correct */ - if (H5Pget_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT) < 0) + if (H5Pget_dxpl_mpio(dxpl_id, &xfer_mode) < 0) goto error; - /* Pass in NULL */ - if (H5Pset_dxpl_mpio(dxpl_id, NULL) < 0) + if (xfer_mode != H5FD_MPIO_INDEPENDENT) { goto error; + } - /* Write some data */ - for (i = 0; i < dims[0]; i++) - for (j = 0; j < dims[1]; j++) - data_g[(i * 100) + j] = (int)(j + (i * i) + j); - - /* Check to make sure the property is still correct */ - if (H5Pget_dxpl_mpio(dxpl_id, NULL) < 0) + if (H5Pclose(dxpl) < 0) { goto error; + } error: return H5I_INVALID_HID; From 00a99a75e240951928588521cfd59f27df6fb5e7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 00:59:46 +0000 Subject: [PATCH 04/25] Committing clang-format changes --- testpar/t_ph5basic.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 75c1fe4b8da..69cbf2ad104 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -192,14 +192,14 @@ test_fapl_mpio_dup(void) void test_get_dxpl_mpio(void) { - hid_t fid = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t did = H5I_INVALID_HID; - hid_t dxpl_id = H5I_INVALID_HID; - hsize_t dims[2] = {100, 100}; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; + hsize_t dims[2] = {100, 100}; hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; - int *data_g = NULL; + int *data_g = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode @@ -233,7 +233,7 @@ test_get_dxpl_mpio(void) goto error; if (xfer_mode != H5FD_MPIO_COLLECTIVE) { - goto error; + goto error; } /* Use independent I/O access */ @@ -250,11 +250,11 @@ test_get_dxpl_mpio(void) goto error; if (xfer_mode != H5FD_MPIO_INDEPENDENT) { - goto error; + goto error; } if (H5Pclose(dxpl) < 0) { - goto error; + goto error; } error: From 11a09c73904570d954d72546996467e05ba1484d Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Mon, 30 Oct 2023 20:17:47 -0500 Subject: [PATCH 05/25] Add in NULL check --- testpar/t_ph5basic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 75c1fe4b8da..ca6d19def55 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -236,6 +236,10 @@ test_get_dxpl_mpio(void) goto error; } + /* Check it does nothing on receiving NULL */ + if (H5Pget_dxpl_mpio(dxpl_id, NULL) < 0) + goto error; + /* Use independent I/O access */ if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT) < 0) goto error; From 9b5210b319a570d2807c326761f412b875f35066 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Mon, 30 Oct 2023 20:58:18 -0500 Subject: [PATCH 06/25] Move to remote --- testpar/t_ph5basic.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 25f9b802658..8e840888ff0 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -199,13 +199,13 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; - int *data_g = NULL; + int* data_g = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode - set in the data transfer property list after a write\n"); + set in the data transfer property list after a write\n"); - if ((fid = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + if ((fid = H5Fcreate("file", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Create a dataset */ @@ -254,11 +254,21 @@ test_get_dxpl_mpio(void) goto error; if (xfer_mode != H5FD_MPIO_INDEPENDENT) { - goto error; + goto error; } - if (H5Pclose(dxpl) < 0) { - goto error; + /* Close everything */ + if (H5Pclose(dxpl_id) < 0) { + goto error; + } + if (H5Dclose(did) < 0) { + goto error; + } + if (H5Sclose(sid) < 0) { + goto error; + } + if (H5Fclose(fid) < 0) { + goto error; } error: From 12e838bdc9c66b48fb16682f4b52de4b930608ab Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 02:00:25 +0000 Subject: [PATCH 07/25] Committing clang-format changes --- testpar/t_ph5basic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 8e840888ff0..f58d29f4398 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -199,7 +199,7 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; - int* data_g = NULL; + int *data_g = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode @@ -254,21 +254,21 @@ test_get_dxpl_mpio(void) goto error; if (xfer_mode != H5FD_MPIO_INDEPENDENT) { - goto error; + goto error; } /* Close everything */ if (H5Pclose(dxpl_id) < 0) { - goto error; + goto error; } if (H5Dclose(did) < 0) { - goto error; + goto error; } if (H5Sclose(sid) < 0) { - goto error; + goto error; } if (H5Fclose(fid) < 0) { - goto error; + goto error; } error: From 7fbf5bd0204478b6ab0b8cf4b49b4ace8d8abc20 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 08:08:43 -0700 Subject: [PATCH 08/25] Initialize data array properly --- testpar/t_ph5basic.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index f58d29f4398..3eab590bbed 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -199,12 +199,15 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; - int *data_g = NULL; + int *data = NULL; if (VERBOSE_MED) - printf("Verify get_fxpl_mpio correctly gets the data transfer mode + printf("Verify get_fxpl_mpio correctly gets the data transfer mode\ set in the data transfer property list after a write\n"); + if (NULL == (data = malloc(100 * 100 * sizeof(*data)))) + goto error; + if ((fid = H5Fcreate("file", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; @@ -223,9 +226,9 @@ test_get_dxpl_mpio(void) /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) - data_g[(i * 100) + j] = (int)(i + (i * j) + j); + data[(i * 100) + j] = (int)(i + (i * j) + j); - if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data_g) < 0) + if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data) < 0) goto error; /* Check to make sure the property is still correct */ @@ -247,8 +250,11 @@ test_get_dxpl_mpio(void) /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) - data_g[(i * 100) + j] = (int)(i + (j * j) + i); + data[(i * 100) + j] = (int)(i + (j * j) + i); + if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data) < 0) + goto error; + /* Check to make sure the property is still correct */ if (H5Pget_dxpl_mpio(dxpl_id, &xfer_mode) < 0) goto error; @@ -258,6 +264,7 @@ test_get_dxpl_mpio(void) } /* Close everything */ + free(data); if (H5Pclose(dxpl_id) < 0) { goto error; } @@ -272,5 +279,5 @@ test_get_dxpl_mpio(void) } error: - return H5I_INVALID_HID; + return 0; } /* end test_get_dxpl_mpio() */ From 01a69246ed8fc8bdeae824363173265fbf7a9a11 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:11:55 +0000 Subject: [PATCH 09/25] Committing clang-format changes --- testpar/t_ph5basic.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 3eab590bbed..b04a97fc311 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -199,7 +199,7 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; - int *data = NULL; + int *data = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode\ @@ -222,7 +222,7 @@ test_get_dxpl_mpio(void) goto error; if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) goto error; - + /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) @@ -236,9 +236,9 @@ test_get_dxpl_mpio(void) goto error; if (xfer_mode != H5FD_MPIO_COLLECTIVE) { - goto error; + goto error; } - + /* Check it does nothing on receiving NULL */ if (H5Pget_dxpl_mpio(dxpl_id, NULL) < 0) goto error; @@ -251,7 +251,7 @@ test_get_dxpl_mpio(void) for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) data[(i * 100) + j] = (int)(i + (j * j) + i); - + if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data) < 0) goto error; @@ -260,22 +260,22 @@ test_get_dxpl_mpio(void) goto error; if (xfer_mode != H5FD_MPIO_INDEPENDENT) { - goto error; + goto error; } /* Close everything */ free(data); if (H5Pclose(dxpl_id) < 0) { - goto error; + goto error; } if (H5Dclose(did) < 0) { - goto error; + goto error; } if (H5Sclose(sid) < 0) { - goto error; + goto error; } if (H5Fclose(fid) < 0) { - goto error; + goto error; } error: From d50a942a7399b9df8a70e33ff49d2fb1682da3d2 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 10:28:43 -0500 Subject: [PATCH 10/25] Change error handling of code --- testpar/t_ph5basic.c | 91 +++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 3eab590bbed..c60ba1be1ea 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -199,85 +199,80 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; + herr_t ret; int *data = NULL; if (VERBOSE_MED) - printf("Verify get_fxpl_mpio correctly gets the data transfer mode\ - set in the data transfer property list after a write\n"); + printf("Verify get_fxpl_mpio correctly gets the data transfer mode" + "set in the data transfer property list after a write\n"); - if (NULL == (data = malloc(100 * 100 * sizeof(*data)))) - goto error; + data = malloc(100 * 100 * sizeof(*data)); + VRFY((data != NULL), "Data buffer initialized properly"); - if ((fid = H5Fcreate("file", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + fid = H5Fcreate("file", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create a dataset */ - if ((sid = H5Screate_simple(2, dims, NULL)) < 0) - goto error; - if ((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + sid = H5Screate_simple(2, dims, NULL); + VRFY((sid >= 0), "H5Screate succeeded"); + did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((did >= 0), "H5Dcreate2 succeeded"); /* Use collective I/O access */ - if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + dxpl_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((dxpl_id >= 0), "H5Pcreate succeeded"); + ret = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio set to collective succeeded"); /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) data[(i * 100) + j] = (int)(i + (i * j) + j); - if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data) < 0) - goto error; + ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data); + VRFY((ret >= 0), "H5Dwrite succeeded"); /* Check to make sure the property is still correct */ - if (H5Pget_dxpl_mpio(dxpl_id, &xfer_mode) < 0) - goto error; - - if (xfer_mode != H5FD_MPIO_COLLECTIVE) { - goto error; - } + ret = H5Pget_dxpl_mpio(dxpl_id, &xfer_mode); + VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); + VRFY((xfer_mode != H5FD_MPIO_COLLECTIVE), "Xfer_mode retrieved" + " successfully"); /* Check it does nothing on receiving NULL */ - if (H5Pget_dxpl_mpio(dxpl_id, NULL) < 0) - goto error; + ret = H5Pget_dxpl_mpio(dxpl_id, NULL); + VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded on NULL input"); /* Use independent I/O access */ - if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT) < 0) - goto error; + ret = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT); + VRFY((ret >= 0), "H5Pset_dxpl_mpio set to independent succeeded"); /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) data[(i * 100) + j] = (int)(i + (j * j) + i); - if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data) < 0) - goto error; + ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data); + VRFY((ret >= 0), "H5Dwrite succeeded"); /* Check to make sure the property is still correct */ - if (H5Pget_dxpl_mpio(dxpl_id, &xfer_mode) < 0) - goto error; - - if (xfer_mode != H5FD_MPIO_INDEPENDENT) { - goto error; - } + ret = H5Pget_dxpl_mpio(dxpl_id, &xfer_mode); + VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); + VRFY((xfer_mode != H5FD_MPIO_INDEPENDENT), "Xfer_mode retrieved" + " successfully"); /* Close everything */ free(data); - if (H5Pclose(dxpl_id) < 0) { - goto error; - } - if (H5Dclose(did) < 0) { - goto error; - } - if (H5Sclose(sid) < 0) { - goto error; - } - if (H5Fclose(fid) < 0) { - goto error; - } -error: - return 0; + ret = H5Pclose(dxpl_id); + VRFY((ret >= 0),"H5Pclose succeeded"); + + ret = H5Dclose(did); + VRFY((ret >= 0),"H5Dclose succeeded"); + + ret = H5Sclose(sid) < 0; + VRFY((ret >= 0),"H5Sclose succeeded"); + + ret = H5Fclose(fid) < 0; + VRFY((ret >= 0),"H5Fclose succeeded"); + } /* end test_get_dxpl_mpio() */ From 084ae97a89650905cf090a6938fee740a3e2dde5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:31:52 +0000 Subject: [PATCH 11/25] Committing clang-format changes --- testpar/t_ph5basic.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index c60ba1be1ea..72548ab700c 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -200,11 +200,11 @@ test_get_dxpl_mpio(void) hsize_t i, j; H5FD_mpio_xfer_t xfer_mode; herr_t ret; - int *data = NULL; + int *data = NULL; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode" - "set in the data transfer property list after a write\n"); + "set in the data transfer property list after a write\n"); data = malloc(100 * 100 * sizeof(*data)); VRFY((data != NULL), "Data buffer initialized properly"); @@ -223,7 +223,7 @@ test_get_dxpl_mpio(void) VRFY((dxpl_id >= 0), "H5Pcreate succeeded"); ret = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio set to collective succeeded"); - + /* Write some data */ for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) @@ -236,8 +236,8 @@ test_get_dxpl_mpio(void) ret = H5Pget_dxpl_mpio(dxpl_id, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); VRFY((xfer_mode != H5FD_MPIO_COLLECTIVE), "Xfer_mode retrieved" - " successfully"); - + " successfully"); + /* Check it does nothing on receiving NULL */ ret = H5Pget_dxpl_mpio(dxpl_id, NULL); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded on NULL input"); @@ -250,7 +250,7 @@ test_get_dxpl_mpio(void) for (i = 0; i < dims[0]; i++) for (j = 0; j < dims[1]; j++) data[(i * 100) + j] = (int)(i + (j * j) + i); - + ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data); VRFY((ret >= 0), "H5Dwrite succeeded"); @@ -258,21 +258,21 @@ test_get_dxpl_mpio(void) ret = H5Pget_dxpl_mpio(dxpl_id, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); VRFY((xfer_mode != H5FD_MPIO_INDEPENDENT), "Xfer_mode retrieved" - " successfully"); + " successfully"); /* Close everything */ free(data); ret = H5Pclose(dxpl_id); - VRFY((ret >= 0),"H5Pclose succeeded"); + VRFY((ret >= 0), "H5Pclose succeeded"); ret = H5Dclose(did); - VRFY((ret >= 0),"H5Dclose succeeded"); + VRFY((ret >= 0), "H5Dclose succeeded"); ret = H5Sclose(sid) < 0; - VRFY((ret >= 0),"H5Sclose succeeded"); + VRFY((ret >= 0), "H5Sclose succeeded"); ret = H5Fclose(fid) < 0; - VRFY((ret >= 0),"H5Fclose succeeded"); + VRFY((ret >= 0), "H5Fclose succeeded"); } /* end test_get_dxpl_mpio() */ From 17274523315620a316014cbebf19fd381991dbb6 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 11:07:28 -0500 Subject: [PATCH 12/25] Move changes to remote --- testpar/t_ph5basic.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index c60ba1be1ea..30f55464687 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -196,16 +196,25 @@ test_get_dxpl_mpio(void) hid_t sid = H5I_INVALID_HID; hid_t did = H5I_INVALID_HID; hid_t dxpl_id = H5I_INVALID_HID; + H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; hsize_t i, j; - H5FD_mpio_xfer_t xfer_mode; - herr_t ret; int *data = NULL; + + MPI_Comm comm; + int mrc; + int mpi_size, mpi_rank; + + herr_t ret; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode" "set in the data transfer property list after a write\n"); + /* set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + data = malloc(100 * 100 * sizeof(*data)); VRFY((data != NULL), "Data buffer initialized properly"); @@ -263,6 +272,11 @@ test_get_dxpl_mpio(void) /* Close everything */ free(data); + if (comm != MPI_COMM_WORLD) { + mrc = MPI_Comm_free(&comm); + VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free succeeded"); + } + ret = H5Pclose(dxpl_id); VRFY((ret >= 0),"H5Pclose succeeded"); From 5fadef7e5771158049c977017ae780fe2e65b41c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:18:26 +0000 Subject: [PATCH 13/25] Committing clang-format changes --- testpar/t_ph5basic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 2c3ac12f98c..72b0a18537c 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -199,13 +199,13 @@ test_get_dxpl_mpio(void) H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; hsize_t i, j; - int *data = NULL; - - MPI_Comm comm; - int mrc; - int mpi_size, mpi_rank; + int *data = NULL; - herr_t ret; + MPI_Comm comm; + int mrc; + int mpi_size, mpi_rank; + + herr_t ret; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode" From 3dee772d4bf0c26dfa75559e70c37fa85a068e7b Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 13:19:44 -0500 Subject: [PATCH 14/25] Move to remote --- testpar/t_ph5basic.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 2c3ac12f98c..5d49fb21c18 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -211,13 +211,20 @@ test_get_dxpl_mpio(void) printf("Verify get_fxpl_mpio correctly gets the data transfer mode" "set in the data transfer property list after a write\n"); - /* set up MPI parameters */ + /* Set up MPI parameters */ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + /* Create a new communicator that has the same processes as MPI_COMM_WORLD. + * Use MPI_Comm_split because it is simpler than MPI_Comm_create */ + mrc = MPI_Comm_split(MPI_COMM_WORLD, 0, 0, &comm); + VRFY((mrc == MPI_SUCCESS), "MPI_Comm_split"); + + /* Initialize data array */ data = malloc(100 * 100 * sizeof(*data)); VRFY((data != NULL), "Data buffer initialized properly"); + /* Create a file */ fid = H5Fcreate("file", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); VRFY((fid >= 0), "H5Fcreate succeeded"); From 9df5e2b1bd1847cf93f82968369da2733507e679 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 14:07:03 -0500 Subject: [PATCH 15/25] Move changes to remote --- testpar/t_ph5basic.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index ff12ce9b1cb..36d85f9343e 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -200,26 +200,16 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; int *data = NULL; - - MPI_Comm comm; - int mrc; - int mpi_size, mpi_rank; - - herr_t ret; + int mpi_rank; + herr_t ret; if (VERBOSE_MED) printf("Verify get_fxpl_mpio correctly gets the data transfer mode" "set in the data transfer property list after a write\n"); - /* Set up MPI parameters */ - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + /* Set up MPI rank for VRFY macro */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - /* Create a new communicator that has the same processes as MPI_COMM_WORLD. - * Use MPI_Comm_split because it is simpler than MPI_Comm_create */ - mrc = MPI_Comm_split(MPI_COMM_WORLD, 0, 0, &comm); - VRFY((mrc == MPI_SUCCESS), "MPI_Comm_split"); - /* Initialize data array */ data = malloc(100 * 100 * sizeof(*data)); VRFY((data != NULL), "Data buffer initialized properly"); @@ -279,11 +269,6 @@ test_get_dxpl_mpio(void) /* Close everything */ free(data); - if (comm != MPI_COMM_WORLD) { - mrc = MPI_Comm_free(&comm); - VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free succeeded"); - } - ret = H5Pclose(dxpl_id); VRFY((ret >= 0), "H5Pclose succeeded"); From 5ebd05e1197f7fd324ab345a92dde2d7bdcafdc9 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 15:39:29 -0500 Subject: [PATCH 16/25] Move changes to remote --- testpar/t_ph5basic.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 36d85f9343e..f82d3119917 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -195,12 +195,15 @@ test_get_dxpl_mpio(void) hid_t fid = H5I_INVALID_HID; hid_t sid = H5I_INVALID_HID; hid_t did = H5I_INVALID_HID; + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; hid_t dxpl_id = H5I_INVALID_HID; H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; hsize_t i, j; int *data = NULL; int mpi_rank; + const char *filename; herr_t ret; if (VERBOSE_MED) @@ -210,12 +213,20 @@ test_get_dxpl_mpio(void) /* Set up MPI rank for VRFY macro */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + filename = (const char *)GetTestParameters(); + + /* Create parallel fapl */ + fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, FACC_MPIO); + VRFY((fapl >= 0), "Create_faccess_plist succeeded"); + fcpl = H5Pcreate(H5P_FILE_CREATE); + VRFY((fcpl >= 0), "H5Pcreate succeeded"); + /* Initialize data array */ data = malloc(100 * 100 * sizeof(*data)); VRFY((data != NULL), "Data buffer initialized properly"); /* Create a file */ - fid = H5Fcreate("file", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create a dataset */ From f906cdb02f320464d898a04ced635ead7a226f42 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 16:07:45 -0500 Subject: [PATCH 17/25] Move to remote --- testpar/t_ph5basic.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index f82d3119917..18dc69f6920 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -202,7 +202,7 @@ test_get_dxpl_mpio(void) hsize_t dims[2] = {100, 100}; hsize_t i, j; int *data = NULL; - int mpi_rank; + int mpi_rank, mpi_size; const char *filename; herr_t ret; @@ -212,21 +212,20 @@ test_get_dxpl_mpio(void) /* Set up MPI rank for VRFY macro */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); filename = (const char *)GetTestParameters(); /* Create parallel fapl */ fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, FACC_MPIO); - VRFY((fapl >= 0), "Create_faccess_plist succeeded"); - fcpl = H5Pcreate(H5P_FILE_CREATE); - VRFY((fcpl >= 0), "H5Pcreate succeeded"); + VRFY((fapl >= 0), "Fapl creation succeeded"); /* Initialize data array */ data = malloc(100 * 100 * sizeof(*data)); VRFY((data != NULL), "Data buffer initialized properly"); /* Create a file */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create a dataset */ @@ -280,6 +279,9 @@ test_get_dxpl_mpio(void) /* Close everything */ free(data); + ret = H5Pclose(fapl_id); + VRFY((ret >= 0), "H5Pclose succeeded"); + ret = H5Pclose(dxpl_id); VRFY((ret >= 0), "H5Pclose succeeded"); From 2c371628b1e87923e626f57a984d2ce7586dd31f Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 16:31:21 -0500 Subject: [PATCH 18/25] Move to remote --- testpar/t_ph5basic.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 18dc69f6920..fe4b1dde381 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -195,9 +195,8 @@ test_get_dxpl_mpio(void) hid_t fid = H5I_INVALID_HID; hid_t sid = H5I_INVALID_HID; hid_t did = H5I_INVALID_HID; - hid_t fcpl = H5I_INVALID_HID; hid_t fapl = H5I_INVALID_HID; - hid_t dxpl_id = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; hsize_t i, j; @@ -214,17 +213,16 @@ test_get_dxpl_mpio(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - filename = (const char *)GetTestParameters(); + /* Initialize data array */ + data = malloc(100 * 100 * sizeof(*data)); + VRFY((data != NULL), "Data buffer initialized properly"); /* Create parallel fapl */ fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, FACC_MPIO); VRFY((fapl >= 0), "Fapl creation succeeded"); - /* Initialize data array */ - data = malloc(100 * 100 * sizeof(*data)); - VRFY((data != NULL), "Data buffer initialized properly"); - - /* Create a file */ + /* Create a file */ + filename = (const char *)GetTestParameters(); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((fid >= 0), "H5Fcreate succeeded"); @@ -235,9 +233,9 @@ test_get_dxpl_mpio(void) VRFY((did >= 0), "H5Dcreate2 succeeded"); /* Use collective I/O access */ - dxpl_id = H5Pcreate(H5P_DATASET_XFER); - VRFY((dxpl_id >= 0), "H5Pcreate succeeded"); - ret = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE); + dxpl = H5Pcreate(H5P_DATASET_XFER); + VRFY((dxpl >= 0), "H5Pcreate succeeded"); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio set to collective succeeded"); /* Write some data */ @@ -249,17 +247,17 @@ test_get_dxpl_mpio(void) VRFY((ret >= 0), "H5Dwrite succeeded"); /* Check to make sure the property is still correct */ - ret = H5Pget_dxpl_mpio(dxpl_id, &xfer_mode); + ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); VRFY((xfer_mode != H5FD_MPIO_COLLECTIVE), "Xfer_mode retrieved" " successfully"); /* Check it does nothing on receiving NULL */ - ret = H5Pget_dxpl_mpio(dxpl_id, NULL); + ret = H5Pget_dxpl_mpio(dxpl, NULL); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded on NULL input"); /* Use independent I/O access */ - ret = H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_INDEPENDENT); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_INDEPENDENT); VRFY((ret >= 0), "H5Pset_dxpl_mpio set to independent succeeded"); /* Write some data */ @@ -267,11 +265,11 @@ test_get_dxpl_mpio(void) for (j = 0; j < dims[1]; j++) data[(i * 100) + j] = (int)(i + (j * j) + i); - ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data); + ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl, data); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Check to make sure the property is still correct */ - ret = H5Pget_dxpl_mpio(dxpl_id, &xfer_mode); + ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); VRFY((xfer_mode != H5FD_MPIO_INDEPENDENT), "Xfer_mode retrieved" " successfully"); @@ -279,10 +277,10 @@ test_get_dxpl_mpio(void) /* Close everything */ free(data); - ret = H5Pclose(fapl_id); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); - ret = H5Pclose(dxpl_id); + ret = H5Pclose(dxpl); VRFY((ret >= 0), "H5Pclose succeeded"); ret = H5Dclose(did); From 87968b204935a9c59480723b9e3f17fcd40f5afa Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:33:26 +0000 Subject: [PATCH 19/25] Committing clang-format changes --- testpar/t_ph5basic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index fe4b1dde381..03664003ce0 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -192,10 +192,10 @@ test_fapl_mpio_dup(void) void test_get_dxpl_mpio(void) { - hid_t fid = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t did = H5I_INVALID_HID; - hid_t fapl = H5I_INVALID_HID; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; hid_t dxpl = H5I_INVALID_HID; H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; @@ -221,9 +221,9 @@ test_get_dxpl_mpio(void) fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, FACC_MPIO); VRFY((fapl >= 0), "Fapl creation succeeded"); - /* Create a file */ + /* Create a file */ filename = (const char *)GetTestParameters(); - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create a dataset */ From a47c32ae65956f3a9affb792514e7a610e1f3431 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Tue, 31 Oct 2023 16:48:21 -0500 Subject: [PATCH 20/25] Move to remote --- testpar/t_ph5basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index fe4b1dde381..3291178162b 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -196,7 +196,7 @@ test_get_dxpl_mpio(void) hid_t sid = H5I_INVALID_HID; hid_t did = H5I_INVALID_HID; hid_t fapl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; hsize_t i, j; @@ -243,7 +243,7 @@ test_get_dxpl_mpio(void) for (j = 0; j < dims[1]; j++) data[(i * 100) + j] = (int)(i + (i * j) + j); - ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data); + ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl, data); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Check to make sure the property is still correct */ From 4cde2eca301528877189749992d00c47596ef74b Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:52:11 +0000 Subject: [PATCH 21/25] Committing clang-format changes --- testpar/t_ph5basic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 509d9fc6d8c..c0b441a6d9f 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -192,11 +192,11 @@ test_fapl_mpio_dup(void) void test_get_dxpl_mpio(void) { - hid_t fid = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t did = H5I_INVALID_HID; - hid_t fapl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; H5FD_mpio_xfer_t xfer_mode; hsize_t dims[2] = {100, 100}; hsize_t i, j; From fb2a018d0de990cd10e6dad44dd11692d1d0c3b9 Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Wed, 1 Nov 2023 14:53:16 -0500 Subject: [PATCH 22/25] Change test file to get test to work: --- testpar/t_ph5basic.c | 6 +++--- testpar/testphdf5.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 509d9fc6d8c..cbb8dc2bdf5 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -209,7 +209,7 @@ test_get_dxpl_mpio(void) printf("Verify get_fxpl_mpio correctly gets the data transfer mode" "set in the data transfer property list after a write\n"); - /* Set up MPI rank for VRFY macro */ + /* Set up MPI for VRFY macro */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -249,7 +249,7 @@ test_get_dxpl_mpio(void) /* Check to make sure the property is still correct */ ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); - VRFY((xfer_mode != H5FD_MPIO_COLLECTIVE), "Xfer_mode retrieved" + VRFY((xfer_mode == H5FD_MPIO_COLLECTIVE), "Xfer_mode retrieved" " successfully"); /* Check it does nothing on receiving NULL */ @@ -271,7 +271,7 @@ test_get_dxpl_mpio(void) /* Check to make sure the property is still correct */ ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); - VRFY((xfer_mode != H5FD_MPIO_INDEPENDENT), "Xfer_mode retrieved" + VRFY((xfer_mode == H5FD_MPIO_INDEPENDENT), "Xfer_mode retrieved" " successfully"); /* Close everything */ diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 64264cc87ab..7d584bfa413 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -351,7 +351,7 @@ main(int argc, char **argv) /* Tests are generally arranged from least to most complexity... */ AddTest("mpiodup", test_fapl_mpio_dup, NULL, "fapl_mpio duplicate", NULL); - AddTest("getdxplmpio", test_get_dxpl_mpio, NULL, "dxpl_mpio get", NULL); + AddTest("getdxplmpio", test_get_dxpl_mpio, NULL, "dxpl_mpio get", PARATESTFILE); AddTest("split", test_split_comm_access, NULL, "dataset using split communicators", PARATESTFILE); AddTest("h5oflusherror", test_oflush, NULL, "H5Oflush failure", PARATESTFILE); From c1f8065c96ba18bcf5f9d333200086bd37c5e43f Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Thu, 2 Nov 2023 16:03:07 -0500 Subject: [PATCH 23/25] Fixes for Jordan --- testpar/t_ph5basic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 15a236a0103..7e21e6ead65 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -181,7 +181,7 @@ test_fapl_mpio_dup(void) /*------------------------------------------------------------------------- * Function: test_get_dxpl_mpio * - * Purpose: Test that H5Pget_fxpl_mpio will properly return the data + * Purpose: Test that H5Pget_dxpl_mpio will properly return the data * transfer mode of collective and independent I/O access * after setting it and writing some data. * @@ -206,7 +206,7 @@ test_get_dxpl_mpio(void) herr_t ret; if (VERBOSE_MED) - printf("Verify get_fxpl_mpio correctly gets the data transfer mode" + printf("Verify get_dxpl_mpio correctly gets the data transfer mode" "set in the data transfer property list after a write\n"); /* Set up MPI for VRFY macro */ @@ -286,10 +286,10 @@ test_get_dxpl_mpio(void) ret = H5Dclose(did); VRFY((ret >= 0), "H5Dclose succeeded"); - ret = H5Sclose(sid) < 0; + ret = H5Sclose(sid); VRFY((ret >= 0), "H5Sclose succeeded"); - ret = H5Fclose(fid) < 0; + ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); } /* end test_get_dxpl_mpio() */ From bd8e8e1c6f767ba329af81b76245aa40a5f162df Mon Sep 17 00:00:00 2001 From: Glenn Song Date: Thu, 2 Nov 2023 16:58:38 -0500 Subject: [PATCH 24/25] Add in check after a read call --- testpar/t_ph5basic.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 7e21e6ead65..b3f27b21377 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -246,6 +246,16 @@ test_get_dxpl_mpio(void) ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl, data); VRFY((ret >= 0), "H5Dwrite succeeded"); + /* Check to make sure the property is still correct */ + ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); + VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); + VRFY((xfer_mode == H5FD_MPIO_COLLECTIVE), "Xfer_mode retrieved" + " successfully"); + + /* Read the data */ + ret = H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl, data); + VRFY((ret >=0), "H5Dread succeeded"); + /* Check to make sure the property is still correct */ ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); @@ -268,6 +278,16 @@ test_get_dxpl_mpio(void) ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl, data); VRFY((ret >= 0), "H5Dwrite succeeded"); + /* Check to make sure the property is still correct */ + ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); + VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); + VRFY((xfer_mode == H5FD_MPIO_INDEPENDENT), "Xfer_mode retrieved" + " successfully"); + + /* Read the data */ + ret = H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl, data); + VRFY((ret >=0), "H5Dread succeeded"); + /* Check to make sure the property is still correct */ ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); VRFY((ret >= 0), "H5Pget_dxpl_mpio succeeded"); From 41a726f9f8fabfb5c514986ee45fa935b431411e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:01:01 +0000 Subject: [PATCH 25/25] Committing clang-format changes --- testpar/t_ph5basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index b3f27b21377..7fdefeb3ee9 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -254,7 +254,7 @@ test_get_dxpl_mpio(void) /* Read the data */ ret = H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl, data); - VRFY((ret >=0), "H5Dread succeeded"); + VRFY((ret >= 0), "H5Dread succeeded"); /* Check to make sure the property is still correct */ ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode); @@ -286,7 +286,7 @@ test_get_dxpl_mpio(void) /* Read the data */ ret = H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl, data); - VRFY((ret >=0), "H5Dread succeeded"); + VRFY((ret >= 0), "H5Dread succeeded"); /* Check to make sure the property is still correct */ ret = H5Pget_dxpl_mpio(dxpl, &xfer_mode);