Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section describes how to use suite definition variables in ecFlow files. Suite definition variables are defined by the "edit" keyword. The section on "ecFlow pre-processor" gives more information on how variables are used.
In an ecFlow script, variables are written as text enclosed by a pair of '%' characters (the edit-character or micro-character). As in C-format strings, if there are two %-characters together they are concatenated to form a single %-character in the job-file.

For example, if you need to execute UNIX command:

...


At present, the default edit-character is %. It can only be defined when ecFlow is compiled. It can be redefined by setting the variable ECF_MICRO.
A user defines variables in a suite definition file using the edit keyword. User-defined variables can occur at any node level: suite, family, or task. ecFlow also generates variables from the node name, the host on which ecFlow is running, the time, the date, and so on.
When a variable is needed at submission time, it is first sought in the task itself. If it is not found in the task, it is sought from the task's parent and so on, up through the node levels until found. For any node, variables are looked for in the following order:

...


If variable "VAR" is not found, then we use a default value of "value"
Clever use of variables can, however, save a lot of work. For example, you can use the same script in multiple places, but configure it to behave differently depending on the variable set.

...

Code Block
#QSUB -o %ECFBASE%/log%ECFNAME%.%ECF_TRYNO% 
if [ %ECF_TRYNO% -gt 1 ] ; then
   DEBUG=yes
else
   DEBUG=no
fi 

 

...