Skip to content

Commit 8c851b5

Browse files
committed
Merge branch 'develop' of https://github.com/Libensemble/libensemble into develop
2 parents 70d3a3c + 9ccd51f commit 8c851b5

80 files changed

Lines changed: 995 additions & 423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
libEnsemble: A complete toolkit for dynamic ensembles of calculations
1111
=====================================================================
1212

13-
Adaptive, portable, and scalable software for connecting "deciders" to experiments or simulations.
13+
libEnsemble empowers model-driven ensembles to solve design, decision,
14+
and inference problems on the world's leading supercomputers such as Frontier, Aurora, and Perlmutter.
1415

1516
• **Dynamic ensembles**: Generate parallel tasks on-the-fly based on previous computations.
1617
• **Extreme portability and scaling**: Run on or across laptops, clusters, and leadership-class machines.
@@ -19,8 +20,6 @@ Adaptive, portable, and scalable software for connecting "deciders" to experimen
1920
• **Data-flow between tasks**: Running ensemble members can send and receive data.
2021
• **Low start-up cost**: No additional background services or processes required.
2122

22-
libEnsemble is effective at solving design, decision, and inference problems on parallel resources.
23-
2423
`Quickstart`_
2524

2625
Installation
@@ -97,7 +96,7 @@ Try some other examples live in Colab.
9796
| Optimization example that finds multiple minima. | |Optimization example| |
9897
+---------------------------------------------------------------+-------------------------------------+
9998

100-
There are many more examples in the `regression tests`_.
99+
There are many more examples in the `Community Examples repository`_ and `regression tests`_.
101100

102101
Resources
103102
=========

docs/conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class Mock(MagicMock):
3030
def __getattr__(cls, name):
3131
return MagicMock()
3232

33+
3334
autodoc_mock_imports = ["ax", "balsam", "gpcam", "IPython", "matplotlib", "pandas", "scipy", "surmise"]
3435

3536
MOCK_MODULES = [
@@ -42,11 +43,22 @@ def __getattr__(cls, name):
4243
"PETSc",
4344
"petsc4py",
4445
"psutil",
46+
"pyre_extensions",
4547
"Tasmanian",
48+
"torch",
4649
]
4750

4851
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
4952

53+
54+
class AxParameterWarning(Warning): # Ensure it's a real warning subclass
55+
pass
56+
57+
58+
# Fix only `AxParameterWarning` while keeping `ax` mocked
59+
sys.modules["ax.exceptions.core"] = MagicMock()
60+
sys.modules["ax.exceptions.core"].AxParameterWarning = AxParameterWarning
61+
5062
# from libensemble import *
5163
# from libensemble.alloc_funcs import *
5264
# from libensemble.gen_funcs import *
@@ -65,6 +77,7 @@ def __getattr__(cls, name):
6577
sys.path.append(os.path.abspath("../libensemble/tools/live_data"))
6678
sys.path.append(os.path.abspath("../libensemble/executors"))
6779
sys.path.append(os.path.abspath("../libensemble/resources"))
80+
sys.path.append(os.path.abspath("../libensemble/tests/scaling_tests/forces"))
6881
# print(sys.path)
6982

7083
# -- General configuration ------------------------------------------------
@@ -216,8 +229,14 @@ def __getattr__(cls, name):
216229
# html_static_path = []
217230

218231

232+
def remove_noqa(app, what, name, obj, options, lines):
233+
for i, line in enumerate(lines):
234+
lines[i] = line.replace("# noqa", "")
235+
236+
219237
def setup(app):
220238
app.add_css_file("my_theme.css")
239+
app.connect("autodoc-process-docstring", remove_noqa)
221240

222241

223242
# Custom sidebar templates, must be a dictionary that maps document names

docs/examples/alloc_funcs.rst

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ Allocation Functions
55

66
Below are example allocation functions available in libEnsemble.
77

8+
Many users use these unmodified.
9+
810
.. IMPORTANT::
911
See the API for allocation functions :ref:`here<api_alloc_f>`.
1012

1113
.. note::
12-
The default allocation function is ``give_sim_work_first``.
14+
The default allocation function (for non-persistent generators) is :ref:`give_sim_work_first<gswf_label>`.
15+
16+
The most commonly used (for persistent generators) is :ref:`start_only_persistent<start_only_persistent_label>`.
1317

