Skip to content

Commit

Permalink
Merge pull request #1385 from Libensemble/release/v_1.4.1
Browse files Browse the repository at this point in the history
Release/v 1.4.1
  • Loading branch information
shuds13 authored Jul 29, 2024
2 parents 6635c22 + ac2d73f commit 33118cc
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected].3
- uses: crate-ci/[email protected].4
2 changes: 1 addition & 1 deletion .github/workflows/extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected].3
- uses: crate-ci/[email protected].4
4 changes: 2 additions & 2 deletions .wci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ description: |
language: Python

release:
version: 1.4.0
date: 2024-07-25
version: 1.4.1
date: 2024-07-29

documentation:
general: https://libensemble.readthedocs.io
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ GitHub issues are referenced, and can be viewed with hyperlinks on the `github r

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

Release 1.4.1
--------------

:Date: July 29, 2024

* Fix erroneous ``nworkers`` warning when using ``mpi4py`` comms. #1383

:Note:

* Tests were run on Linux and MacOS with Python versions 3.9, 3.10, 3.11, 3.12
* Heterogeneous workflows tested on Frontier (OLCF), Polaris (ALCF), and Perlmutter (NERSC).
* Note that tests have been recently run on Aurora (ALCF), but the system was unavailable at time of release.

:Known Issues:

* See known issues section in the documentation.


Release 1.4.0
--------------

Expand Down
2 changes: 1 addition & 1 deletion install/testing_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
flake8==7.1.0
coverage==7.3.1
pytest==8.3.1
pytest==8.3.2
pytest-cov==5.0.0
pytest-timeout==2.3.1
mock==5.1.0
Expand Down
6 changes: 4 additions & 2 deletions libensemble/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,12 @@ def __init__(
raise ValueError("nworkers must be specified if comms is 'local'")

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

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

if not self._libE_specs:
self._libE_specs = LibeSpecs(**libE_specs_parsed)
Expand Down
58 changes: 58 additions & 0 deletions libensemble/tests/functionality_tests/test_mpi_warning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"""
Runs libEnsemble with Latin hypercube sampling and check no warning.
Execute using MPI (e.g. 3 workers):
mpiexec -np 4 python test_mpi_warning.py
The number of concurrent evaluations of the objective function will be 4-1=3.
"""

# Do not change these lines - they are parsed by run-tests.sh
# TESTSUITE_COMMS: mpi
# TESTSUITE_NPROCS: 4

import numpy as np
import os
import time

from libensemble import Ensemble
from libensemble.gen_funcs.sampling import latin_hypercube_sample as gen_f

# Import libEnsemble items for this test
from libensemble.sim_funcs.simple_sim import norm_eval as sim_f
from libensemble.specs import ExitCriteria, GenSpecs, SimSpecs

from libensemble import logger

# Main block is necessary only when using local comms with spawn start method (default on macOS and Windows).
if __name__ == "__main__":
log_file = "ensemble_check_warning.log"
logger.set_level("MANAGER_WARNING")
logger.set_filename(log_file)

sampling = Ensemble()
sampling.libE_specs.save_every_k_sims = 100
sampling.sim_specs = SimSpecs(sim_f=sim_f)
sampling.gen_specs = GenSpecs(
gen_f=gen_f,
outputs=[("x", float, 2)],
user={
"gen_batch_size": 100,
"lb": np.array([-3, -2]),
"ub": np.array([3, 2]),
},
)

sampling.exit_criteria = ExitCriteria(sim_max=100)
sampling.add_random_streams()

if sampling.is_manager:
if os.path.exists(log_file):
os.remove(log_file)

sampling.run()
if sampling.is_manager:
print("len:", len(sampling.H))
time.sleep(0.2)
assert os.path.exists(log_file)
assert os.stat(log_file).st_size == 0, "Unexpected warning"
2 changes: 1 addition & 1 deletion libensemble/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.0"
__version__ = "1.4.1"

0 comments on commit 33118cc

Please sign in to comment.