Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5a2bf53
tentatively deprecate safe_mode, zero_resource_workers, AllocSpecs.out
jlnav Apr 29, 2024
2b5a785
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Apr 30, 2024
676689c
Merge branch 'develop' into refactor/1.3_deprecations
jlnav May 2, 2024
f2ce82a
add DeprecationWarning messages for use_persis_return_gen and use_per…
jlnav May 2, 2024
9ad86f9
un-tentatively-deprecate safe_mode
jlnav May 16, 2024
a0eed6a
only raise DeprecationWarning for AllocSpecs.out if that attribute's …
jlnav May 17, 2024
ec9e130
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Aug 9, 2024
36e2574
adjust target deprecation version
jlnav Aug 9, 2024
d8b3a58
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Aug 15, 2024
716b70c
deprecation warnings within persistent_aposmm and persistent_gpCAM
jlnav Aug 15, 2024
8a101a2
fix
jlnav Aug 15, 2024
8957e09
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Sep 11, 2024
3f08d0b
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Sep 11, 2024
6370548
tentatively deprecate directly specifying num_resource_sets
jlnav Sep 11, 2024
3805b6e
tentatively deprecate final_gen_send
jlnav Sep 11, 2024
4354fff
warn that libE_specs["workers"], a setting used only for tcp, will be…
jlnav Sep 11, 2024
d11c30c
actually document a libE_specs feature that already exists!!
jlnav Sep 11, 2024
695ee29
Update manager.py
wildsm Sep 17, 2024
939f868
Update persistent_aposmm.py
wildsm Sep 17, 2024
baa2761
Revert "Update persistent_aposmm.py"
wildsm Sep 17, 2024
7fef7b6
Update persistent_aposmm.py
wildsm Sep 17, 2024
849c04b
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Oct 21, 2024
563e3c0
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Nov 18, 2024
8e4dbbb
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Feb 28, 2025
40eb63c
Merge branch 'develop' into refactor/1.3_deprecations
jlnav Mar 13, 2025
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
4 changes: 4 additions & 0 deletions docs/data_structures/libE_specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ libEnsemble is primarily customized by setting options within a ``LibeSpecs`` cl
a local Python path, calling script, and manager/server format-fields for ``manager_ip``,
``manager_port``, ``authkey``, and ``workerID``. ``nworkers`` is specified normally.

**worker_launcher** [Callable]:
TCP Only: Worker launcher function. Accepts ``libE_specs``. An alternative to
``worker_cmd`` for initiating workers via third-party launchers.

.. tab-item:: History

**save_every_k_sims** [int]:
Expand Down
6 changes: 6 additions & 0 deletions libensemble/gen_funcs/persistent_aposmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

__all__ = ["aposmm", "initialize_APOSMM", "decide_where_to_start_localopt", "update_history_dist"]

import warnings
from math import log, pi, sqrt

import numpy as np
Expand Down Expand Up @@ -163,6 +164,11 @@ def aposmm(H, persis_info, gen_specs, libE_info):
"""

try:
warnings.warn(
"Use of persistent_aposmm as a persistent generator function is deprecated. "
+ "From libEnsemble v2.0 onward, use the libensemble.gen_classes.aposmm ask/tell generator. See the docs for more information.",
FutureWarning,
)
user_specs = gen_specs["user"]
ps = PersistentSupport(libE_info, EVAL_GEN_TAG)
n, n_s, rk_const, ld, mu, nu, comm, local_H = initialize_APOSMM(H, user_specs, libE_info)
Expand Down
7 changes: 7 additions & 0 deletions libensemble/gen_funcs/persistent_gpCAM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Persistent generator exposing gpCAM functionality"""

import time
import warnings

import numpy as np
from gpcam import GPOptimizer as GP
Expand All @@ -17,6 +18,12 @@

def _initialize_gpcAM(user_specs, libE_info):
"""Extract user params"""
warnings.warn(
"Use of persistent_gpCAM as a persistent generator function is deprecated. "
+ "From libEnsemble v2.0 onward, Use the libensemble.gen_classes.gpcam ask/tell generator. "
+ "See the docs for more information.",
FutureWarning,
)
b = user_specs["batch_size"]
lb = np.array(user_specs["lb"])
ub = np.array(user_specs["ub"])
Expand Down
2 changes: 2 additions & 0 deletions libensemble/libE.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
import socket
import sys
import traceback
import warnings
from pathlib import Path
from typing import Callable, Dict

