From 9aeb9fce816960759bb0a251200200dd33d06019 Mon Sep 17 00:00:00 2001 From: jaime Date: Mon, 16 Oct 2023 20:13:24 -0500 Subject: [PATCH] pbs now executes a bash_script --- jarvis_util/shell/pbs_exec.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jarvis_util/shell/pbs_exec.py b/jarvis_util/shell/pbs_exec.py index d4fce2e..e7d3d6b 100644 --- a/jarvis_util/shell/pbs_exec.py +++ b/jarvis_util/shell/pbs_exec.py @@ -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}' @@ -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: