xx SampleIO

SampleIO

Thomas Radke

Date

Abstract

Thorn SampleIO serves as an example for creating your own I/O thorns. Its code is clearly structured and well documented, and implements a very simple and light-weight but fully functioning Cactus I/O method. Together with the documentation about I/O methods in the Cactus Users’ Guide and the chapter about thorn IOUtil in the Cactus Thorn Guide you should be able to use this code and modify/extend it according to your needs.

1 Purpose Thorn SampleIO registers the I/O method SampleIO with the Cactus flesh I/O interface. This method prints the data values of three-dimensional, distributed Cactus grid functions/arrays at a chosen location to screen.

The implemented I/O method makes use of the Cactus Hyperslabbing API to obtain the data values to print.

2 SampleIO Parameters Parameters to control the SampleIO I/O method are:

SampleIO::outxvars

This parameter denotes the variables to output as a space-separated list of full variable and/or group names.

SampleIO::pointxx, SampleIO::pointxy, SampleIO::pointxz

The location of the data point to output for all variables is given in index coordinates (starting from 0) on a three-dimensional computational grid.

SampleIO::outxevery

This parameter sets the frequency for periodic output. A positive value means to output every so many iterations. A negative value chooses the value of the general IO::outxevery integer parameter to be taken. A value of zero disables SampleIO periodic output. The value for outxevery is used for all variables by default. This can be overwritten for individual variables by appending an option string to the variable name, like in

SampleIO::outxvars = "MyThorn::MyVar[outxevery=2]".

All parameters are steerable, ie. they can be changed at runtime. The code in thorn SampleIO includes the logic to check whether a parameter has been changed since the last output, and how to re-evaluate the I/O parameters.

3 Notes Like any other I/O thorn should do, SampleIO inherits general I/O parameters from thorn IOUtil. Therefore this I/O helper thorn must be included in the ThornList of a Cactus configuration in order to compile thorn SampleIO, and also activated at runtime in the ActiveThorns parameter in your parameter file.

4 Parameters

11outxevery  10Scope: privatex01  INT

11Description: How often to do SampleIO output, overrides IO::outxevery

11 Range 10 x01 Default: -1
111:*  10Every so many iterations
110:  10Disable SampleIO output
11-1:  10Choose the default from IO::outxevery

11

11outxvars  10Scope: privatex01  STRING

11Description: Variables to output by SampleIO

11 Range 10 x01 Default: (none)
11.+  10Space-separated list of fully qualified variable/group names
11ˆ$  10An empty string to output nothing

11

11pointxx  10Scope: privatex01  INT

11Description: x-index (starting from 0) locating the array element to output

11 Range 10 x01 Default: (none)
110:*  10An index between [0, nx)

11

11pointxy  10Scope: privatex01  INT

11Description: y-index (starting from 0) locating the array element to output

11 Range 10 x01 Default: (none)
110:*  10An index between [0, ny)

11

11pointxz  10Scope: privatex01  INT

11Description: z-index (starting from 0) locating the array element to output

11 Range 10 x01 Default: (none)
110:*  10An index between [0, nz)

11

11ioxoutxevery  10Scope: shared from IOx01INT

11

11strictxioxparameterxcheck 10Scope: shared from IOx01BOOLEAN

11

11verbose  10Scope: shared from IOx01KEYWORD

11

5 Interfaces

General Implements:

sampleio

Inherits:

io

6 Schedule This section lists all the variables which are assigned storage by thorn CactusExamples/SampleIO. 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 NONE

Scheduled Functions

CCTKxSTARTUP x sampleioxstartup x startup routine x

11x11After: 11ioutilxstartup
11 x 11Language:11c
11 x 11Type: 11function