Skip to content

Commit

Permalink
Patch for pharmbio#55
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Venturini authored and Luca Venturini committed May 22, 2018
1 parent ec77d2f commit a2da105
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions sciluigi/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ def get_argstr_hpc(self):
Return a formatted string with arguments and option flags to SLURM
commands such as salloc and sbatch, for non-MPI, HPC jobs.
"""
argstr = ' -A {pr} -p {pt} -n {c} -t {t} -J {j} srun -n 1 -c {thr} '.format(
pr=self.project,

argstr = " "
if self.project is not None:
argstr += "-A {pr} ".format(pr=self.project)

argstr += '-p {pt} -n {c} -t {t} -J {j} srun -n 1 -c {thr} '.format(
pt=self.partition,
c=self.cores,
t=self.time,
Expand All @@ -87,8 +91,12 @@ def get_argstr_mpi(self):
Return a formatted string with arguments and option flags to SLURM
commands such as salloc and sbatch, for MPI jobs.
"""
argstr = ' -A {pr} -p {pt} -n {c1} -t {t} -J {j} mpirun -v -np {c2} '.format(
pr=self.project,

argstr = " "
if self.project is not None:
argstr += "-A {pr} ".format(pr=self.project)

argstr += '-p {pt} -n {c1} -t {t} -J {j} mpirun -v -np {c2} '.format(
pt=self.partition,
c1=self.cores,
t=self.time,
Expand Down

0 comments on commit a2da105

Please sign in to comment.