Skip to content

Commit

Permalink
fix PersistentSupport trying to send executor through queue
Browse files Browse the repository at this point in the history
  • Loading branch information
jlnav committed Sep 6, 2023
1 parent b5aecbd commit 3879d34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion libensemble/sim_funcs/executor_hworld.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np

# from libensemble.executors.mpi_executor import MPIExecutor
from libensemble.message_numbers import (
MAN_SIGNAL_FINISH,
TASK_FAILED,
Expand Down
13 changes: 6 additions & 7 deletions libensemble/sim_funcs/var_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import numpy as np

from libensemble.executors.executor import Executor
from libensemble.message_numbers import TASK_FAILED, UNSET_TAG, WORKER_DONE
from libensemble.resources.resources import Resources
from libensemble.sim_funcs.six_hump_camel import six_hump_camel_func
Expand All @@ -50,7 +49,7 @@ def gpu_variable_resources(H, persis_info, sim_specs, libE_info):
dry_run = sim_specs["user"].get("dry_run", False) # logs run lines instead of running
inpt = " ".join(map(str, x)) # Application input

exctr = Executor.executor # Get Executor
exctr = libE_info["executor"]

# Launch application via system MPI runner, using assigned resources.
task = exctr.submit(
Expand Down Expand Up @@ -87,7 +86,7 @@ def gpu_variable_resources_from_gen(H, persis_info, sim_specs, libE_info):
dry_run = sim_specs["user"].get("dry_run", False) # logs run lines instead of running
inpt = " ".join(map(str, x)) # Application input

exctr = Executor.executor # Get Executor
exctr = libE_info["executor"] # Get Executor

# Launch application via system MPI runner, using assigned resources.
task = exctr.submit(
Expand Down Expand Up @@ -147,7 +146,7 @@ def gpu_variable_resources_subenv(H, persis_info, sim_specs, libE_info):
env_script_path = sim_specs["user"]["env_script"] # Script to run in subprocess
inpt = " ".join(map(str, x)) # Application input

exctr = Executor.executor # Get Executor
exctr = libE_info["executor"] # Get Executor

# Launch application via given MPI runner, using assigned resources.
_launch_with_env_and_mpi(exctr, inpt, dry_run, env_script_path, "openmpi")
Expand Down Expand Up @@ -181,7 +180,7 @@ def gpu_variable_resources_subenv(H, persis_info, sim_specs, libE_info):
return H_o, persis_info, calc_status


def multi_points_with_variable_resources(H, _, sim_specs):
def multi_points_with_variable_resources(H, _, sim_specs, libE_info):
"""
Evaluates either helloworld or six hump camel for a collection of points
given in ``H["x"]`` via the MPI executor, supporting variable sized
Expand All @@ -204,7 +203,7 @@ def multi_points_with_variable_resources(H, _, sim_specs):
set_cores_by_rsets = True # If True use rset count to set num procs, else use all available to this worker.
core_multiplier = 1 # Only used with set_cores_by_rsets as a multiplier.

exctr = Executor.executor # Get Executor
exctr = libE_info["executor"] # Get Executor
task_states = []
for i, x in enumerate(H["x"]):
nprocs = None # Will be as if argument is not present
Expand Down Expand Up @@ -288,7 +287,7 @@ def CUDA_variable_resources(H, _, sim_specs, libE_info):

# Create application input file
inpt = " ".join(map(str, x))
exctr = Executor.executor # Get Executor
exctr = libE_info["executor"] # Get Executor

# Launch application via system MPI runner, using assigned resources.
task = exctr.submit(
Expand Down
1 change: 1 addition & 0 deletions libensemble/tools/persistent_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def send(self, output: npt.NDArray, calc_status: int = UNSET_TAG, keep_state=Fal
# Need to make copy before remove comm as original could be reused
libE_info = dict(self.libE_info)
libE_info.pop("comm")
libE_info.pop("executor")
else:
libE_info = self.libE_info

Expand Down

0 comments on commit 3879d34

Please sign in to comment.