From b6a9404d0faeefdaeeb67ffc33f30389ac2dcba9 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 15 Feb 2024 10:19:52 -0600 Subject: included best practices of using coll. metadata APIs (#4018) --- HDF5Examples/C/H5PAR/ph5_dataset.c | 18 ++++++++++++++++++ HDF5Examples/C/H5PAR/ph5_file_create.c | 18 ++++++++++++++++++ HDF5Examples/C/H5PAR/ph5_filtered_writes.c | 18 ++++++++++++++---- HDF5Examples/C/H5PAR/ph5_filtered_writes_no_sel.c | 18 ++++++++++++++---- HDF5Examples/C/H5PAR/ph5_hyperslab_by_chunk.c | 18 ++++++++++++++++++ HDF5Examples/C/H5PAR/ph5_hyperslab_by_col.c | 18 ++++++++++++++++++ HDF5Examples/C/H5PAR/ph5_hyperslab_by_pattern.c | 18 ++++++++++++++++++ HDF5Examples/C/H5PAR/ph5_hyperslab_by_row.c | 18 ++++++++++++++++++ HDF5Examples/C/H5PAR/ph5example.c | 18 ++++++++++++++++++ 9 files changed, 154 insertions(+), 8 deletions(-) diff --git a/HDF5Examples/C/H5PAR/ph5_dataset.c b/HDF5Examples/C/H5PAR/ph5_dataset.c index 9b8e8a8..0c25fcc 100644 --- a/HDF5Examples/C/H5PAR/ph5_dataset.c +++ b/HDF5Examples/C/H5PAR/ph5_dataset.c @@ -54,6 +54,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(plist_id, comm, info); /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(plist_id, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(plist_id, true); + + /* * Create a new file collectively and release property list identifier. */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); diff --git a/HDF5Examples/C/H5PAR/ph5_file_create.c b/HDF5Examples/C/H5PAR/ph5_file_create.c index a3bd0a8..10938f2 100644 --- a/HDF5Examples/C/H5PAR/ph5_file_create.c +++ b/HDF5Examples/C/H5PAR/ph5_file_create.c @@ -37,6 +37,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(plist_id, comm, info); /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(plist_id, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(plist_id, true); + + /* * Create a new file collectively. */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); diff --git a/HDF5Examples/C/H5PAR/ph5_filtered_writes.c b/HDF5Examples/C/H5PAR/ph5_filtered_writes.c index 104704a..34ed2fb 100644 --- a/HDF5Examples/C/H5PAR/ph5_filtered_writes.c +++ b/HDF5Examples/C/H5PAR/ph5_filtered_writes.c @@ -377,14 +377,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(fapl_id, comm, info); /* - * OPTIONAL: Set collective metadata reads on FAPL to allow - * parallel writes to filtered datasets to perform - * better at scale. While not strictly necessary, - * this is generally recommended. + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows filtered datasets + * to perform better at scale, although it is not + * strictly necessary. */ H5Pset_all_coll_metadata_ops(fapl_id, true); /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows filtered datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(fapl_id, true); + + /* * OPTIONAL: Set the latest file format version for HDF5 in * order to gain access to different dataset chunk * index types and better data encoding methods. diff --git a/HDF5Examples/C/H5PAR/ph5_filtered_writes_no_sel.c b/HDF5Examples/C/H5PAR/ph5_filtered_writes_no_sel.c index a4d9e16..d4f171f 100644 --- a/HDF5Examples/C/H5PAR/ph5_filtered_writes_no_sel.c +++ b/HDF5Examples/C/H5PAR/ph5_filtered_writes_no_sel.c @@ -271,14 +271,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(fapl_id, comm, info); /* - * OPTIONAL: Set collective metadata reads on FAPL to allow - * parallel writes to filtered datasets to perform - * better at scale. While not strictly necessary, - * this is generally recommended. + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows filtered datasets + * to perform better at scale, although it is not + * strictly necessary. */ H5Pset_all_coll_metadata_ops(fapl_id, true); /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows filtered datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(fapl_id, true); + + /* * OPTIONAL: Set the latest file format version for HDF5 in * order to gain access to different dataset chunk * index types and better data encoding methods. diff --git a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_chunk.c b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_chunk.c index a255b96..e00a0ef 100644 --- a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_chunk.c +++ b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_chunk.c @@ -65,6 +65,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(plist_id, comm, info); /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(plist_id, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(plist_id, true); + + /* * Create a new file collectively and release property list identifier. */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); diff --git a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_col.c b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_col.c index b397fcf..49e5ce3 100644 --- a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_col.c +++ b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_col.c @@ -60,6 +60,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(plist_id, comm, info); /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(plist_id, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(plist_id, true); + + /* * Create a new file collectively and release property list identifier. */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); diff --git a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_pattern.c b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_pattern.c index 77f3bef..bec3a2f 100644 --- a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_pattern.c +++ b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_pattern.c @@ -65,6 +65,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(plist_id, comm, info); /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(plist_id, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(plist_id, true); + + /* * Create a new file collectively and release property list identifier. */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); diff --git a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_row.c b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_row.c index 5035786..1c08a32 100644 --- a/HDF5Examples/C/H5PAR/ph5_hyperslab_by_row.c +++ b/HDF5Examples/C/H5PAR/ph5_hyperslab_by_row.c @@ -49,6 +49,24 @@ main(int argc, char **argv) H5Pset_fapl_mpio(plist_id, comm, info); /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(plist_id, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(plist_id, true); + + /* * Create a new file collectively and release property list identifier. */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); diff --git a/HDF5Examples/C/H5PAR/ph5example.c b/HDF5Examples/C/H5PAR/ph5example.c index 5ec2cdc..37d5d68 100644 --- a/HDF5Examples/C/H5PAR/ph5example.c +++ b/HDF5Examples/C/H5PAR/ph5example.c @@ -269,6 +269,24 @@ phdf5writeInd(char *filename) assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); + /* + * OPTIONAL: It is generally recommended to set collective + * metadata reads on FAPL to perform metadata reads + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_all_coll_metadata_ops(acc_tpl1, true); + + /* + * OPTIONAL: It is generally recommended to set collective + * metadata writes on FAPL to perform metadata writes + * collectively, which usually allows datasets + * to perform better at scale, although it is not + * strictly necessary. + */ + H5Pset_coll_metadata_write(acc_tpl1, true); + /* create the file collectively */ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl1); assert(fid1 != FAIL); -- cgit v0.12