Skip to content

Commit

Permalink
remove push/pull/move from LocalProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Nov 8, 2024
1 parent 38d29e1 commit 85031e3
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions parsl/providers/local/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class LocalProvider(ExecutionProvider, RepresentationMixin):
Ratio of provisioned task slots to active tasks. A parallelism value of 1 represents aggressive
scaling where as many resources as possible are used; parallelism close to 0 represents
the opposite situation in which as few resources as possible (i.e., min_blocks) are used.
move_files : Optional[Bool]
Should files be moved? By default, Parsl will try to figure this out itself (= None).
If True, then will always move. If False, will never move.
worker_init : str
Command to be run before starting a worker, such as 'module load Anaconda; source activate env'.
"""
Expand All @@ -48,8 +45,7 @@ def __init__(self,
max_blocks=1,
worker_init='',
cmd_timeout=30,
parallelism=1,
move_files=None):
parallelism=1):
self.channel = channel
self._label = 'local'
self.nodes_per_block = nodes_per_block
Expand All @@ -61,7 +57,6 @@ def __init__(self,
self.parallelism = parallelism
self.script_dir = None
self.cmd_timeout = cmd_timeout
self.move_files = move_files

# Dictionary that keeps track of jobs, keyed on job_id
self.resources = {}
Expand All @@ -83,7 +78,6 @@ def status(self, job_ids):
if job_dict['status'] and job_dict['status'].terminal:
# We already checked this and it can't change after that
continue
# Script path should point to remote path if _should_move_files() is True
script_path = job_dict['script_path']

alive = self._is_alive(job_dict)
Expand Down Expand Up @@ -137,8 +131,6 @@ def _is_alive(self, job_dict):

def _job_file_path(self, script_path: str, suffix: str) -> str:
path = '{0}{1}'.format(script_path, suffix)
if self._should_move_files():
path = self.channel.pull_file(path, self.script_dir)
return path

def _read_job_file(self, script_path: str, suffix: str) -> str:
Expand Down Expand Up @@ -216,9 +208,6 @@ def submit(self, command, tasks_per_node, job_name="parsl.localprovider"):

job_id = None
remote_pid = None
if self._should_move_files():
logger.debug("Pushing start script")
script_path = self.channel.push_file(script_path, self.channel.script_dir)

logger.debug("Launching")
# We need to capture the exit code and the streams, so we put them in files. We also write
Expand Down Expand Up @@ -254,9 +243,6 @@ def submit(self, command, tasks_per_node, job_name="parsl.localprovider"):

return job_id

def _should_move_files(self):
return (self.move_files is None and not isinstance(self.channel, LocalChannel)) or (self.move_files)

def cancel(self, job_ids):
''' Cancels the jobs specified by a list of job ids
Expand Down

0 comments on commit 85031e3

Please sign in to comment.