Update function names and in-source doc.

This commit is contained in:
Ye Luo 2017-08-16 15:03:26 -05:00
parent b4ab1c8a08
commit 02c69af978
3 changed files with 14 additions and 9 deletions

View File

@ -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<uint_type> 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<uint_type> vt, vt_tot, mt, mt_tot;

View File

@ -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

View File

@ -61,7 +61,10 @@ struct hdf_archive
std::stack<hid_t> 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