Skip to content

Commit a2da105

Browse files
Luca VenturiniLuca Venturini
Luca Venturini
authored and
Luca Venturini
committed
Patch for pharmbio#55
1 parent ec77d2f commit a2da105

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

sciluigi/slurm.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ def get_argstr_hpc(self):
7373
Return a formatted string with arguments and option flags to SLURM
7474
commands such as salloc and sbatch, for non-MPI, HPC jobs.
7575
"""
76-
argstr = ' -A {pr} -p {pt} -n {c} -t {t} -J {j} srun -n 1 -c {thr} '.format(
77-
pr=self.project,
76+
77+
argstr = " "
78+
if self.project is not None:
79+
argstr += "-A {pr} ".format(pr=self.project)
80+
81+
argstr += '-p {pt} -n {c} -t {t} -J {j} srun -n 1 -c {thr} '.format(
7882
pt=self.partition,
7983
c=self.cores,
8084
t=self.time,
@@ -87,8 +91,12 @@ def get_argstr_mpi(self):
8791
Return a formatted string with arguments and option flags to SLURM
8892
commands such as salloc and sbatch, for MPI jobs.
8993
"""
90-
argstr = ' -A {pr} -p {pt} -n {c1} -t {t} -J {j} mpirun -v -np {c2} '.format(
91-
pr=self.project,
94+
95+
argstr = " "
96+
if self.project is not None:
97+
argstr += "-A {pr} ".format(pr=self.project)
98+
99+
argstr += '-p {pt} -n {c1} -t {t} -J {j} mpirun -v -np {c2} '.format(
92100
pt=self.partition,
93101
c1=self.cores,
94102
t=self.time,

0 commit comments

Comments
 (0)