switch to using wall time
This commit is contained in:
@ -425,15 +425,15 @@ python-style variable can be used in place of an equal-style variable
|
||||
anywhere in an input script, e.g. as an argument to another command
|
||||
that allows for equal-style variables.
|
||||
|
||||
For the *timer* style no additional argument is specified. The value
|
||||
of the variable is set by querying the current elapsed CPU time of the
|
||||
simulation. This is done at the point in time the variable is defined
|
||||
in the input script. If a second timer-style variable is also
|
||||
defined, then a simple formula can be used to calculate the elapsed
|
||||
time between the two timers, as in the example above. As mentioned
|
||||
above, timer-style variables can be redefined elsewhere in the input
|
||||
script, so the same pair of variables can be used in a loop or to time
|
||||
a series of operations.
|
||||
For the *timer* style no additional argument is specified. The value of
|
||||
the variable is set by querying the current elapsed wall time of the
|
||||
simulation. This is done at the point in time when the variable is
|
||||
defined in the input script. If a second timer-style variable is also
|
||||
defined, then a simple formula can be used to calculate the elapsed time
|
||||
between the two timers, as in the example at the top of this manual
|
||||
entry. As mentioned above, timer-style variables can be redefined
|
||||
elsewhere in the input script, so the same pair of variables can be used
|
||||
in a loop or to time a series of operations.
|
||||
|
||||
For the *internal* style a numeric value is provided. This value will
|
||||
be assigned to the variable until a LAMMPS command sets it to a new
|
||||
|
||||
@ -501,10 +501,10 @@ void Variable::set(int narg, char **arg)
|
||||
}
|
||||
|
||||
// TIMER
|
||||
// stores current MPI_Wtime() as a string
|
||||
// stores current walltime as a timestamp in seconds
|
||||
// replace pre-existing var if also style TIMER (allows reset with current time)
|
||||
// num = 1, for string representation of dvalue, set by retrieve()
|
||||
// dvalue = numeric initialization via platform::cputime()
|
||||
// dvalue = numeric initialization via platform::walltime()
|
||||
|
||||
} else if (strcmp(arg[1],"timer") == 0) {
|
||||
if (narg != 2) error->all(FLERR,"Illegal variable command");
|
||||
@ -512,7 +512,7 @@ void Variable::set(int narg, char **arg)
|
||||
if (ivar >= 0) {
|
||||
if (style[ivar] != TIMER)
|
||||
error->all(FLERR,"Cannot redefine variable as a different style");
|
||||
dvalue[ivar] = platform::cputime();
|
||||
dvalue[ivar] = platform::walltime();
|
||||
replaceflag = 1;
|
||||
} else {
|
||||
if (nvar == maxvar) grow();
|
||||
@ -522,7 +522,7 @@ void Variable::set(int narg, char **arg)
|
||||
pad[nvar] = 0;
|
||||
data[nvar] = new char*[num[nvar]];
|
||||
data[nvar][0] = new char[VALUELENGTH];
|
||||
dvalue[nvar] = platform::cputime();
|
||||
dvalue[nvar] = platform::walltime();
|
||||
}
|
||||
|
||||
// INTERNAL
|
||||
|
||||
Reference in New Issue
Block a user