apply new logmesg() overload to a bunch of cases.

This commit is contained in:
Axel Kohlmeyer
2021-04-21 22:53:41 -04:00
parent 0cf1252f1f
commit d2cdb318ab
42 changed files with 259 additions and 297 deletions

View File

@ -647,9 +647,8 @@ void Replicate::command(int narg, char **arg)
MPI_Reduce(&num_replicas_added, &sum, 1, MPI_INT, MPI_SUM, 0, world);
double avg = (double) sum / nprocs;
if (me == 0)
utils::logmesg(lmp,fmt::format(" average # of replicas added to proc ="
" {:.2f} out of {} ({:.2f}%)\n",
avg,nx*ny*nz,avg/(nx*ny*nz)*100.0));
utils::logmesg(lmp," average # of replicas added to proc = {:.2f} out "
"of {} ({:.2f}%)\n",avg,nx*ny*nz,avg/(nx*ny*nz)*100.0);
} else {
for (int iproc = 0; iproc < nprocs; iproc++) {
@ -753,7 +752,7 @@ void Replicate::command(int narg, char **arg)
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
utils::logmesg(lmp,fmt::format(" {} atoms\n",natoms));
utils::logmesg(lmp," {} atoms\n",natoms);
}
if (natoms != atom->natoms)
@ -763,16 +762,16 @@ void Replicate::command(int narg, char **arg)
const char *molstyle = "";
if (atom->molecular == Atom::TEMPLATE) molstyle = "template ";
if (atom->nbonds) {
utils::logmesg(lmp,fmt::format(" {} {}bonds\n",atom->nbonds,molstyle));
utils::logmesg(lmp," {} {}bonds\n",atom->nbonds,molstyle);
}
if (atom->nangles) {
utils::logmesg(lmp,fmt::format(" {} {}angles\n",atom->nangles,molstyle));
utils::logmesg(lmp," {} {}angles\n",atom->nangles,molstyle);
}
if (atom->ndihedrals) {
utils::logmesg(lmp,fmt::format(" {} {}dihedrals\n",atom->ndihedrals,molstyle));
utils::logmesg(lmp," {} {}dihedrals\n",atom->ndihedrals,molstyle);
}
if (atom->nimpropers) {
utils::logmesg(lmp,fmt::format(" {} {}impropers\n",atom->nimpropers,molstyle));
utils::logmesg(lmp," {} {}impropers\n",atom->nimpropers,molstyle);
}
}
@ -799,6 +798,5 @@ void Replicate::command(int narg, char **arg)
MPI_Barrier(world);
if (me == 0)
utils::logmesg(lmp,fmt::format(" replicate CPU = {:.3f} seconds\n",
MPI_Wtime()-time1));
utils::logmesg(lmp," replicate CPU = {:.3f} seconds\n",MPI_Wtime()-time1);
}