.. _model-config-batch:
BATCH_SPEC_FILE
===============
.. contents::
:local:
Overview
--------
This variable allows a model to define the batch systems it can use. The ``batch_system``
element is pretty expressive and can be adapted for most batch systems used in HPC centers.
The ``batch_system`` entries are composable supporting a ``Don't Repeat Yourself (DRY)``
design. For example each batch system type only needs to be defined once and machines
that support a specific type can just define their queues and inherit the rest of the
configuration.
An example of this can be seen if ``slurm`` was defined as the following.
.. code-block:: xml
squeue
sbatch
scancel
#SBATCH
(\d+)$
--dependency=afterok:jobid
--dependency=afterany:jobid
:
%H:%M:%S
--mail-user
--mail-type
none, all, begin, end, fail
--job-name={{ job_id }}
--nodes={{ num_nodes }}
--output={{ job_id }}.%j
--exclusive
Then there may be multiple machines that support slurm but only need to define their queues as
long as they set their type to ``slurm``.
.. code-block:: xml
pbatch
pdebug
pbatch
pdebug
Entry
-----
The following is an example entry for ``BATCH_SPEC_FILE`` in ``config_files.xml``.
This varaible only requires a single value.
Example
:::::::
.. code-block:: xml
char
$SRCROOT/cime_config/machines/config_batch.xml
case_last
env_case.xml
File containing batch system details for target system (for documentation only - DO NOT EDIT)
$CIMEROOT/CIME/data/config/xml_schemas/config_batch.xsd
Contents
--------
The following describes the contents of the ``config_batch.xml`` file.
Schema Definition
-----------------
.. warning::
Under ``submit_args`` the ``arg`` element is deprecated in favor of ``argument``.
======================= ========================================================================================
Element/Attributes Description
======================= ========================================================================================
batch_system Defines a batch system.
MACH Optional name of a machine this batch system belongs to.
type The type of batch system, used for a machine to define it's batch system.
batch_query Command to query batch system.
args Extra arguments for query command.
per_job_arg Flag to query specific job.
batch_submit Command to submit to batch system.
batch_cancel Command to cancel job.
batch_redirect Redirect used for batch submit output.
batch_env Whether to run command is included in the batch script.
batch_directive Batch directive for submit file.
jobid_pattern Regex pattern to parse job id.
depend_string Dependency string.
depend_allow_string Dependency string if fails are allowed.
depend_separator Separator for dependencies.
walltime_format Format used to parse walltime.
batch_mail_flag Mail flag to pass user.
batch_mail_type_flag Mail type.
batch_mail_default Default type if `batch_mail_type_flag` is not set.
arg Batch submission argument. Deprecated.
flag Name of the argument.
name Value of the argument.
argument Batch submision argument.
job_queue If set the argument is only used when submitted to the queue.
directive Batch directive to add to submission script.
default Default value is directive value cannot be resolved.
prefix Value to prefix directives.
queue Queue defined for this batch system.
default Whether the queue is the default for the system.
strict If true then the walltime must be less than the maximum allowed walltime.
nodemax Maximum number of nodes.
nodemin Minimum number of nodes.
jobmax Maximum number of tasks.
jobmin Minimum number of tasks.
jobname If job matches value then this queue will be used.
walltimemax Maximum walltime.
walltimemin Minimum walltime.
walltimedef Default walltime.
======================= ========================================================================================
.. code-block:: xml