update Timer::force_timeout() to trigger at next loop iteration

This commit is contained in:
Axel Kohlmeyer
2016-10-12 07:26:03 -04:00
parent c24bf512f3
commit f8a26dd158
2 changed files with 14 additions and 2 deletions

View File

@ -98,6 +98,7 @@ Timer::Timer(LAMMPS *lmp) : Pointers(lmp)
_timeout = -1.0;
_checkfreq = 10;
_nextcheck = -1;
_laststep = -1;
this->_stamp(RESET);
}
@ -215,6 +216,7 @@ void Timer::set_wall(enum ttype which, double newtime)
void Timer::init_timeout()
{
_laststep = -1;
if (_timeout < 0)
_nextcheck = -1;
else
@ -247,6 +249,14 @@ void Timer::print_timeout(FILE *fp)
/* ---------------------------------------------------------------------- */
void Timer::force_timeout()
{
_timeout = 0.0;
_nextcheck = _laststep + 1;
}
/* ---------------------------------------------------------------------- */
bool Timer::_check_timeout()
{
double walltime = MPI_Wtime() - timeout_start;