Expand Down Expand Up @@ -590,6 +591,7 @@ def libE_tcp_mgr(sim_specs, gen_specs, exit_criteria, persis_info, alloc_specs,
workers = None
nworkers = libE_specs["nworkers"]
elif libE_specs.get("workers"):
warnings.warn("LibeSpecs.workers will be renamed to LibeSpecs.worker_hosts in v2.0", FutureWarning)
workers = libE_specs["workers"]
nworkers = len(workers)
ip = libE_specs["ip"] or get_ip()
Expand Down
24 changes: 24 additions & 0 deletions libensemble/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import sys
import time
import traceback
import warnings
from typing import Any, Union

import numpy as np
Expand Down Expand Up @@ -204,6 +205,7 @@ def __init__(
timer.start()
self.date_start = timer.date_start.replace(" ", "_")
self.safe_mode = libE_specs.get("safe_mode")

self.kill_canceled_sims = libE_specs.get("kill_canceled_sims")
self.hist = hist
self.hist.safe_mode = self.safe_mode
Expand All @@ -221,6 +223,12 @@ def __init__(
dyn_keys = ("resource_sets", "num_procs", "num_gpus")
dyn_keys_in_H = any(k in self.hist.H.dtype.names for k in dyn_keys)
self.use_resource_sets = dyn_keys_in_H or self.libE_specs.get("num_resource_sets")
if self.libE_specs.get("num_resource_sets", 0):
warnings.warn(
"Direct specification of number of resource sets is deprecated, to be removed in v2.0. "
+ "From v2.0 onward, generators should specify `num_procs` or `num_gpus` instead.",
DeprecationWarning,
)
self.gen_num_procs = libE_specs.get("gen_num_procs", 0)
self.gen_num_gpus = libE_specs.get("gen_num_gpus", 0)

Expand Down Expand Up @@ -483,8 +491,18 @@ def _update_state_on_worker_msg(self, persis_info: dict, D_recv: dict, w: int) -
final_data = D_recv.get("calc_out", None)
if isinstance(final_data, np.ndarray):
if calc_status is FINISHED_PERSISTENT_GEN_TAG and self.libE_specs.get("use_persis_return_gen", False):
warnings.warn(
"LibeSpecs.use_persis_return_gen is deprecated, to be removed in v2.0. From v2.0 onward, "
+ "libEnsemble will honor all data returned on completion of a persistent generator.",
DeprecationWarning,
)
self.hist.update_history_x_in(w, final_data, self.W[w]["gen_started_time"])
elif calc_status is FINISHED_PERSISTENT_SIM_TAG and self.libE_specs.get("use_persis_return_sim", False):
warnings.warn(
"LibeSpecs.use_persis_return_sim is deprecated, to be removed in v2.0. From v2.0 onward, "
+ " libEnsemble will honor all data returned on completion of a persistent simulator function.",
DeprecationWarning,
)
self.hist.update_history_f(D_recv, self.kill_canceled_sims)
else:
logger.info(_PERSIS_RETURN_WARNING)
Expand Down Expand Up @@ -577,6 +595,12 @@ def _final_receive_and_kill(self, persis_info: dict) -> (dict, int, int):
for w in self.W["worker_id"][self.W["persis_state"] > 0]:
logger.debug(f"Manager sending PERSIS_STOP to worker {w}")
if self.libE_specs.get("final_gen_send", False):
warnings.warn(
"LibeSpecs.final_gen_send is deprecated, to be removed in v2.0. From v2.0 onward, "
+ "upon a workflow completing, libEnsemble will automatically send any outstanding "
+ "finished simulations to the generator.",
DeprecationWarning,
)
rows_to_send = np.where(self.hist.H["sim_ended"] & ~self.hist.H["gen_informed"])[0]
work = {
"H_fields": self.gen_specs["persis_in"],
Expand Down
8 changes: 8 additions & 0 deletions libensemble/resources/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import socket
import warnings

from libensemble.resources import node_resources
from libensemble.resources.env_resources import EnvResources
Expand Down Expand Up @@ -166,6 +167,13 @@ def __init__(self, libE_specs: dict, platform_info: dict = {}, top_level_dir: st
self.top_level_dir = top_level_dir
self.dedicated_mode = libE_specs.get("dedicated_mode", False)
self.zero_resource_workers = libE_specs.get("zero_resource_workers", [])
if len(self.zero_resource_workers):
warnings.warn(
"libE_specs.zero_resource_workers is deprecated, to be removed in v2.0."
+ "Set libE_specs.gen_workers instead for generator-workers that require no resources.",
DeprecationWarning,
2,
)
self.num_resource_sets = libE_specs.get("num_resource_sets", None)
self.enforce_worker_core_bounds = libE_specs.get("enforce_worker_core_bounds", False)
self.gpus_per_group = libE_specs.get("gpus_per_group")
Expand Down
8 changes: 7 additions & 1 deletion libensemble/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,13 @@ class LibeSpecs(BaseModel):
"""
TCP Only: Split string corresponding to worker/client Python process invocation. Contains
a local Python path, calling script, and manager/server format-fields for ``manager_ip``,
``manager_port``, ``authkey``, and ``workerID``. ``nworkers`` is specified normally.
``manager_port``, ``authkey``, and ``workerID``. ``nworkers`` is specified normally. Launched
locally for each worker.
"""

worker_launcher: Optional[Callable] = None
""" TCP Only: Worker launcher function. Accepts ``libE_specs``. An alternative to
``worker_cmd`` for initiating workers via third-party launchers.
"""

use_persis_return_gen: Optional[bool] = False
Expand Down
2 changes: 2 additions & 0 deletions libensemble/utils/specs_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import logging
import secrets
import warnings
from pathlib import Path

import numpy as np
Expand Down Expand Up @@ -33,6 +34,7 @@ def _check_output_fields(values):
if scg(values, "gen_specs"):
out_names += [e[0] for e in scg(values, "gen_specs").outputs]
if scg(values, "alloc_specs"):
warnings.warn('AllocSpecs.out / alloc_specs["out"] is deprecated, to be removed in v2.0.', DeprecationWarning)
out_names += [e[0] for e in scg(values, "alloc_specs").outputs]

for name in scg(values, "sim_specs").inputs:
Expand Down
Loading