Skip to content

Commit

Permalink
Merge remote-tracking branch 'colinthomas-z80/tmp_function_data' into…
Browse files Browse the repository at this point in the history
… benc-k8s-kind-ci
  • Loading branch information
benclifford committed Sep 6, 2024
2 parents f34f2b8 + cd7229f commit 60a8611
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions parsl/executors/taskvine/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
high-throughput system for delegating Parsl tasks to thousands of remote machines
"""

import getpass
import hashlib
import inspect
import itertools
Expand All @@ -18,6 +19,7 @@
import threading
import uuid
from concurrent.futures import Future
from datetime import datetime
from typing import List, Literal, Optional, Union

# Import other libraries
Expand Down Expand Up @@ -217,9 +219,9 @@ def __create_data_and_logging_dirs(self):

# Create directories for data and results
log_dir = os.path.join(run_dir, self.label)
self._function_data_dir = os.path.join(run_dir, self.label, "function_data")
os.makedirs(log_dir)
os.makedirs(self._function_data_dir)
tmp_prefix = f'{self.label}-{getpass.getuser()}-{datetime.now().strftime("%Y%m%d%H%M%S%f")}-'
self._function_data_dir = tempfile.TemporaryDirectory(prefix=tmp_prefix)

# put TaskVine logs outside of a Parsl run as TaskVine caches between runs while
# Parsl does not.
Expand All @@ -229,7 +231,7 @@ def __create_data_and_logging_dirs(self):

# factory logs go with manager logs regardless
self.factory_config.scratch_dir = self.manager_config.vine_log_dir
logger.debug(f"Function data directory: {self._function_data_dir}, log directory: {log_dir}")
logger.debug(f"Function data directory: {self._function_data_dir.name}, log directory: {log_dir}")
logger.debug(
f"TaskVine manager log directory: {self.manager_config.vine_log_dir}, "
f"factory log directory: {self.factory_config.scratch_dir}")
Expand Down Expand Up @@ -295,7 +297,7 @@ def _path_in_task(self, executor_task_id, *path_components):
'map': Pickled file with a dict between local parsl names, and remote taskvine names.
"""
task_dir = "{:04d}".format(executor_task_id)
return os.path.join(self._function_data_dir, task_dir, *path_components)
return os.path.join(self._function_data_dir.name, task_dir, *path_components)

def submit(self, func, resource_specification, *args, **kwargs):
"""Processes the Parsl app by its arguments and submits the function
Expand Down

0 comments on commit 60a8611

Please sign in to comment.