make synchronization for timers optional. only enable with "timer sync"

This commit is contained in:
Axel Kohlmeyer
2023-01-24 21:15:37 -05:00
parent 40c8fcb03a
commit dec3afe595
5 changed files with 16 additions and 11 deletions

View File

@ -22,6 +22,7 @@
#include "memory.h"
#include "neighbor.h"
#include "remap_wrap.h"
#include "timer.h"
#include <cmath>
#include <cstring>
@ -328,7 +329,7 @@ FFT_SCALAR *AmoebaConvolution::pre_convolution_3d()
double time0,time1;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
// perform forward FFT
@ -393,7 +394,7 @@ FFT_SCALAR *AmoebaConvolution::pre_convolution_4d()
double time0,time1;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
// perform forward FFT
@ -443,7 +444,7 @@ void *AmoebaConvolution::post_convolution_3d()
double time0,time1;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
fft2->compute(cfft,cfft,FFT3d::BACKWARD);
@ -494,7 +495,7 @@ void *AmoebaConvolution::post_convolution_4d()
double time0,time1;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
fft2->compute(cfft,cfft,FFT3d::BACKWARD);

View File

@ -24,6 +24,7 @@
#include "math_special.h"
#include "my_page.h"
#include "neigh_list.h"
#include "timer.h"
#include <cmath>
@ -545,7 +546,7 @@ void PairAmoeba::ufield0c(double **field, double **fieldp)
}
double time0, time1, time2;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
// get the real space portion of the mutual field
@ -795,7 +796,7 @@ void PairAmoeba::dfield0c(double **field, double **fieldp)
// get the reciprocal space part of the permanent field
double time0, time1, time2;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
if (polar_kspace_flag) udirect1(field);
@ -870,7 +871,7 @@ void PairAmoeba::umutual1(double **field, double **fieldp)
// map 2 values to grid
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
grid_uind(fuind,fuinp,gridpre);
@ -915,7 +916,7 @@ void PairAmoeba::umutual1(double **field, double **fieldp)
// get potential
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
fphi_uind(gridpost,fdip_phi1,fdip_phi2,fdip_sum_phi);

View File

@ -21,6 +21,7 @@
#include "math_const.h"
#include "math_special.h"
#include "neigh_list.h"
#include "timer.h"
#include <cmath>
@ -80,7 +81,7 @@ void PairAmoeba::multipole()
felec = electric / am_dielectric;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
// compute the real space part of the Ewald summation

View File

@ -21,6 +21,7 @@
#include "math_const.h"
#include "math_special.h"
#include "neigh_list.h"
#include "timer.h"
#include <cmath>
#include <cstring>
@ -78,7 +79,7 @@ void PairAmoeba::polar()
// compute the real space part of the dipole interactions
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
if (polar_rspace_flag) polar_real();

View File

@ -29,6 +29,7 @@
#include "my_page.h"
#include "neigh_list.h"
#include "neighbor.h"
#include "timer.h"
#include "update.h"
#include <cmath>
@ -371,7 +372,7 @@ void PairAmoeba::compute(int eflag, int vflag)
double time0,time1,time2,time3,time4,time5,time6,time7,time8;
MPI_Barrier(world);
if (timer->has_sync()) MPI_Barrier(world);
time0 = platform::walltime();
// if reneighboring step: