Variables reference

Autosubmit uses a variable substitution system to facilitate the development of the templates. These variables can be used on templates with the syntax %VARIABLE_NAME%.

All configuration variables that are not related to the current job or platform are available by accessing first their parents, e.g. %PROJECT.PROJECT_TYPE% or %DEFAULT.EXPID%.

You can review all variables at any given time by using the report command, as illustrated below.

5 Example usage of autosubmit report
$ autosubmit report $expid -all

The command will save the list of variables available to a file in the experiment area. The groups of variables of Autosubmit are detailed in the next sections on this page.

Note

All the variable tables are displayed in alphabetical order.

Note

Custom configuration files (e.g. my-file.yml) may contain configuration like this example:

MYAPP:
  MYPARAMETER: 42
  ANOTHER_PARAMETER: 1984

If you configure Autosubmit to include this file with the rest of your configuration, then those variables will be available to each job as %MYAPP.MYPARAMETER% and %MYAPP.ANOTHER_PARAMETER%.

Job variables

These variables are relatives to the current job. These variables appear in the output of the report command with the pattern JOBS.${JOB_ID}.${JOB_VARIABLE}=${VALUE}. They can be used in templates with %JOB_VARIABLE%.

Variable

Description

CHECKPOINT

Generates a checkpoint step for this job based on job.type.

CHUNK

Current chunk.

CPUS_PER_TASK

Number of threads that the job will use.

CURRENT_QUEUE

Returns the queue to be used by the job. Chooses between serial and parallel platforms.

CUSTOM_DIRECTIVES

List of custom directives.

DELAY

Current delay.

DELAY_RETRIALS

TODO

DEPENDENCIES

Current job dependencies.

EXPORT

TODO.

FAIL_COUNT

Number of failed attempts to run this job.

FREQUENCY

TODO.

HYPERTHREADING

Detects if hyperthreading is enabled or not.

JOBNAME

Current job full name.

MEMBER

Current member.

MEMORY

Memory requested for the job.

MEMORY_PER_TASK

Memory requested per task.

NODES

Number of nodes that the job will use.

NUMMEMBERS

Number of members of the experiment.

NUMPROC

Number of processors that the job will use.

NUMTASK

Number of tasks that the job will use.

NUMTHREADS

Number of threads that the job will use.

PACKED

TODO

PROCESSORS

Number of processors that the job will use.

PROJDIR

Project folder path.

RETRIALS

Max amount of retrials to run this job.

ROOTDIR

Experiment folder path.

SCRATCH_FREE_SPACE

Percentage of free space required on the scratch.

SDATE

Current start date.

SPLIT

Current split.

SPLITS

Max number of splits.

SYNCHRONIZE

TODO.

TASKS

Number of tasks that the job will use.

TASKS_PER_NODE

Number of tasks that the job will use.

TASKTYPE

Type of the job, as given on job configuration file.

THREADS

Number of threads that the job will use.

WALLCLOCK

Duration for which nodes used by job will remain allocated.

The following variables are present only in jobs that contain a date (e.g. RUNNING=date).

Variable

Description

CHUNK_END_DATE

Chunk end date.

CHUNK_END_DAY

Chunk end day.

CHUNK_END_HOUR

Chunk end hour.

CHUNK_END_IN_DAYS

Days passed from the start of the simulation until the end of the chunk.

CHUNK_END_MONTH

Chunk end month.

CHUNK_END_YEAR

Chunk end year.

CHUNK_FIRST

True if the current chunk is the first, false otherwise.

CHUNK_LAST

True if the current chunk is the last, false otherwise.

CHUNK_SECOND_TO_LAST_DATE

Chunk second to last date.

CHUNK_SECOND_TO_LAST_DAY

Chunk second to last day.

CHUNK_SECOND_TO_LAST_HOUR

Chunk second to last hour.

CHUNK_SECOND_TO_LAST_MONTH

Chunk second to last month.

CHUNK_SECOND_TO_LAST_YEAR

Chunk second to last year.

CHUNK_START_DATE

Chunk start date.

CHUNK_START_DAY

Chunk start day.

CHUNK_START_HOUR

Chunk start hour.

CHUNK_START_MONTH

Chunk start month.

CHUNK_START_YEAR

Chunk start year.

DAY_BEFORE

Day before the start date.

NOTIFY_ON

Determine the job statuses you want to be notified.

PREV

Days since start date at the chunk’s start.

