From ac34607db7d2dfb147bae88708e64bb4778e7dc3 Mon Sep 17 00:00:00 2001 From: Colin Thomas Date: Mon, 19 Aug 2024 13:18:50 -0400 Subject: [PATCH] clean up naming strategy --- parsl/executors/taskvine/executor.py | 4 ++-- parsl/executors/taskvine/manager.py | 8 ++++---- parsl/executors/taskvine/stub_staging_provider.py | 10 ++++------ parsl/executors/taskvine/utils.py | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/parsl/executors/taskvine/executor.py b/parsl/executors/taskvine/executor.py index 21cdfc71da..87388395c6 100644 --- a/parsl/executors/taskvine/executor.py +++ b/parsl/executors/taskvine/executor.py @@ -508,10 +508,10 @@ def _register_file(self, parsl_file): if parsl_file.scheme == 'file' or \ (parsl_file.local_path and os.path.exists(parsl_file.local_path)): to_stage = not os.path.isabs(parsl_file.filepath) - return ParslFileToVine(parsl_file.filepath, parsl_file.netloc, to_stage, to_cache) + return ParslFileToVine(parsl_file.filepath, parsl_file.filepath, to_stage, to_cache) else: # we must stage url and temp files - ptv = ParslFileToVine(parsl_file.url, parsl_file.netloc, True, to_cache) + ptv = ParslFileToVine(parsl_file.url, parsl_file.local_path, True, to_cache) return ptv def _std_output_to_vine(self, fdname, stdfspec): diff --git a/parsl/executors/taskvine/manager.py b/parsl/executors/taskvine/manager.py index b5bece9d9a..b7c6a1fd8a 100644 --- a/parsl/executors/taskvine/manager.py +++ b/parsl/executors/taskvine/manager.py @@ -376,10 +376,10 @@ def _taskvine_submit_wait(ready_task_queue=None, task_in_file = _handle_file_declaration_protocol(m, spec.parsl_name, spec.cache) parsl_file_name_to_vine_file[spec.parsl_name] = task_in_file logger.debug("Adding input file {}, {} to TaskVine".format(spec.parsl_name, task.executor_id)) - if spec.netloc == '': + if spec.remote_name == '': t.add_input(task_in_file, spec.parsl_name) else: - t.add_input(task_in_file, spec.netloc) + t.add_input(task_in_file, spec.remote_name) for spec in task.output_files: if spec.stage: @@ -389,10 +389,10 @@ def _taskvine_submit_wait(ready_task_queue=None, task_out_file = _handle_file_declaration_protocol(m, spec.parsl_name, spec.cache) parsl_file_name_to_vine_file[spec.parsl_name] = task_out_file logger.debug("Adding output file {}, {} to TaskVine".format(spec.parsl_name, task.executor_id)) - if spec.netloc == '': + if spec.remote_name == '': t.add_output(task_out_file, spec.parsl_name) else: - t.add_output(task_out_file, spec.netloc) + t.add_output(task_out_file, spec.remote_name) # Submit the task to the TaskVine object logger.debug("Submitting executor task {}, {} to TaskVine".format(task.executor_id, t)) diff --git a/parsl/executors/taskvine/stub_staging_provider.py b/parsl/executors/taskvine/stub_staging_provider.py index e3212903a3..818d764295 100644 --- a/parsl/executors/taskvine/stub_staging_provider.py +++ b/parsl/executors/taskvine/stub_staging_provider.py @@ -23,15 +23,13 @@ def can_stage_out(self, file): return file.scheme in known_url_schemes def stage_in(self, dm, executor: str, file: File, parent_fut: Optional[Future]) -> Optional[DataFuture]: - if file.netloc == '': - file.netloc = file.filename if file.scheme in ["taskvinetemp", "https", "http"]: - file.local_path = file.netloc + file.local_path = file.url.split('/')[-1] + logger.debug("Task vine staging provider stage in for {}".format(repr(file))) return None def stage_out(self, dm, executor: str, file: File, app_fu: Future) -> Optional[Future]: - if file.netloc == '': - file.netloc = file.filename if file.scheme in ["taskvinetemp", "https", "http"]: - file.local_path = file.netloc + file.local_path = file.url.split('/')[-1] + logger.debug("Task vine staging provider stage out for {}".format(repr(file))) return None diff --git a/parsl/executors/taskvine/utils.py b/parsl/executors/taskvine/utils.py index 839c6e7173..1a6e5643a1 100644 --- a/parsl/executors/taskvine/utils.py +++ b/parsl/executors/taskvine/utils.py @@ -69,14 +69,14 @@ class ParslFileToVine: """ def __init__(self, parsl_name: str, # name of file - netloc: str, # name of file if url + remote_name: str, # name of file if url stage: bool, # whether TaskVine should know about this file cache: bool # whether TaskVine should cache this file ): self.parsl_name = parsl_name self.stage = stage self.cache = cache - self.netloc = netloc + self.remote_name = remote_name def run_parsl_function(map_file, function_file, argument_file, result_file):