SPARTA WWW Site - SPARTA Documentation - SPARTA Commands

stats_style command

Syntax:

stats_style arg1 arg2 ... 

Examples:

stats_style step cpu np
stats_style step cpu spcpu np xlo xhi c_myCount[2]
stats_style step cpu spcpu np xlo xhi c_myCount[*] 

Description:

Determine what statistical data is printed to the screen and log file.

The values printed by the various keywords are instantaneous values, calculated on the current timestep. The exception is the keywords suffixed by "ave", which print a running total divided by the number of timesteps.

Options invoked by the stats_modify command can be used to set the numeric precision of each printed value, as well as other attributes of the statistics.


The step and elapsed keywords refer to timestep count. Step is the current timestep. Elapsed is the number of timesteps elapsed since the beginning of this run. Elaplong is the number of timesteps elapsed since the beginning of an initial run in a series of runs. See the start and stop keywords for the run command for info on how to invoke a series of runs that keep track of an initial starting time. If these keywords are not used, then elapsed and elaplong are the same value.

The cpu keyword is elapsed CPU seconds since the beginning of this run. The tpcpu and spcpu keywords are measures of how fast your simulation is currently running. The tpcpu keyword is simulation time per CPU second, where simulation time is in time units. The spcpu keyword is the number of timesteps per CPU second. Both quantities are on-the-fly metrics, measured relative to the last time they were invoked. Thus if you are printing out statistical output every 100 timesteps, the two keywords will continually output the time and timestep rate for the last 100 steps.

The wall keyword is elapsed time in seconds since SPARTA was launched. This can be used to time portions of the input script in the following manner:

variable            t equal wall
variable            t1 equal $t
portion of input script
variable            t2 equal $t
variable            delta equal v_2-v_1
print               "Delta time = $delta" 

The np, ntouch, ncomm, nbound, nexit, nscoll, nscheck, ncoll, nattempt, nreact, and nsreact keywords all generate counts for the current timestep.

The npave, ntouchave, ncommave, nboundave, nexitave, nscollave, nscheckave, ncollave, nattemptave, nreactave, and nsreactave keywords all generate values that are the cummulative total of the corresponding count divided by elapsed = the number of timesteps since the start of the current run.

The np keyword is the number of particles.

The ntouch keyword is the number of cells touched by the particles during the move portion of the timestep. E.g. if a particle moves from cell A to adjacent cell B, it touches 2 cells.

The ncomm keyword is the number of particles communicated to other processors.

The nbound keyword is the number of particles that collided with a global boundary. Crossing a periodic boundary or exiting an outflow boundary is not counted.

The nexit keyword is the number of particles that exited the simulation box through an outflow boundary.

The nscoll keyword is the number of particle/surface collisions that occurred, where a particle collided with a geometric surface.

The nscheck keyword is the number of particle/surface collisions that were checked for. If a cell is overlapped by N surface elements, all N must be checked for collisions each time a particle in that cell moves.

The ncoll keyword is the number of particle/particle collisions that occurred.

The nattempt keyword is the number of particle/particle collisions that were attempted.

The nreact keyword is the number of chemical reactions that occurred. The nsreact keyword is the number of chemical reactions on surfaces that occurred, including the global boundaries if they are treated as reacting surfaces, via the bound_modify command.

The nparent keyword is the number of parent cells, including the root cell. The nchild keyword is the number of child cells, which includes both unsplit and split cells. The nsplit keyword is the number of split cells. See Section howto 4.8 for a description of the hierarchical grid used by SPARTA and a definition of these various kinds of grid cells.

The vol keyword is the volume (or area in 2d) of the simulation box.

The lx, ly, lz keywords are the dimensions of the simulation box.

The xlo, xhi, ylo, yhi, zlo, zhi keywords are the boundaries of the simulation box.


For output values from a compute or fix, the bracketed index I used to index a vector, as in c_ID[I] or f_ID[I], can be specified using a wildcard asterisk with the index to effectively specify multiple values. This takes the form "*" or "*n" or "n*" or "m*n". If N = the size of the vector (for mode = scalar) or the number of columns in the array (for mode = vector), then an asterisk with no numeric values means all indices from 1 to N. A leading asterisk means all indices from 1 to n (inclusive). A trailing asterisk means all indices from n to N (inclusive). A middle asterisk means all indices from m to n (inclusive).

Using a wildcard is the same as if the individual elements of the vector had been listed one by one. E.g. these 2 stats_style commands are equivalent, since the compute reduce command creates a global vector with 6 values.

compute myCount reduce max x y z vx vy vz
stats_style step np c_myCount[*]
stats_style step np c_myCount[1] c_myCount[2] c_myCount[3] &
                    c_myCount[4] c_myCount[5] c_myCount[6] 

For the following keywords, the ID in the keyword should be replaced by the actual ID of a surface collision model, surface reaction model, compute, fix, or variable name that has been defined elsewhere in the input script. See those commands for details. If the entity calculates a global scalar, vector, or array, then the keyword formats with 0, 1, or 2 brackets will reference a scalar value from the entity.

The s_ID[I] and r_ID[I] keywords allow global values calculated by a surface collision model or surface reaction model to be output. As discussed on the surf_collide and surf_react doc pages, these models both calculate a global vector of quantities.

The c_ID and c_ID[I] and c_ID[I][J] keywords allow global values calculated by a compute to be output. As discussed on the compute doc page, computes can calculate global, per-particle, per-grid, or per-surf values. Only global values can be referenced by this command. However, per-particle, per-grid, or per-surf compute values can be referenced in a variable and the variable referenced, as discussed below. See the discussion above for how the I in c_ID[I] can be specified with a wildcard asterisk to effectively specify multiple values from a global compute vector.

The f_ID and f_ID[I] and f_ID[I][J] keywords allow global values calculated by a fix to be output. As discussed on the fix doc page, fixes can calculate global, per-particle, per-grid, or per-surf values. Only global values can be referenced by this command. However, per-particle or per-grid or per-surf fix values can be referenced in a variable and the variable referenced, as discussed below. See the discussion above for how the I in f_ID[I] can be specified with a wildcard asterisk to effectively specify multiple values from a global fix vector.

The v_name keyword allow the current value of a variable to be output. The name in the keyword should be replaced by the variable name that has been defined elsewhere in the input script. Only equal-style variables can be referenced. See the variable command for details. Variables of style equal can reference per-particle or per-grid or per-surf properties or stats keywords, or they can invoke other computes, fixes, or variables when evaluated, so this is a very general means of creating statistical output.

See Section_modify for information on how to add new compute and fix styles to SPARTA to calculate quantities that can then be referenced with these keywords to generate statistical output.


Restrictions: none

Related commands:

stats, stats_modify

Default:

stats_style step cpu np