.. _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. Walltime Format --------------- The ``walltime_format`` element controls how a job's resolved walltime is rendered before it is passed to the batch system, e.g. through ``$JOB_WALLCLOCK_TIME`` in ``submit_args``. For most batch systems the value is a positional format string using the ``%H``, ``%M``, and ``%S`` specifiers. The fields of the input walltime are rearranged to match the format; they are **not** summed across units. For example ``%H:%M`` renders ``01:10:00`` as ``01:10``. .. code-block:: xml %H:%M:%S Flux :::: Flux's ``-t/--time-limit`` option accepts minutes or a Flux Standard Duration (FSD, RFC 23) — a number with a single unit suffix (``s``, ``m``, ``h``, or ``d``) — rather than ``HH:MM:SS``. When ``batch_system`` is of type ``flux`` the specifiers therefore expand to the **total** duration expressed in that unit, so a format pairing a specifier with its matching FSD suffix produces a valid FSD value. Only the following formats are accepted; any other value raises an error during case setup since it would produce a value Flux rejects or silently misinterprets (e.g. a bare ``%H`` renders a number Flux would read as minutes). =================== ============================================ ====================== ``walltime_format`` Description Example (``01:10:00``) =================== ============================================ ====================== *(unset)* Total minutes as FSD, the default. ``70m`` ``%M`` Total minutes, bare. ``70`` ``%Ss`` Total seconds as FSD. ``4200s`` ``%Mm`` Total minutes as FSD. ``70m`` ``%Hh`` Total hours as FSD. ``1.17h`` ``%Dd`` Total days as FSD. ``0.05d`` =================== ============================================ ====================== Partial values are rounded up at two decimal places so a job is never allotted less time than requested. .. code-block:: xml flux batch %Mm 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 render the walltime, see `Walltime Format`_. 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