*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/essentialdynamics/edsam.h"
#include "gromacs/ewald/pme.h"
#include "gromacs/gmxlib/chargegroup.h"
+#include "gromacs/gmxlib/md_logging.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/gmxlib/nonbonded/nb_free_energy.h"
elapsed_time_over_all_threads,
elapsed_time_over_all_threads_over_all_ranks;
+ if (!walltime_accounting_get_valid_finish(walltime_accounting))
+ {
+ md_print_warn(cr, fplog,
+ "Simulation ended prematurely, no performance report will be written.");
+ return;
+ }
+
if (cr->nnodes > 1)
{
snew(nrnb_tot, 1);
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
int numOpenMPThreads;
//! Set by integrators to report the amount of work they did
gmx_int64_t nsteps_done;
+ //! Whether the simulation has finished in a way valid for walltime reporting.
+ bool isValidFinish;
} t_gmx_walltime_accounting;
/*! \brief Calls system timing routines (e.g. clock_gettime) to get
walltime_accounting->elapsed_time = 0;
walltime_accounting->nsteps_done = 0;
walltime_accounting->numOpenMPThreads = numOpenMPThreads;
+ walltime_accounting->isValidFinish = false;
return walltime_accounting;
}
#endif
}
+void
+walltime_accounting_set_valid_finish(gmx_walltime_accounting_t walltime_accounting)
+{
+ walltime_accounting->isValidFinish = true;
+}
+
+//! Return whether the simulation finished in a way valid for reporting walltime.
+bool
+walltime_accounting_get_valid_finish(const gmx_walltime_accounting_t walltime_accounting)
+{
+ return walltime_accounting->isValidFinish;
+}
+
static double
gmx_gettime_per_thread()
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t walltime_accounting,
gmx_int64_t nsteps_done);
+//! Record that the simulation finished in a way valid for reporting walltime.
+void
+walltime_accounting_set_valid_finish(gmx_walltime_accounting_t walltime_accounting);
+
+//! Return whether the simulation finished in a way valid for reporting walltime.
+bool
+walltime_accounting_get_valid_finish(const gmx_walltime_accounting_t walltime_accounting);
+
/*! \brief
* Calls system timing routines (e.g. clock_gettime) to get the (fractional)
* number of seconds elapsed since the epoch.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
IMD_finalize(ir->bIMD, ir->imd);
walltime_accounting_set_nsteps_done(walltime_accounting, step_rel);
+ if (step_rel >= wcycle_get_reset_counters(wcycle) &&
+ signals[eglsRESETCOUNTERS].set == 0 &&
+ !bResetCountersHalfMaxH)
+ {
+ walltime_accounting_set_valid_finish(walltime_accounting);
+ }
return 0;
}