Skip to content

Commit

Permalink
Remove unused DFK initialization for multiple provider channels (#3683)
Browse files Browse the repository at this point in the history
This was previously used by the AdHocProvider, removed in PR #3676

## Type of change

- Code maintenance/cleanup
  • Loading branch information
benclifford authored Nov 7, 2024
1 parent d6dba38 commit 08aa003
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,12 +1186,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)

if hasattr(executor.provider, 'channels'):
logger.debug("Creating script_dir across multiple channels")
for channel in executor.provider.channels:
self._create_remote_dirs_over_channel(executor.provider, channel)
else:
self._create_remote_dirs_over_channel(executor.provider, executor.provider.channel)
self._create_remote_dirs_over_channel(executor.provider, executor.provider.channel)

self.executors[executor.label] = executor
executor.start()
Expand Down Expand Up @@ -1275,20 +1270,14 @@ def cleanup(self) -> None:

if hasattr(executor, 'provider'):
if hasattr(executor.provider, 'script_dir'):
logger.info(f"Closing channel(s) for {executor.label}")
logger.info(f"Closing channel for {executor.label}")

if hasattr(executor.provider, 'channels'):
for channel in executor.provider.channels:
logger.info(f"Closing channel {channel}")
channel.close()
logger.info(f"Closed channel {channel}")
else:
assert hasattr(executor.provider, 'channel'), "If provider has no .channels, it must have .channel"
logger.info(f"Closing channel {executor.provider.channel}")
executor.provider.channel.close()
logger.info(f"Closed channel {executor.provider.channel}")
assert hasattr(executor.provider, 'channel'), "Provider with .script_dir must have .channel"
logger.info(f"Closing channel {executor.provider.channel}")
executor.provider.channel.close()
logger.info(f"Closed channel {executor.provider.channel}")

logger.info(f"Closed executor channel(s) for {executor.label}")
logger.info(f"Closed executor channel for {executor.label}")

logger.info("Terminated executors")
self.time_completed = datetime.datetime.now()
Expand Down

0 comments on commit 08aa003

Please sign in to comment.