xx SystemStatistics

SystemStatistics

Ian Hinder

Date: 2010/04/06 11:00:00

Abstract

Thorn SystemStatistics collects information about the system on which a Cactus process is running and stores it in Cactus variables. These variables can then be output and reduced using the standard Cactus methods such as IOBasic and IOScalar.

1 Purpose

When running a Cactus simulation, there are often features of the system on which it is running which can affect the simulation. For example, Cactus processes take a certain amount of memory, and if this exceeds the memory available on the system, the Cactus process will either start to swap, significantly reducing performance, or will terminate. It can be useful to determine quantities such as memory usage of a Cactus process, and that is the purpose of this thorn. The thorn currently provides grid arrays which are filled with memory-related information.

2 SystemStatistics Parameters This thorn has no parameters.

3 Examples

IOBasic::outInfo_everyxxxxxxxxxxxxxxxxxx=x256
IOBasic::outInfo_reductionsxxxxxxxxxxxxx=x"minimumxmaximum"
IOBasic::outInfo_varsxxxxxxxxxxxxxxxxxxx=x"SystemStatistics::maxrss_mb"
IOScalar::outScalar_everyxxxxxxxxxxxxxxx=x256
IOScalar::outScalar_reductionsxxxxxxxxxx=x"minimumxmaximumxaverage"
IOScalar::outScalar_varsxxxxxxxxxxxxxxxx=x"SystemStatistics::process_memory_mb"

The resulting screen output would look like this:

-----------------------------------------
IterationxxxxxxTimex|x*TISTICS::maxrss_mb
xxxxxxxxxxxxxxxxxxxx|xxxminimumxxxmaximum
-----------------------------------------
xxxxxxxx0xxxxx0.000x|xxxxxxxx52xxxxxxxx54
xxxxxx256xxxxx0.005x|xxxxxxxx53xxxxxxxx55
xxxxxx512xxxxx0.010x|xxxxxxxx53xxxxxxxx55
xxxxxx768xxxxx0.015x|xxxxxxxx53xxxxxxxx55
xxxxx1024xxxxx0.020x|xxxxxxxx53xxxxxxxx55
 and the reduced scalar output in systemstatistics::process_memory_mb.maximum.asc would look like

this:

#xSYSTEMSTATISTICS::maxrss_mbx(systemstatistics::process_memory_mb)
#x1:iterationx2:timex3:data
#xdataxcolumns:x3:maxrss_mbx4:majflt_mbx5:arena_mbx6:ordblks_mbx7:hblks_mbx8:hblkhd_mbx9:uordblks_mbx10:fordblks_mbx11:keepcost_mb
0x0x54x7x50x0x0x0x39x12x11
256x0.00498610682309355x55x7x51x0x0x0x39x12x11
512x0.0099722136461871x55x7x51x0x0x0x39x12x11
768x0.0149583204692806x55x7x51x0x0x0x39x12x11
1024x0.0199444272923742x55x7x51x0x0x0x39x12x11

4 Comments

There has been some discussion concerning whether it would be better to use Cactus clocks to store this information.

The current implementation stores memory usage in CCTK_INT variables. Since memory sizes of many gigabytes are common, this could lead to overflow. It would probably be better to use CCTK_REAL variables instead.

The thorn currently has variables for bytes, kilobytes and megabytes for each quantity. It might be better to remove these and let the output mechanism format the variables in an easy to understand form.

This thorn uses information from the /proc filesystem where it is available. The Resident Set Size (RSS) is also read correctly on Mac OS, where /proc is not available.

5 Parameters

6 Interfaces

General Implements: systemstatistics

Grid Variables

6.0.1 PRIVATE GROUPS

11 x Group Names x 10 x Variable Names x01 Details x 11 x
11 processxmemory 10                    01  compact 11 0
11                    10  maxrss  01 description 11 Process memory statistics
11                    10  majflt  01 dimensions 11 1
11                    10  arena  01 distribution 11 CONSTANT
11                    10  ordblks  01 group type 11 ARRAY
11                    10  hblks  01  size 11 1
11                    10  hblkhd  01  tags 11 Checkpoint=”no”
11                    10  uordblks  01 timelevels 11 1
11                    10  fordblks  01 variable type 11 REAL
11 processxmemoryxmb 10                    01  compact 11 0
11                    10  maxrssxmb  01 description 11 Run memory statistics in MB
11                    10  majfltxmb  01 dimensions 11 1
11                    10  arenaxmb  01 distribution 11 CONSTANT
11                    10  ordblksxmb  01 group type 11 ARRAY
11                    10  hblksxmb  01  size 11 1
11                    10  hblkhdxmb  01  tags 11 Checkpoint=”no”
11                    10  uordblksxmb  01 timelevels 11 1
11                    10  fordblksxmb  01 variable type 11 INT
11 processxmemoryxkb 10                    01  compact 11 0
11                    10  maxrssxkb  01 description 11 Run memory statistics in KB
11                    10  majfltxkb  01 dimensions 11 1
11                    10  arenaxkb  01 distribution 11 CONSTANT
11                    10  ordblksxkb  01 group type 11 ARRAY
11                    10  hblksxkb  01  size 11 1
11                    10  hblkhdxkb  01  tags 11 Checkpoint=”no”
11                    10  uordblksxkb  01 timelevels 11 1
11                    10  fordblksxkb  01 variable type 11 INT

7 Schedule This section lists all the variables which are assigned storage by thorn CactusUtils/SystemStatistics. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage x

11 Always:  11 x
11 processxmemory processxmemoryxmb processxmemoryxkb 11 x

11 x  11 x

11

Scheduled Functions

CCTKxANALYSIS x systemstatisticsxcollect x collect system statistics x

11 x 11 Language: 11 c
11 x 11 Options: 11 global
11 x 11 Type:  11 function
11 x 11 Writes: 11 systemstatistics::processxmemory
11 x 11 x  11 processxmemoryxmb
11 x 11 x  11 processxmemoryxkb