Skip to content

Commit

Permalink
do all the other providers, basically same changes as slurm
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Nov 8, 2024
1 parent 85031e3 commit 74ed1a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
8 changes: 3 additions & 5 deletions parsl/providers/condor/condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,14 @@ def submit(self, command, tasks_per_node, job_name="parsl.condor"):
with open(userscript_path, 'w') as f:
f.write(job_config["worker_init"] + '\n' + wrapped_command)

user_script_path = self.channel.push_file(userscript_path, self.channel.script_dir)
the_input_files = [user_script_path] + self.transfer_input_files
the_input_files = [userscript_path] + self.transfer_input_files
job_config["input_files"] = ','.join(the_input_files)
job_config["job_script"] = os.path.basename(user_script_path)
job_config["job_script"] = os.path.basename(userscript_path)

# Construct and move the submit script
self._write_submit_script(template_string, script_path, job_name, job_config)
channel_script_path = self.channel.push_file(script_path, self.channel.script_dir)

cmd = "condor_submit {0}".format(channel_script_path)
cmd = "condor_submit {0}".format(script_path)
try:
retcode, stdout, stderr = self.execute_wait(cmd)
except Exception as e:
Expand Down
5 changes: 2 additions & 3 deletions parsl/providers/grid_engine/grid_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ def submit(self, command, tasks_per_node, job_name="parsl.sge"):
logger.debug("Writing submit script")
self._write_submit_script(template_string, script_path, job_name, job_config)

channel_script_path = self.channel.push_file(script_path, self.channel.script_dir)
if self.queue is not None:
cmd = "qsub -q {0} -terse {1}".format(self.queue, channel_script_path)
cmd = "qsub -q {0} -terse {1}".format(self.queue, script_path)
else:
cmd = "qsub -terse {0}".format(channel_script_path)
cmd = "qsub -terse {0}".format(script_path)
retcode, stdout, stderr = self.execute_wait(cmd)

if retcode == 0:
Expand Down
14 changes: 2 additions & 12 deletions parsl/providers/lsf/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class LSFProvider(ClusterProvider, RepresentationMixin):
:class:`~parsl.launchers.SingleNodeLauncher` (the default),
:class:`~parsl.launchers.SrunLauncher`, or
:class:`~parsl.launchers.AprunLauncher`
move_files : Optional[Bool]: should files be moved? by default, Parsl will try to move files.
bsub_redirection: Bool
Should a redirection symbol "<" be included when submitting jobs, i.e., Bsub < job_script.
request_by_nodes: Bool
Expand All @@ -92,7 +91,6 @@ def __init__(self,
project=None,
queue=None,
cmd_timeout=120,
move_files=True,
bsub_redirection=False,
request_by_nodes=True,
launcher=SingleNodeLauncher()):
Expand All @@ -112,7 +110,6 @@ def __init__(self,
self.queue = queue
self.cores_per_block = cores_per_block
self.cores_per_node = cores_per_node
self.move_files = move_files
self.bsub_redirection = bsub_redirection
self.request_by_nodes = request_by_nodes

Expand Down Expand Up @@ -230,17 +227,10 @@ def submit(self, command, tasks_per_node, job_name="parsl.lsf"):
logger.debug("Writing submit script")
self._write_submit_script(template_string, script_path, job_name, job_config)

if self.move_files:
logger.debug("moving files")
channel_script_path = self.channel.push_file(script_path, self.channel.script_dir)
else:
logger.debug("not moving files")
channel_script_path = script_path

if self.bsub_redirection:
cmd = "bsub < {0}".format(channel_script_path)
cmd = "bsub < {0}".format(script_path)
else:
cmd = "bsub {0}".format(channel_script_path)
cmd = "bsub {0}".format(script_path)
retcode, stdout, stderr = super().execute_wait(cmd)

job_id = None
Expand Down
4 changes: 1 addition & 3 deletions parsl/providers/torque/torque.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,13 @@ def submit(self, command, tasks_per_node, job_name="parsl.torque"):
logger.debug("Writing submit script")
self._write_submit_script(self.template_string, script_path, job_name, job_config)

channel_script_path = self.channel.push_file(script_path, self.channel.script_dir)

submit_options = ''
if self.queue is not None:
submit_options = '{0} -q {1}'.format(submit_options, self.queue)
if self.account is not None:
submit_options = '{0} -A {1}'.format(submit_options, self.account)

launch_cmd = "qsub {0} {1}".format(submit_options, channel_script_path)
launch_cmd = "qsub {0} {1}".format(submit_options, script_path)
retcode, stdout, stderr = self.execute_wait(launch_cmd)

job_id = None
Expand Down

0 comments on commit 74ed1a5

Please sign in to comment.