polaris.job.write_job_script
- polaris.job.write_job_script(config, machine, work_dir, nodes=None, target_cores=None, min_cores=None, target_gpus=None, min_gpus=None, sum_min_cores=None, suite='', script_filename=None, run_command=None, concurrent=False)[source]
- Parameters:
config (polaris.config.PolarisConfigParser) – Configuration options for this test case, a combination of user configs and the defaults for the machine and component
machine ({str, None}) – The name of the machine
work_dir (str) – The work directory where the job script should be written
nodes (int, optional) – The number of nodes for the job. If not provided, it will be calculated based on
target_coresandmin_cores.target_cores (int, optional) – The target number of cores for the job to use if
nodesnot providedmin_cores (int, optional) – The minimum number of cores for the job to use if
nodesnot providedtarget_gpus (int, optional) – The target number of GPUs for the job to use if
nodesnot providedmin_gpus (int, optional) – The minimum number of GPUs for the job to use if
nodesnot providedsum_min_cores (int, optional) – The minimum cores of every step added together, used when the job is
concurrentand it asks for more nodes than the target and minimum figures do. Ignored otherwise. Taken in cores on every machine, including one sized by GPUs; see the note in the body.suite (str, optional) – The name of the suite
script_filename (str, optional) – The name of the job script file to write. If not provided, defaults to ‘job_script.sh’ or ‘job_script.{suite}.sh’ if suite is specified.
run_command (str, optional) – The command(s) to run in the job script. If not provided, defaults to ‘polaris serial {{suite}}’.
concurrent (bool, optional) – Whether the job script should run the steps of a suite or task at the same time with
polaris parallelrather than one after another withpolaris serial. Ignored whenrun_commandis given, and it must stayFalsefor a single step’s job script: there is nothing there to run concurrently, andpolaris parallelwould not find a suite or task to run.
- Returns:
options ({mache.parallel.slurm.SlurmOptions, mache.parallel.pbs.PbsOptions, None}) – The scheduler options that were rendered into the job script, or
Noneif no job script was written because the machine does not use a supported job scheduler