Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,19 @@ def submit_job(job, submitted_jobs, build_env_cfg, ym, pr_id):
- symlink(string): symlink from main pr_<ID> dir to job dir (job[0])
"""

# Add a default time limit of 24h to the command if nothing else is specified by the user
if "--time=" not in build_env_cfg[SLURM_PARAMS]:
time_limit = "--time=24:00:00"
else:
time_limit = ""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would work only if a limit is specified via the setting slurm_params in app.cfg and if the notation with = is used. The sbatch command also allows to provide values with a space, i.e., --time SOME_LIMIT and the short form -t SOME_LIMIT.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test should include job.slurm_opts (which are read from arch_target_map in app.cfg).

# determine CPU target to use: job.arch_target, but without the linux/ part
cpu_target = '/'.join(job.arch_target.split('/')[1:])

command_line = ' '.join([
build_env_cfg[SUBMIT_COMMAND],
build_env_cfg[SLURM_PARAMS],
time_limit,
job.slurm_opts,
# set $CPU_TARGET in job environment, which can be picked up by build job script;
'--export=ALL,CPU_TARGET=%s' % cpu_target,
Expand Down