Skip to content

Commit 7040c00

Browse files
authored
Merge pull request #352 from Cloudac7/jump
fix KeyError of "job_name" for Slurm
2 parents c67777a + 4371b99 commit 7040c00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dpgen/dispatcher/Slurm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def sub_script_head(self, res):
8181
ret += "#SBATCH -t %s\n" % res['time_limit']
8282
if res['mem_limit'] > 0 :
8383
ret += "#SBATCH --mem=%dG \n" % res['mem_limit']
84-
if len(res['job_name']) > 0:
85-
ret += '#SBATCH --job-name=%s\n' % res['job_name']
84+
if 'job_name' in res:
85+
if len(res['job_name']) > 0:
86+
ret += '#SBATCH --job-name=%s\n' % res['job_name']
8687
if len(res['account']) > 0 :
8788
ret += "#SBATCH --account=%s \n" % res['account']
8889
if len(res['partition']) > 0 :

0 commit comments

Comments
 (0)