summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-08-01 16:18:18 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-08-01 16:18:18 (GMT)
commit1ae6daaa807f2bfd63076215950d9c412bfa08d7 (patch)
treed60f5aa4158d275f953561b47089add1ea76ecd2 /testpar
parent0a64f3e8106a1ced78ae7c4a6744b3509d7ca0fc (diff)
downloadhdf5-1ae6daaa807f2bfd63076215950d9c412bfa08d7.zip
hdf5-1ae6daaa807f2bfd63076215950d9c412bfa08d7.tar.gz
hdf5-1ae6daaa807f2bfd63076215950d9c412bfa08d7.tar.bz2
Sync with develop
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_2Gio.c87
-rw-r--r--testpar/t_cache.c4
-rw-r--r--testpar/t_init_term.c2
-rw-r--r--testpar/t_pflush2.c4
-rw-r--r--testpar/t_prestart.c2
-rw-r--r--testpar/t_pshutdown.c2
-rw-r--r--testpar/t_span_tree.c6
7 files changed, 78 insertions, 29 deletions
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index 41ecf86..54ea546 100644
--- a/testpar/t_2Gio.c
+++ b/testpar/t_2Gio.c
@@ -1,5 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -158,6 +159,9 @@ parse_options(int argc, char **argv)
}
paraprefix = *argv;
break;
+ case 'i': /* Collective MPI-IO access with independent IO */
+ dxfer_coll_type = DXFER_INDEPENDENT_IO;
+ break;
case '2': /* Use the split-file driver with MPIO access */
/* Can use $HDF5_METAPREFIX to define the */
/* meta-file-prefix. */
@@ -257,15 +261,38 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
if (l_facc_type == FACC_DEFAULT)
return (ret_pl);
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(ret_pl, comm, info);
- VRFY((ret >= 0), "");
- ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE);
- VRFY((ret >= 0), "");
- ret = H5Pset_coll_metadata_write(ret_pl, TRUE);
- VRFY((ret >= 0), "");
+ if (l_facc_type == FACC_MPIO){
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(ret_pl, comm, info);
+ VRFY((ret >= 0), "");
+ ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE);
+ VRFY((ret >= 0), "");
+ ret = H5Pset_coll_metadata_write(ret_pl, TRUE);
+ VRFY((ret >= 0), "");
+ return(ret_pl);
+ }
+
+ if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((mpio_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
+ VRFY((ret >= 0), "");
+
+ /* setup file access template */
+ ret_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((ret_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
+ H5Pclose(mpio_pl);
+ return(ret_pl);
+ }
- return(ret_pl);
+ /* unknown file access types */
+ return (ret_pl);
}
@@ -525,34 +552,37 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
#define H5FILE_NAME "hugefile.h5"
#define DATASETNAME "dataset"
-static int MpioTest2G( MPI_Comm comm, int mpi_rank )
+static int MpioTest2G( MPI_Comm comm )
{
/*
* HDF5 APIs definitions
*/
herr_t status;
- hid_t dcpl_id;
- hid_t filedataspace;
- hid_t memorydataspace;
hid_t file_id, dset_id; /* file and dataset identifiers */
hid_t plist_id; /* property list identifier */
hid_t filespace; /* file and memory dataspace identifiers */
int *data; /* pointer to data buffer to write */
- hsize_t shape[3] = {1024, 1024, 1152};
- size_t data_size, data_size_bytes, slice_per_process = shape[0]/2;
- size_t tot_size_bytes = sizeof(int);
- hsize_t chunk[3] = {4, shape[1], shape[2]};
- hsize_t h5_counts[3] = { slice_per_process, shape[1], shape[2] };
- hsize_t h5_offsets[3] = { (size_t)mpi_rank * slice_per_process, 0, 0};
+ size_t tot_size_bytes;
+ hid_t dcpl_id;
+ hid_t memorydataspace;
+ hid_t filedataspace;
+ size_t slice_per_process;
+ size_t data_size;
+ size_t data_size_bytes;
+ hsize_t chunk[3];
+ hsize_t h5_counts[3];
+ hsize_t h5_offsets[3];
+ hsize_t shape[3] = {1024, 1024, 1152};
/*
* MPI variables
*/
- int mpi_size;
+ int mpi_size, mpi_rank;
MPI_Info info = MPI_INFO_NULL;
MPI_Comm_size(comm, &mpi_size);
+ MPI_Comm_rank(comm, &mpi_rank);
if(mpi_rank == 0) {
HDprintf("Using %d process on dataset shape [%llu, %llu, %llu]\n",
@@ -578,6 +608,7 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank )
/*
* Create the dataspace for the dataset.
*/
+ tot_size_bytes = sizeof(int);
for (int i = 0; i < 3; i++) {
tot_size_bytes *= shape[i];
}
@@ -592,6 +623,9 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank )
*/
dcpl_id = H5Pcreate (H5P_DATASET_CREATE);
VRFY((dcpl_id >= 0), "H5P_DATASET_CREATE");
+ chunk[0] = 4;
+ chunk[1] = shape[1];
+ chunk[2] = shape[2];
status = H5Pset_chunk(dcpl_id, 3, chunk);
VRFY((status >= 0), "H5Pset_chunk succeeded");
@@ -601,7 +635,7 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank )
dset_id = H5Dcreate2(file_id, DATASETNAME,
H5T_NATIVE_INT, filespace,
H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
- VRFY((dset_id >= 0), "H5Dcreate succeeded");
+ VRFY((dset_id >= 0), "H5Dcreate2 succeeded");
H5Sclose(filespace);
/*
@@ -612,6 +646,7 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank )
status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
VRFY((status >= 0), "");
+ H5_CHECKED_ASSIGN(slice_per_process, size_t, (shape[0] + (hsize_t)mpi_size - 1) / (hsize_t)mpi_size, hsize_t);
data_size = slice_per_process * shape[1] * shape[2];
data_size_bytes = sizeof(int) * data_size;
data = HDmalloc(data_size_bytes);
@@ -621,6 +656,12 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank )
data[i] = mpi_rank;
}
+ h5_counts[0] = slice_per_process;
+ h5_counts[1] = shape[1];
+ h5_counts[2] = shape[2];
+ h5_offsets[0] = (size_t)mpi_rank * slice_per_process;
+ h5_offsets[1] = 0;
+ h5_offsets[2] = 0;
filedataspace = H5Screate_simple(3, shape, NULL);
VRFY((filedataspace >= 0), "H5Screate_simple succeeded");
@@ -651,7 +692,6 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank )
free(data);
HDprintf("Proc %d - MpioTest2G test succeeded\n", mpi_rank, data_size_bytes);
- HDfflush(stdout);
if (mpi_rank == 0)
HDremove(FILENAME[1]);
@@ -4871,6 +4911,9 @@ main(int argc, char **argv)
h5_show_hostname();
}
+ if (H5dont_atexit() < 0){
+ HDprintf("Failed to turn off atexit processing. Continue.\n");
+ };
H5open();
/* Set the internal transition size to allow use of derived datatypes
* without having to actually read or write large datasets (>2GB).
@@ -4934,7 +4977,7 @@ main(int argc, char **argv)
express_test = GetTestExpress();
if ((express_test == 0) && (mpi_rank < 2)) {
- MpioTest2G(test_comm, mpi_rank);
+ MpioTest2G(test_comm);
}
MPI_Barrier(MPI_COMM_WORLD);
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 09d2ecc..954071d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -4671,7 +4671,7 @@ verify_entry_reads(haddr_t addr,
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_reads != expected_entry_reads ) {
@@ -4778,7 +4778,7 @@ verify_entry_writes(haddr_t addr,
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_writes != expected_entry_writes ) {
diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c
index 537e5fa..0e40fe4 100644
--- a/testpar/t_init_term.c
+++ b/testpar/t_init_term.c
@@ -65,7 +65,7 @@ main (int argc, char **argv)
if(MAINPROCESS) {
if(0 == nerrors)
- PASSED()
+ PASSED();
else
H5_FAILED()
}
diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c
index f58e5a5..f4589c8 100644
--- a/testpar/t_pflush2.c
+++ b/testpar/t_pflush2.c
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
goto error;
}
else if(mpi_rank == 0) {
- PASSED()
+ PASSED();
}
/* Check the case where the file was not flushed. This should give an error
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
h5_fixname(FILENAME[1], fapl_id2, name, sizeof(name));
if(check_test_file(name, fapl_id2)) {
if(mpi_rank == 0)
- PASSED()
+ PASSED();
}
else {
H5_FAILED()
diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c
index 831f1a2..da6bbe0 100644
--- a/testpar/t_prestart.c
+++ b/testpar/t_prestart.c
@@ -128,7 +128,7 @@ main (int argc, char **argv)
if(MAINPROCESS) {
if(0 == nerrors)
- PASSED()
+ PASSED();
else
H5_FAILED()
}
diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c
index 731c719..6a35fb2 100644
--- a/testpar/t_pshutdown.c
+++ b/testpar/t_pshutdown.c
@@ -116,7 +116,7 @@ main (int argc, char **argv)
if(MAINPROCESS) {
if(0 == nerrors)
- PASSED()
+ PASSED();
else
H5_FAILED()
}
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index fe8a618..8d2b61c 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -867,6 +867,12 @@ coll_read_test(void)
VRFY((ret >= 0),"H5D contiguous irregular collective read succeed");
/*
+ * Free read buffers.
+ */
+ HDfree(matrix_out);
+ HDfree(matrix_out1);
+
+ /*
* Close memory file and memory dataspaces.
*/
ret = H5Sclose(mspaceid);