Skip to content

Commit

Permalink
pbs now executes a bash_script
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeCernuda committed Oct 17, 2023
1 parent 379e1ee commit 9aeb9fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion jarvis_util/shell/pbs_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def __init__(self, cmd, exec_info):
self.queue = exec_info.queue
self.env_vars = exec_info.env_vars

self.bash_script = exec_info.bash_script

jarvis_comma_list = ','.join(exec_info.basic_env.keys())
if self.env_vars:
self.env_vars = f'{self.env_vars},{jarvis_comma_list}'
Expand Down Expand Up @@ -75,10 +77,17 @@ def generate_qsub_command(self):
if value is not None:
cmd += f' -{option} {value}'

cmd += f' -- \"{self.cmd}\"'
cmd += f' -- \"{self.bash_script}\"'
return cmd

def pbscmd(self):

script = ['#!/bin/bash',
f'{self.cmd}']

with open(self.bash_script, encoding='utf-8') as f:
f.write('\n'.join(script))

cmd = self.generate_qsub_command()
jutil = JutilManager.get_instance()
if jutil.debug_pbs:
Expand Down

0 comments on commit 9aeb9fc

Please sign in to comment.