SPPARKS Website - SPPARKS Documentation - SPPARKS Commands

stats command


stats delta keyword values ... 


stats 0.1
stats 0.1 delay 0.5
stats 1.0 loglinfreq 7 10.0 


Print statistics to the screen and log file every so many seconds during a simulation. A value of 0.0 for delta means only print stats at the beginning and end of the run, in which case no optional keywords can be used.

The quantities printed are elapsed CPU time followed by those provided by the application, followed by those provided by any diagnostics you have defined.

Typically the application reports only the number of events or sweeps executed, followed by the simulation time, but other application-specific quantities may also be reported. Quantities such as the total energy of the system can be included in the output by creating diagnostics via the diag_style command.

The delay keyword will suppress output until the current time is tdelay or greater. Note that tdelay is not an elapsed time since the start of the run, but an absolute time.

Using the logfreq or loglinfreq keyword will produce statistical output at progressively larger intervals during the course of a simulation. There will be N outputs per interval where the size of the interval is initially delta and then scales up by factor each time. With loglinfreq, output times increase arithmetically within an interval; with logfreq the output times increase geometrically.

For example, this command

stats 0.1 loglinfreq 7 10.0 

will produce output at times:

t = 0, 0.1, 0.2, ..., 0.7, 1, 2, ...., 7, 10, 20, .... 

This command

stats 0.1 logfreq 1 2.0 

will produce output at times:

t = 0, 0.1, 0.2, 0.4, 0.8, 1.6, ... 

This command

stats 1.0 logfreq 10 10.0 

will produce output at times:

t = 0, 1.0, 1.26, 1.58, 2.00, 2.51, 3.16, 3.98, 5.01, 6.31, 7.94, 10.0, ... 

Note that in the above examples the times are the earliest times that output will be produced. In practice, because time is incremented in discrete jumps, output will be produced at times somewhat later than these times.

If N is specified as 0, then this will turn off logarithmic output, and revert to regular output every delta seconds.

The tol keyword will trigger output if the current time is within epsilon of the target time for output.

This can be useful when running with the sweep command and the time interval per sweep leads to small round-off differences in time. For example, if the time per sweep is 1/26 (for 26 neighbors per lattice site) and delta = 1.0, but output does not appear at time 2.0 but at 2.0385 (0.385 = 1/26). I.e. one sweep beyond the desired output time. Using a tol < 1/26 will give the desired outputs at 1,2,3,4, etc.


See the doc pages for quantities provided by particular app_style and diag_style commands for further details.

Related commands:

dump, diag_style


The default delta setting is 0.0 (if this command is not used), so that stats will only be output at the beginning and end of the run. The keyword defaults are delay = 0.0, no logarithmic output, tol = 0.0.