typedef struct gmx_global_stat *gmx_global_stat_t;
+/*! /brief Manages measuring wall clock times for simulations */
typedef struct {
- double real;
+ double real; //!< Seconds since the epoch recorded at the start of the simulation
+ // TODO rename real
#ifdef GMX_CRAY_XT3
- double proc;
+ double proc; //!< Seconds since the start start of the simulation
#else
- clock_t proc;
+ clock_t proc; //!< Seconds since the start start of the simulation
#endif
- double realtime;
- double proctime;
- double time_per_step;
- double last;
- gmx_large_int_t nsteps_done;
+ double realtime; //!< Total seconds elapsed over the simulation
+ // TODO rename realtime
+ double proctime; //!< Total seconds elapsed over the simulation
+ // TODO eliminate use of proc and proctime - also eliminates
+ // dependency on clock() and dclock()
+ double time_per_step; //!< Local variable TODO kill this
+ double last; //!< Local variable TODO kill this
+ gmx_large_int_t nsteps_done; //!< Used by integrators to report the amount of work they did
} gmx_runtime_t;
struct timeval t;
double seconds;
+ // TODO later: gettimeofday() is deprecated by POSIX. We could use
+ // clock_gettime in POSIX (which also offers nanosecond resolution
+ // if the hardware supports it), but that requires linking with
+ // -lrt. Maybe a better option will come along before we have to
+ // really change from gettimeofday().
gettimeofday(&t, NULL);
seconds = (double) t.tv_sec + 1e-6*(double)t.tv_usec;
#endif
}
-
+// TODO Remove this. gmx_gettime returns double, so this is now useless
#define difftime(end, start) ((double)(end)-(double)(start))
void print_time(FILE *out, gmx_runtime_t *runtime, gmx_large_int_t step,
fflush(out);
}
+// TODO eliminate this
#ifdef NO_CLOCK
#define clock() -1
#endif
gmx_pmeonly(*pmedata, cr, nrnb, wcycle, &runtime, ewaldcoeff, inputrec);
}
+ // TODO remove this, nobody reads runtime.real or runtime.proc after
+ // this point - runtime_end() has already been called!
if (EI_DYNAMICS(inputrec->eI) || EI_TPI(inputrec->eI))
{
/* Some timing stats */