Skip to content

Commit

Permalink
clean up naming strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
colinthomas-z80 committed Aug 19, 2024
1 parent 64c1b54 commit ac34607
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions parsl/executors/taskvine/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions parsl/executors/taskvine/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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))
Expand Down
10 changes: 4 additions & 6 deletions parsl/executors/taskvine/stub_staging_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions parsl/executors/taskvine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ac34607

Please sign in to comment.