Download AIRES user`s manual and reference guide

Transcript
104
C HAPTER 5. T HE AIRES RUNNER S YSTEM
trial is a numeric variable counting the number of trials for the current run. Generally takes the value
1, but in certain circumstances, for example when relaunching AIRES after a system crash, it
can take larger values.
totsh is the total number of showers for the current task.
lastsh is the last completed shower.
prog is the instruction used to invoke AIRES, which includes the full name of the simulation program
used in the last run.
This powerful ARS option makes it possible for the user to perform operations of almost every
kind after ending the processes. Of course, a certain degree of expertise with UNIX systems may
be required in certain cases. Typical examples of operations that can be done using this facility are:
File movement after completion of tasks (for example to massive storage systems), alerts of any type
about conditions of the system, like full disks, etc.
On return, the AfterProcess script can communicate with the ARS via the exit code. If it is zero
then processing will continue normally, otherwise the ARS will send a mail notifying the abnormal
return code and then will stop. If it is necessary to restart the simulations, it can be done using the
ARS command aireslaunch.
The following shell script is a very simple example of an “after process” macro:
#!/bin/sh
#
if[ $3 = EndOfTask ]
then
#
# This code will be executed only after ending a task.
#
mv $ 2 .grdpcles /mysafeplace
fi
exit 0
Ö á
Notice that no action will be taken up to the end of a task. Whenever this happens, the corresponding
ground particle file is moved to another directory. The command exit 0 ensures normal return code;
exit n with n means an abnormal exit and in this case the simulations will be stopped.
Similarly as in the case of the AfterProcess macro, the ARS system will search for a BeforeProcess macro, right before invoking the simulation program. The existence of the BeforeProcess macro
is checked in the working directory, and in the user’s account (HOME) directory (in that order). If
the file is found, it is executed.
Ú