Skip to content

Commit 33118cc

Browse files
authored
Merge pull request #1385 from Libensemble/release/v_1.4.1
Release/v 1.4.1
2 parents 6635c22 + ac2d73f commit 33118cc

File tree

8 files changed

+86
-8
lines changed

8 files changed

+86
-8
lines changed

.github/workflows/basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,4 @@ jobs:
163163
runs-on: ubuntu-latest
164164
steps:
165165
- uses: actions/checkout@v4
166-
- uses: crate-ci/[email protected].3
166+
- uses: crate-ci/[email protected].4

.github/workflows/extra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,4 @@ jobs:
254254
runs-on: ubuntu-latest
255255
steps:
256256
- uses: actions/checkout@v4
257-
- uses: crate-ci/[email protected].3
257+
- uses: crate-ci/[email protected].4

.wci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ description: |
1616
language: Python
1717

1818
release:
19-
version: 1.4.0
20-
date: 2024-07-25
19+
version: 1.4.1
20+
date: 2024-07-29
2121

2222
documentation:
2323
general: https://libensemble.readthedocs.io

CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ GitHub issues are referenced, and can be viewed with hyperlinks on the `github r
88

99
.. _`github releases page`: https://github.com/Libensemble/libensemble/releases
1010

11+
Release 1.4.1
12+
--------------
13+
14+
:Date: July 29, 2024
15+
16+
* Fix erroneous ``nworkers`` warning when using ``mpi4py`` comms. #1383
17+
18+
:Note:
19+
20+
* Tests were run on Linux and MacOS with Python versions 3.9, 3.10, 3.11, 3.12
21+
* Heterogeneous workflows tested on Frontier (OLCF), Polaris (ALCF), and Perlmutter (NERSC).
22+
* Note that tests have been recently run on Aurora (ALCF), but the system was unavailable at time of release.
23+
24+
:Known Issues:
25+
26+
* See known issues section in the documentation.
27+
28+
1129
Release 1.4.0
1230
--------------
1331

install/testing_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
flake8==7.1.0
22
coverage==7.3.1
3-
pytest==8.3.1
3+
pytest==8.3.2
44
pytest-cov==5.0.0
55
pytest-timeout==2.3.1
66
mock==5.1.0

libensemble/ensemble.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,12 @@ def __init__(
310310
raise ValueError("nworkers must be specified if comms is 'local'")
311311

312312
elif self._known_comms == "mpi" and not parse_args:
313-
self.nworkers, self.is_manager = mpi_init(self._libE_specs.mpi_comm)
313+
# Set internal _nworkers - not libE_specs (avoid "nworkers will be ignored" warning)
314+
self._nworkers, self.is_manager = mpi_init(self._libE_specs.mpi_comm)
314315

315316
def _parse_args(self) -> (int, bool, LibeSpecs):
316-
self.nworkers, self.is_manager, libE_specs_parsed, self.extra_args = parse_args_f()
317+
# Set internal _nworkers - not libE_specs (avoid "nworkers will be ignored" warning)
318+
self._nworkers, self.is_manager, libE_specs_parsed, self.extra_args = parse_args_f()
317319

318320
if not self._libE_specs:
319321
self._libE_specs = LibeSpecs(**libE_specs_parsed)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
"""
2+
Runs libEnsemble with Latin hypercube sampling and check no warning.
3+
4+
Execute using MPI (e.g. 3 workers):
5+
mpiexec -np 4 python test_mpi_warning.py
6+
7+
The number of concurrent evaluations of the objective function will be 4-1=3.
8+
"""
9+
10+
# Do not change these lines - they are parsed by run-tests.sh
11+
# TESTSUITE_COMMS: mpi
12+
# TESTSUITE_NPROCS: 4
13+
14+
import numpy as np
15+
import os
16+
import time
17+
18+
from libensemble import Ensemble
19+
from libensemble.gen_funcs.sampling import latin_hypercube_sample as gen_f
20+
21+
# Import libEnsemble items for this test
22+
from libensemble.sim_funcs.simple_sim import norm_eval as sim_f
23+
from libensemble.specs import ExitCriteria, GenSpecs, SimSpecs
24+
25+
from libensemble import logger
26+
27+
# Main block is necessary only when using local comms with spawn start method (default on macOS and Windows).
28+
if __name__ == "__main__":
29+
log_file = "ensemble_check_warning.log"
30+
logger.set_level("MANAGER_WARNING")
31+
logger.set_filename(log_file)
32+
33+
sampling = Ensemble()
34+
sampling.libE_specs.save_every_k_sims = 100
35+
sampling.sim_specs = SimSpecs(sim_f=sim_f)
36+
sampling.gen_specs = GenSpecs(
37+
gen_f=gen_f,
38+
outputs=[("x", float, 2)],
39+
user={
40+
"gen_batch_size": 100,
41+
"lb": np.array([-3, -2]),
42+
"ub": np.array([3, 2]),
43+
},
44+
)
45+
46+
sampling.exit_criteria = ExitCriteria(sim_max=100)
47+
sampling.add_random_streams()
48+
49+
if sampling.is_manager:
50+
if os.path.exists(log_file):
51+
os.remove(log_file)
52+
53+
sampling.run()
54+
if sampling.is_manager:
55+
print("len:", len(sampling.H))
56+
time.sleep(0.2)
57+
assert os.path.exists(log_file)
58+
assert os.stat(log_file).st_size == 0, "Unexpected warning"

libensemble/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.4.0"
1+
__version__ = "1.4.1"

0 commit comments

Comments
 (0)