RunTime Environment script templateΒΆ

You can start with the following template to write custom RTE script:

#
# description: My RTE description ('# description:' is a keyword)
#
###########################
### RTE Parameters      ###
###########################
# NOTE! RTE parameters is advanced feature to keep the same code,
# but make it customizable for different clusters.
# Most probably you DO NOT need params for custom site-specific RTE.
# RTE parameters requires:
#   1. Parameters description headers ('# param:' is a keyword):
# param:PARAM_1:string:DEFAULT_VALUE:Description of parameter. Predefined 'string' type means it can have arbitrary string value. Default is 'DEFAULT_VALUE'.
# param:PARAM_2:v1,v2,v3:v3:Description of parameter. This parameter can be set to 'v1', 'v2' or 'v3' value only. Default is 'v3'.
#   These headers used by arcctl to operate parameters.
#   Should be defined within first 20 lines of RTE script.
#
#   2. Definiton of parameters default values for shell
PARAM_1="${PARAM_1:-DEFAULT_VALUE}"
PARAM_2="${PARAM_2:-v3}"

###########################
### RTE Code            ###
###########################
if [ "x$1" = "x0" ]; then
   # RTE Stage 0
   # You can do something on ARC host as this stage.
   # Here is the right place to modify joboption_* variables.
   # Note that this code runs under the mapped user account already!
   # No root priveledges!
elif [ "x$1" = "x1" ]; then
   # RTE Stage 1
   # Do something on WN before job execution.
elif [ "x$1" = "x2" ]; then
   # RTE Stage 2
   # Do something on WN after job execution.
fi