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_cores and min_cores.

  • target_cores (int, optional) – The target number of cores for the job to use if nodes not provided

  • min_cores (int, optional) – The minimum number of cores for the job to use if nodes not provided

  • target_gpus (int, optional) – The target number of GPUs for the job to use if nodes not provided

  • min_gpus (int, optional) – The minimum number of GPUs for the job to use if nodes not provided

  • sum_min_cores (int, optional) – The minimum cores of every step added together, used when the job is concurrent and 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 parallel rather than one after another with polaris serial. Ignored when run_command is given, and it must stay False for a single step’s job script: there is nothing there to run concurrently, and polaris parallel would 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 None if no job script was written because the machine does not use a supported job scheduler