Skip to content

Commit

Permalink
Write a functional Slurm file
Browse files Browse the repository at this point in the history
  • Loading branch information
tikk3r committed Oct 25, 2019
1 parent 2326732 commit ff0f1b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions GRID_LRT/application/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ def build_slurm_file(self, database=None):
database = creds.database
if not os.path.exists(self.launch_file):
raise IOError("Launch file doesn't exist! "+self.launch_file)
slurmfile = '#!/usr/bin/env bash'
slurmfile = '#!/usr/bin/env bash\n'
if self.wholenodes:
slurmfile += '#SBATCH --exclusive --nodes=1 --cpus-per-task={ncpu:d} -p {queue:s} --array 1-{njobs:d}%{concurrent:d}'
slurmfile += '#SBATCH --exclusive --nodes=1 --cpus-per-task={ncpu:d} -p {queue:s} --array 1-{njobs:d}%{concurrent:d}\n'
else:
slurmfile += '#SBATCH --nodes=1 --cpus-per-task={ncpu:d} -p {queue:s} --array 1-{njobs:d}%{concurrent:d}'
slurmfile += '#SBATCH --nodes=1 --cpus-per-task={ncpu:d} -p {queue:s} --array 1-{njobs:d}%{concurrent:d}\n'
slurmfile += """
echo Job landed on $(hostname)
JOBDIR=$(mktemp -d -p $TMPDIR)
Expand All @@ -390,7 +390,8 @@ def build_slurm_file(self, database=None):
echo Created job directory $JOBDIR
cd $JOBDIR
{launcher:s} {db:s} {usr:s} {pw:s} {tt:s}
""".format(ncpu=int(self.ncpu),
"""
slurmfile = slurmfile.format(ncpu=int(self.ncpu),
queueu=str(self.queue),
njobs=self.numjobs,
concurrent=self.parameter_step,
Expand Down

0 comments on commit ff0f1b7

Please sign in to comment.