Skip to content

Commit

Permalink
Merge pull request #34 from JaimeCernuda/master
Browse files Browse the repository at this point in the history
added a non_equal map for pbs to support parameters like q that are j…
  • Loading branch information
JaimeCernuda authored Oct 17, 2023
2 parents f748c61 + 4bec80b commit 775635a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jarvis_util/shell/pbs_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ def generate_qsub_command(self):
if self.interactive:
cmd += ' -I'

options_map = {
equal_map = {
'filesystems': 'l filesystems',
'walltime': 'l walltime',
}

non_equal_map ={
'account': 'A',
'queue': 'q'
}
Expand All @@ -53,11 +56,16 @@ def generate_qsub_command(self):
else:
raise ValueError("System defined without select value.")

for attr, option in options_map.items():
for attr, option in equal_map.items():
value = getattr(self, attr)
if value is not None:
cmd += f' -{option}={value}'

for attr, option in non_equal_map.items():
value = getattr(self, attr)
if value is not None:
cmd += f' -{option} {value}'

cmd += f' {self.cmd}'
return cmd

Expand Down

0 comments on commit 775635a

Please sign in to comment.