1418
.. role:: underline
1519
:class: underline
@@ -59,3 +63,39 @@ start_persistent_local_opt_gens
5963
.. automodule:: start_persistent_local_opt_gens
6064
:members:
6165
:undoc-members:
66+
67+
fast_alloc_and_pausing
68+
----------------------
69+
.. automodule:: fast_alloc_and_pausing
70+
:members:
71+
:undoc-members:
72+
73+
only_one_gen_alloc
74+
------------------
75+
.. automodule:: only_one_gen_alloc
76+
:members:
77+
:undoc-members:
78+
79+
start_fd_persistent
80+
-------------------
81+
.. automodule:: start_fd_persistent
82+
:members:
83+
:undoc-members:
84+
85+
persistent_aposmm_alloc
86+
-----------------------
87+
.. automodule:: persistent_aposmm_alloc
88+
:members:
89+
:undoc-members:
90+
91+
give_pregenerated_work
92+
----------------------
93+
.. automodule:: give_pregenerated_work
94+
:members:
95+
:undoc-members:
96+
97+
inverse_bayes_allocf
98+
--------------------
99+
.. automodule:: inverse_bayes_allocf
100+
:members:
101+
:undoc-members:

docs/examples/aposmm.rst

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ APOSMM
22
------
33

44
Asynchronously Parallel Optimization Solver for finding Multiple Minima
5-
(APOSMM) coordinates concurrent local optimization runs in order to identify
6-
many local minima.
5+
(APOSMM) coordinates concurrent local optimization runs to identify
6+
many local minima faster on parallel hardware.
7+
8+
Supported local optimization routines include:
9+
10+
- DFO-LS_ Derivative-free solver for (bound constrained) nonlinear least-squares minimization
11+
- NLopt_ Library for nonlinear optimization, providing a common interface for various methods
12+
- `scipy.optimize`_ Open-source solvers for nonlinear problems, linear programming,
13+
constrained and nonlinear least-squares, root finding, and curve fitting.
14+
- `PETSc/TAO`_ Routines for the scalable (parallel) solution of scientific applications
715

816
Required: mpmath_, SciPy_
917

@@ -12,32 +20,26 @@ Optional (see below): petsc4py_, nlopt_, DFO-LS_
1220
Configuring APOSMM
1321
^^^^^^^^^^^^^^^^^^
1422

15-
APOSMM works with a choice of optimizers, some requiring external packages. To
16-
import the optimization packages (and their dependencies) at a global level
17-
(recommended), add the following lines in the calling script before importing
18-
APOSMM::
23+
APOSMM works with a choice of optimizers, some requiring external packages. Specify
24+
them on a global level before importing APOSMM::
1925

2026
import libensemble.gen_funcs
2127
libensemble.gen_funcs.rc.aposmm_optimizers = <optimizers>
2228

23-
where ``optimizers`` is a string (or list of strings) from the available options:
29+
where ``optimizers`` is a string (or list-of-strings) from:
2430

2531
``"petsc"``, ``"nlopt"``, ``"dfols"``, ``"scipy"``, ``"external"``
2632

27-
.. dropdown:: Issues with ensemble hanging or failed simulations?
28-
29-
Note that if using **mpi4py** comms, PETSc must be imported at the global
30-
level or the ensemble may hang.
33+
.. dropdown:: Issues with ensemble hanging or failed simulations with PETSc?
3134

32-
Exception: In the case that you are using the MPIExecutor or other MPI inside
33-
a user function and you are using Open MPI, then you must:
35+
If using the MPIExecutor or other MPI routines
36+
and your MPI backend is Open MPI, then you must:
3437

35-
- Use ``local`` comms for libEnsemble (not ``mpi4py``)
36-
- Must **NOT** include the *rc* line above
38+
- Use ``local`` comms for libEnsemble (no ``mpirun``, ``mpiexec``, ``aprun``, etc.).
39+
- Must **NOT** include the *aposmm_optimizers* line above.
3740

38-
This is because PETSc imports MPI, and a global import of PETSc would result
39-
in nested MPI (which is not supported by Open MPI). When the above line is
40-
not used, an import local to the optimization function will happen.
41+
This is because PETSc imports MPI, and a global import of PETSc results
42+
in nested MPI (which is not supported by Open MPI).
4143

