use mutex to avoid race condition when accessing thermo data during run

This commit is contained in:
Axel Kohlmeyer
2025-01-12 23:24:48 -05:00
parent a5c3305c42
commit 0aadc4cf46
6 changed files with 75 additions and 7 deletions

View File

@ -121,9 +121,9 @@ void Finish::end(int flag)
MPI_Allreduce(&cpu_loop,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
cpu_loop = tmp/nprocs;
if (time_loop > 0.0) cpu_loop = cpu_loop/time_loop*100.0;
output->thermo->footer();
if (me == 0) {
output->thermo->footer();
int ntasks = nprocs * nthreads;
utils::logmesg(lmp,"Loop time of {:.6g} on {} procs for {} steps with {} atoms\n\n",
time_loop,ntasks,update->nsteps,atom->natoms);