trigger computes only if next variable step or time based dump present

This commit is contained in:
Axel Kohlmeyer
2025-03-28 00:05:14 -04:00
parent 963083b2d5
commit 9ac09e839f

View File

@ -373,6 +373,7 @@ void Output::write(bigint ntimestep)
// can't remove an uneeded addstep from a compute, b/c don't know
// what other command may have added it
int mode_dump_any = 0; // any variable time or clearstep dump
if (next_dump_any == ntimestep) {
next_dump_any = next_time_dump_any = MAXBIGINT;
@ -397,12 +398,15 @@ void Output::write(bigint ntimestep)
modify->addstep_compute(next_dump[idump]);
}
if (mode_dump[idump] && (dump[idump]->clearstep || var_dump[idump]))
if (mode_dump[idump] && (dump[idump]->clearstep || var_dump[idump])) {
mode_dump_any = 1;
next_time_dump_any = MIN(next_time_dump_any,next_dump[idump]);
}
next_dump_any = MIN(next_dump_any,next_dump[idump]);
}
}
modify->addstep_compute(next_dump_any);
// trigger computes for any time based or variable step dumps
if (mode_dump_any) modify->addstep_compute(next_time_dump_any);
// next_restart does not force output on last step of run
// for toggle = 0, replace "*" with current timestep in restart filename