13 DdTimer::DdTimer(
int size)
25 for (
int i = 0; i < size_; i++) {
39 double current = MPI_Wtime();
40 times_[id] += current - previous_;
45 { time_ += MPI_Wtime() - begin_; }
50 int procs = communicator.Get_size();
52 for (
int i = 0; i < size_; i++) {
53 communicator.Allreduce(×_[i], &sum, 1, MPI::DOUBLE, MPI::SUM);
54 times_[i] = sum/double(procs);
56 communicator.Allreduce(&time_, &sum, 1, MPI::DOUBLE, MPI::SUM);
57 time_ = sum/double(procs);
62 {
return times_[id]; }
void reduce(MPI::Intracomm &communicator)
Upon return, times on every processor replaced by average over procs.
void stop()
Stop total time accumulation.
Parallel domain decomposition (DD) MD simulation.
void stamp(int id)
Mark end of interval id.
double time() const
Get total time since start time, average per processor.
void allocate(int capacity)
Allocate the underlying C array.
void clear()
Clear all time statistics.
void start()
Clear statistics, mark a start time.