add performance counters to ion / poisson solvers
This commit is contained in:
parent
be8f508b64
commit
1c903a3380
@ -1248,6 +1248,7 @@ void ScaLBL_IonModel::Run(double *Velocity, double *ElectricField) {
|
|||||||
//ScaLBL_Comm->Barrier(); comm.barrier();
|
//ScaLBL_Comm->Barrier(); comm.barrier();
|
||||||
//auto t1 = std::chrono::system_clock::now();
|
//auto t1 = std::chrono::system_clock::now();
|
||||||
|
|
||||||
|
auto t1 = std::chrono::system_clock::now();
|
||||||
for (size_t ic = 0; ic < number_ion_species; ic++) {
|
for (size_t ic = 0; ic < number_ion_species; ic++) {
|
||||||
timestep = 0;
|
timestep = 0;
|
||||||
while (timestep < timestepMax[ic]) {
|
while (timestep < timestepMax[ic]) {
|
||||||
@ -1430,19 +1431,25 @@ void ScaLBL_IonModel::Run(double *Velocity, double *ElectricField) {
|
|||||||
ScaLBL_Comm->LastExterior(), Np);
|
ScaLBL_Comm->LastExterior(), Np);
|
||||||
}
|
}
|
||||||
//************************************************************************/
|
//************************************************************************/
|
||||||
//if (rank==0) printf("-------------------------------------------------------------------\n");
|
if (rank == 0)
|
||||||
//// Compute the walltime per timestep
|
printf("---------------------------------------------------------------"
|
||||||
//auto t2 = std::chrono::system_clock::now();
|
"----\n");
|
||||||
//double cputime = std::chrono::duration<double>( t2 - t1 ).count() / timestep;
|
// Compute the walltime per timestep
|
||||||
//// Performance obtained from each node
|
auto t2 = std::chrono::system_clock::now();
|
||||||
//double MLUPS = double(Np)/cputime/1000000;
|
double cputime = std::chrono::duration<double>(t2 - t1).count() / timestep;
|
||||||
|
// Performance obtained from each node
|
||||||
//if (rank==0) printf("********************************************************\n");
|
double MLUPS = double(Np) / cputime / 1000000;
|
||||||
//if (rank==0) printf("CPU time = %f \n", cputime);
|
if (rank == 0)
|
||||||
//if (rank==0) printf("Lattice update rate (per core)= %f MLUPS \n", MLUPS);
|
printf("********************************************************\n");
|
||||||
//MLUPS *= nprocs;
|
if (rank == 0)
|
||||||
//if (rank==0) printf("Lattice update rate (total)= %f MLUPS \n", MLUPS);
|
printf("CPU time = %f \n", cputime);
|
||||||
//if (rank==0) printf("********************************************************\n");
|
if (rank == 0)
|
||||||
|
printf("Lattice update rate (per core)= %f MLUPS \n", MLUPS);
|
||||||
|
MLUPS *= nprocs;
|
||||||
|
if (rank == 0)
|
||||||
|
printf("Lattice update rate (total)= %f MLUPS \n", MLUPS);
|
||||||
|
if (rank == 0)
|
||||||
|
printf("********************************************************\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScaLBL_IonModel::RunMembrane(double *Velocity, double *ElectricField, double *Psi) {
|
void ScaLBL_IonModel::RunMembrane(double *Velocity, double *ElectricField, double *Psi) {
|
||||||
|
@ -769,6 +769,7 @@ void ScaLBL_Poisson::Run(double *ChargeDensity, bool UseSlippingVelBC, int times
|
|||||||
host_Error = new double [Np];
|
host_Error = new double [Np];
|
||||||
|
|
||||||
timestep=0;
|
timestep=0;
|
||||||
|
auto t1 = std::chrono::system_clock::now();
|
||||||
while (timestep < timestepMax && error > tolerance) {
|
while (timestep < timestepMax && error > tolerance) {
|
||||||
//************************************************************************/
|
//************************************************************************/
|
||||||
// *************ODD TIMESTEP*************//
|
// *************ODD TIMESTEP*************//
|
||||||
@ -809,7 +810,29 @@ void ScaLBL_Poisson::Run(double *ChargeDensity, bool UseSlippingVelBC, int times
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rank == 0)
|
||||||
|
printf("---------------------------------------------------------------"
|
||||||
|
"----\n");
|
||||||
|
// Compute the walltime per timestep
|
||||||
|
auto t2 = std::chrono::system_clock::now();
|
||||||
|
double cputime = std::chrono::duration<double>(t2 - t1).count() / timestep;
|
||||||
|
// Performance obtained from each node
|
||||||
|
double MLUPS = double(Np) / cputime / 1000000;
|
||||||
|
|
||||||
|
if (rank == 0)
|
||||||
|
printf("********************************************************\n");
|
||||||
|
if (rank == 0)
|
||||||
|
printf("CPU time = %f \n", cputime);
|
||||||
|
if (rank == 0)
|
||||||
|
printf("Lattice update rate (per core)= %f MLUPS \n", MLUPS);
|
||||||
|
MLUPS *= nprocs;
|
||||||
|
if (rank == 0)
|
||||||
|
printf("Lattice update rate (total)= %f MLUPS \n", MLUPS);
|
||||||
|
if (rank == 0)
|
||||||
|
printf("********************************************************\n");
|
||||||
}
|
}
|
||||||
|
//************************************************************************/
|
||||||
|
|
||||||
if(WriteLog==true){
|
if(WriteLog==true){
|
||||||
getConvergenceLog(timestep,error);
|
getConvergenceLog(timestep,error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user