Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove remote channel script directory handling #3688

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 1 addition & 34 deletions parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import inspect
import logging
import os
import pathlib
import pickle
import random
import sys
Expand All @@ -25,7 +24,6 @@
import parsl
from parsl.app.errors import RemoteExceptionWrapper
from parsl.app.futures import DataFuture
from parsl.channels import Channel
from parsl.config import Config
from parsl.data_provider.data_manager import DataManager
from parsl.data_provider.files import File
Expand All @@ -49,7 +47,6 @@
from parsl.monitoring.message_type import MessageType
from parsl.monitoring.remote import monitor_wrapper
from parsl.process_loggers import wrap_with_logs
from parsl.providers.base import ExecutionProvider
from parsl.usage_tracking.usage import UsageTracker
from parsl.utils import Timer, get_all_checkpoints, get_std_fname_mode, get_version

Expand Down Expand Up @@ -1143,36 +1140,6 @@ def log_task_states(self) -> None:

logger.info("End of summary")

def _create_remote_dirs_over_channel(self, provider: ExecutionProvider, channel: Channel) -> None:
"""Create script directories across a channel

Parameters
----------
provider: Provider obj
Provider for which scripts dirs are being created
channel: Channel obj
Channel over which the remote dirs are to be created
"""
run_dir = self.run_dir
if channel.script_dir is None:

# This case will be detected as unreachable by mypy, because of
# the type of script_dir, which is str, not Optional[str].
# The type system doesn't represent the initialized/uninitialized
# state of a channel so cannot represent that a channel needs
# its script directory set or not.

channel.script_dir = os.path.join(run_dir, 'submit_scripts') # type: ignore[unreachable]

# Only create dirs if we aren't on a shared-fs
if not channel.isdir(run_dir):
parent, child = pathlib.Path(run_dir).parts[-2:]
remote_run_dir = os.path.join(parent, child)
channel.script_dir = os.path.join(remote_run_dir, 'remote_submit_scripts')
provider.script_dir = os.path.join(run_dir, 'local_submit_scripts')

channel.makedirs(channel.script_dir, exist_ok=True)

def add_executors(self, executors: Sequence[ParslExecutor]) -> None:
for executor in executors:
executor.run_id = self.run_id
Expand All @@ -1186,7 +1153,7 @@ def add_executors(self, executors: Sequence[ParslExecutor]) -> None:
executor.provider.script_dir = os.path.join(self.run_dir, 'submit_scripts')
os.makedirs(executor.provider.script_dir, exist_ok=True)

self._create_remote_dirs_over_channel(executor.provider, executor.provider.channel)
executor.provider.channel.script_dir = executor.provider.script_dir

self.executors[executor.label] = executor
executor.start()
Expand Down
Loading