RUN_DAYS

Chunk length in days.

Custom directives

There are job variables that Autosubmit automatically converts into directives for your batch server. For example, NUMTHREADS will be set in a Slurm platform as --SBATCH --cpus-per-task=$NUMTHREADS.

However, the variables in Autosubmit do not contain all the directives available in each platform like Slurm. For values that do not have a direct variable, you can use CUSTOM_DIRECTIVES to define them in your target platform. For instance, to set the number of GPU’s in a Slurm job, you can use CUSTOM_DIRECTIVES=--gpus-per-node=10.

Platform variables

These variables are relative to the platforms defined in each job configuration. The table below shows the complete set of variables available in the current platform. These variables appear in the output of the report command with the pattern JOBS.${JOB_ID}.${PLATFORM_VARIABLE}=${VALUE}. They can be used in templates with %PLATFORM_VARIABLE%.

A series of variables is also available in each platform, and appear in the output of the report command with the pattern JOBS.${JOB_ID}.PLATFORMS.${PLATFORM_ID}.${PLATFORM_VARIABLE}=${VALUE}. They can be used in templates with PLATFORMS.%PLATFORM_ID%.%PLATFORM_VARIABLE%.

Variable

Description

CURRENT_ARCH

Platform name.

CURRENT_BUDG

Platform budget.

CURRENT_EXCLUSIVITY

True if you want to request exclusivity nodes.

CURRENT_HOST

Platform url.

CURRENT_HYPERTHREADING

TODO

CURRENT_LOGDIR

The platform’s LOG directory.

CURRENT_PARTITION

Partition to use for jobs.

CURRENT_PROJ

Platform project.

CURRENT_PROJ_DIR

Platform’s project folder path.

CURRENT_RESERVATION

You can configure your reservation id for the given platform.

CURRENT_ROOTDIR

Platform’s experiment folder path.

CURRENT_SCRATCH_DIR

Platform’s scratch folder path.

CURRENT_TYPE

Platform scheduler type.

CURRENT_USER

Platform user.

Note

The variables _USER, _PROJ and _BUDG have no value on the LOCAL platform.

Certain variables (e.g. _RESERVATION, _EXCLUSIVITY) are only available for certain platforms (e.g. MareNostrum).

A set of variables for the experiment’s default platform are also available.

Variable

Description

HPCARCH

Default HPC platform name.

HPCHOST

Default HPC platform url.

HPCUSER

Default HPC platform user.

HPCPROJ

Default HPC platform project.

HPCBUDG

Default HPC platform budget.

HPCTYPE

Default HPC platform scheduler type.

HPCVERSION

Default HPC platform scheduler version.

SCRATCH_DIR

Default HPC platform scratch folder path.

HPCROOTDIR

Default HPC platform experiment’s folder path.

Other variables

Variable

Description

CONFIG.AUTOSUBMIT_VERSION

Current version of Autosubmit.

CONFIG.MAXWAITINGJOBS

Maximum number of jobs permitted in the waiting status.

CONFIG.TOTALJOBS

Total number of jobs in the workflow.

Variable

Description

DEFAULT.CUSTOM_CONFIG

Custom configuration location.

DEFAULT.EXPID

Job experiment ID.

DEFAULT.HPCARCH

Default HPC platform name.

Variable

Description

EXPERIMENT.CALENDAR

Calendar used for the experiment. Can be standard or noleap.

EXPERIMENT.CHUNKSIZE

Size of each chunk.

EXPERIMENT.CHUNKSIZEUNIT

Unit of the chunk size. Can be hour, day, month, or year.

EXPERIMENT.DATELIST

List of start dates

EXPERIMENT.MEMBERS

List of members.

EXPERIMENT.NUMCHUNKS

Number of chunks of the experiment.

Variable

Description

PROJECT.PROJECT_DESTINATION

Folder to hold the project sources.

PROJECT.PROJECT_TYPE

Type of the project.

Note

Depending on your project type other variables may be available. For example, if you choose Git, then you should have %PROJECT_ORIGIN%. If you choose Subversion, then you will have %PROJECT_URL%.

Performance Metrics variables

These variables apply only to the report subcommand.

Variable

Description

ASYPD

Actual simulated years per day.

CHSY

Core hours per simulated year.

JPSY

Joules per simulated year.

Parallelization

Number of cores requested for the simulation job.

RSYPD

Raw simulated years per day.

SYPD

Simulated years per day.