4244
To see the optimization algorithms supported, see `LocalOptInterfacer`_.
4345

@@ -49,17 +51,19 @@ Persistent APOSMM
4951
^^^^^^^^^^^^^^^^^
5052

5153
.. automodule:: persistent_aposmm
52-
:members:
54+
:members: aposmm
5355
:undoc-members:
5456

5557
LocalOptInterfacer
5658
^^^^^^^^^^^^^^^^^^
5759
.. automodule:: aposmm_localopt_support
58-
:members:
60+
:members: LocalOptInterfacer
5961
:undoc-members:
6062

6163
.. _DFO-LS: https://github.com/numericalalgorithmsgroup/dfols
6264
.. _mpmath: https://pypi.org/project/mpmath
6365
.. _nlopt: https://nlopt.readthedocs.io/en/latest/
6466
.. _petsc4py: https://bitbucket.org/petsc/petsc4py
6567
.. _SciPy: https://pypi.org/project/scipy
68+
.. _PETSc/TAO: http://www.mcs.anl.gov/petsc
69+
.. _scipy.optimize: https://docs.scipy.org/doc/scipy/reference/optimize.html

docs/examples/ax_multitask.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
persistent_ax_multitask
22
-----------------------
33

4-
Required: Ax_ version <=0.4.0
4+
Required: `ax-platform`_>=0.5.0
5+
6+
Example usage: gp_multitask_ax_
57

68
To install::
79

8-
pip install "ax-platform<=0.4.0"
10+
pip install ax-platform
911

1012
An example of the Ax multitask GP.
1113

1214
.. automodule:: persistent_ax_multitask
1315
:members:
14-
:no-undoc-members:
1516

16-
.. _Ax: https://github.com/facebook/Ax
17+
.. _`ax-platform`: https://github.com/facebook/Ax
18+
.. _gp_multitask_ax: https://github.com/Libensemble/libensemble/blob/main/libensemble/tests/regression_tests/test_persistent_gp_multitask_ax.py

docs/examples/calling_scripts.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,22 @@ Electrostatic Forces with Executor
2727

2828
These examples are from a test for evaluating the scaling capabilities of libEnsemble
2929
by calculating particle electrostatic forces through a user application. This
30-
application is registered with either the MPI or Balsam Executor, then submitted
31-
for execution in the ``sim_f``. Note the use of the ``parse_args()`` and
32-
``save_libE_output()`` convenience functions from the :doc:`tools<../utilities>` module
33-
in the first calling script.
30+
application is registered with the MPIExecutor, then submitted
31+
for execution in the ``sim_f``. Note the use of the ``parse_args=True`` which allows
32+
reading arguments such as the number of workers from the command line.
3433

3534
Traditional Version
3635
~~~~~~~~~~~~~~~~~~~
3736

38-
.. literalinclude:: ../../libensemble/tests/scaling_tests/forces/forces_adv/run_libe_forces.py
37+
Run using five workers with::
38+
39+
python run_libe_forces.py -n 5
40+
41+
One worker runs a persistent generator and the other four run the forces simulations.
42+
43+
.. literalinclude:: ../../libensemble/tests/scaling_tests/forces/forces_simple/run_libe_forces.py
3944
:language: python
40-
:caption: tests/scaling_tests/forces/forces_adv/run_libe_forces.py
45+
:caption: tests/scaling_tests/forces/forces_simple/run_libe_forces.py
4146
:linenos:
4247

4348
Object + yaml Version

docs/examples/examples_index.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
Example User Functions and Calling Scripts
2-
==========================================
1+
Overview of Examples
2+
====================
33

44
Here we give example generation, simulation, and allocation functions for
55
libEnsemble, as well as example calling scripts.
66

7-
Additional examples from libEnsemble's users are available in
8-
the `libEnsemble Community Repository`_, with corresponding generator documentation available
9-
:doc:`here<community:index>`.
7+
The examples come from the libEnsemble repository and the `libEnsemble Community Repository`_.
108

119
.. toctree::
1210
:maxdepth: 2

0 commit comments

Comments
 (0)