Skip to content

Commit 8a909b0

Browse files
authored
Merge pull request easybuilders#4842 from appolloford/slurm_job_output
take into account `job-output-dir` option in Slurm job backend
2 parents 3ff6130 + 46060d7 commit 8a909b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

easybuild/tools/job/slurm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
3030
* Kenneth Hoste (Ghent University)
3131
"""
32+
import os
3233
import re
3334

3435
from easybuild.base import fancylogger
@@ -162,13 +163,14 @@ def __init__(self, script, name, env_vars=None, hours=None, cores=None):
162163
self.jobid = None
163164
self.script = script
164165
self.name = name
166+
self.output_dir = build_option('job_output_dir') or ''
165167

166168
self.job_specs = {
167169
'job-name': self.name,
168170
# pattern for output file for submitted job;
169171
# SLURM replaces %j with job ID (see https://slurm.schedmd.com/sbatch.html#lbAH)
170172
# %x (job name) replacement needs SLURM >= 17.02.1, thus we add name ourselves
171-
'output': '%s-%%j.out' % self.name,
173+
'output': '%s-%%j.out' % os.path.join(self.output_dir, self.name),
172174
'wrap': self.script,
173175
}
174176

0 commit comments

Comments
 (0)