From 02c69af978f34cf3cd472c3c0328b10a908245fe Mon Sep 17 00:00:00 2001 From: Ye Luo Date: Wed, 16 Aug 2017 15:03:26 -0500 Subject: [PATCH] Update function names and in-source doc. --- src/OhmmsApp/RandomNumberControl.cpp | 8 ++++---- src/OhmmsApp/RandomNumberControl.h | 10 ++++++---- src/io/hdf_archive.h | 5 ++++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/OhmmsApp/RandomNumberControl.cpp b/src/OhmmsApp/RandomNumberControl.cpp index 4e748e392..dd2a49f7c 100755 --- a/src/OhmmsApp/RandomNumberControl.cpp +++ b/src/OhmmsApp/RandomNumberControl.cpp @@ -384,7 +384,7 @@ void RandomNumberControl::read(const std::string& fname, Communicate* comm) if(hin.is_parallel()) read_parallel(hin, comm); else - read_scatter(hin, comm); + read_rank_0(hin, comm); } //switch between write functions @@ -396,7 +396,7 @@ void RandomNumberControl::write(const std::string& fname, Communicate* comm) if(hout.is_parallel()) write_parallel(hout, comm); else - write_scatter(hout, comm); + write_rank_0(hout, comm); } //Parallel read @@ -491,7 +491,7 @@ void RandomNumberControl::write_parallel(hdf_archive& hout, Communicate* comm) } //Scatter read -void RandomNumberControl::read_scatter(hdf_archive& hin, Communicate* comm) +void RandomNumberControl::read_rank_0(hdf_archive& hin, Communicate* comm) { int nthreads = omp_get_max_threads(); std::vector vt, vt_tot, mt, mt_tot; @@ -560,7 +560,7 @@ void RandomNumberControl::read_scatter(hdf_archive& hin, Communicate* comm) } //scatter write -void RandomNumberControl::write_scatter(hdf_archive& hout, Communicate* comm) +void RandomNumberControl::write_rank_0(hdf_archive& hout, Communicate* comm) { int nthreads = omp_get_max_threads(); std::vector vt, vt_tot, mt, mt_tot; diff --git a/src/OhmmsApp/RandomNumberControl.h b/src/OhmmsApp/RandomNumberControl.h index d25d6ecaf..64139c779 100755 --- a/src/OhmmsApp/RandomNumberControl.h +++ b/src/OhmmsApp/RandomNumberControl.h @@ -75,16 +75,18 @@ public: * @param comm communicator so that everyone writes its own data */ static void write_parallel(hdf_archive& hout, Communicate* comm); - /** read random state from a hdf file serially + /** rank 0 reads random states from a hdf file + * and distributes them to all the other ranks * @param hdf_archive set to serial * @param comm communicator so that everyone reads its own data */ - static void read_scatter(hdf_archive& hin, Communicate* comm); - /** write random state to a hdf file serially + static void read_rank_0(hdf_archive& hin, Communicate* comm); + /** rank 0 gathers the random states from all the other ranks + * and write them to a hdf file * @param hin hdf_archive object set to serial * @param comm communicator so that everyone writes its own data */ - static void write_scatter(hdf_archive& hout, Communicate* comm); + static void write_rank_0(hdf_archive& hout, Communicate* comm); /** read random state from a xml file * @param fname file name * @param comm communicator so that everyone reads its own data diff --git a/src/io/hdf_archive.h b/src/io/hdf_archive.h index 1516b4d4b..bf6116b45 100644 --- a/src/io/hdf_archive.h +++ b/src/io/hdf_archive.h @@ -61,7 +61,10 @@ struct hdf_archive std::stack group_id; /** constructor * @param c communicator - * @param use_collective turn on/off collective + * @param request_pio turns on parallel I/O, + * if ture and PHDF5 is available, hdf_archive is in parallel collective IO mode + * if ture and PHDF5 is not available, hdf_archive is in master-only IO mode + * if false, hdf_archive is in independent IO mode */ hdf_archive(Communicate* c=0, bool request_pio=false); ///destructor