Skip to content

Commit f220fdd

Browse files
committed
Merge branch 'develop' of https://github.com/Libensemble/libensemble into develop
2 parents 4c2f146 + a647f36 commit f220fdd

39 files changed

Lines changed: 134 additions & 92 deletions

.github/workflows/basic.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
pip install -e .
6363
flake8 libensemble
6464
65+
- name: Install mypy
66+
run: pip install mypy
67+
68+
- name: Run mypy (limited scope)
69+
run: mypy
70+
6571
- name: Remove various tests on newer pythons
6672
if: matrix.python-version == 'py311' || matrix.python-version == 'py312' || matrix.python-version == 'py313' || matrix.python-version == 'py314'
6773
run: |

docs/overview_usecases.rst

Lines changed: 61 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Manager, Workers, Generators, and Simulators
88
libEnsemble's **manager** allocates work to **workers**,
99
which perform computations via **generators** and **simulators**:
1010

11-
* :ref:`generator<api_gen_f>`: Generates inputs to the *simulator*
12-
* :ref:`simulator<api_sim_f>`: Performs an evaluation based on parameters from the *generator*
11+
* :ref:`generator<api_gen_f>`: Generates inputs for the *simulator*
12+
* :ref:`simulator<api_sim_f>`: Performs an evaluation using parameters from the *generator*
1313

1414
.. figure:: images/adaptiveloop.png
1515
:alt: Adaptive loops
@@ -28,19 +28,19 @@ which perform computations via **generators** and **simulators**:
2828
An :doc:`executor<executor/overview>` interface is available so generators and simulators
2929
can launch and monitor external applications.
3030

31-
libEnsemble uses a NumPy structured array known as the :ref:`history array<funcguides-history>`
32-
to keep a record of all simulations and generated values.
31+
libEnsemble uses a NumPy structured array called the :ref:`history array<funcguides-history>`
32+
to record all simulations and generated values.
3333

3434
Allocator Function
3535
~~~~~~~~~~~~~~~~~~
3636

3737
* :ref:`allocator<api_alloc_f>`: Decides whether a simulator or generator should be
38-
prompted (and with what inputs/resources) as workers become available
38+
invoked (and with what inputs/resources) as workers become available
3939

40-
The default allocator (``alloc_f``) prompts workers to run the highest priority simulator work.
41-
If a worker is idle and there is no simulator work, that worker is prompted to query the generator.
40+
The default allocator (``alloc_f``) prompts workers to run the highest-priority simulator work.
41+
If a worker is idle and no simulator work is available, that worker is prompted to query the generator.
4242

43-
The default allocator is appropriate for the vast majority of use-cases, but is customizable
43+
The default allocator is appropriate for the majority of use cases but can be customized
4444
for users interested in more advanced allocation strategies.
4545

4646
Example Use Cases
@@ -53,104 +53,102 @@ to support):
5353
.. dropdown:: **Click Here for Use-Cases**
5454

5555
* A user wants to optimize a simulation calculation. The simulation may
56-
already be using parallel resources but not a large fraction of some
57-
computer. libEnsemble can coordinate the concurrent evaluation of the
58-
simulation ``sim_f`` at various parameter values based on candidate parameter
59-
values from ``gen_f`` (possibly after each ``sim_f`` output).
56+
already be using parallel resources but not a large fraction of a
57+
computer. libEnsemble can coordinate concurrent evaluations of the
58+
simulation ``sim_f`` at multiple parameter values based on candidate parameter
59+
values produced by ``gen_f`` (possibly after each ``sim_f`` output).
6060

6161
* A user has a ``gen_f`` that produces meshes for a
62-
``sim_f``. Given the ``sim_f`` output, the ``gen_f`` can refine a mesh or
63-
produce a new mesh. libEnsemble can ensure that the calculated meshes can be
64-
used by multiple simulations without requiring moving data.
62+
``sim_f``. Based on the ``sim_f`` output, the ``gen_f`` can refine a mesh or
63+
produce a new mesh. libEnsemble ensures that generated meshes can be
64+
reused by multiple simulations without requiring data movement.
6565

6666
* A user wants to evaluate a simulation ``sim_f`` with different sets of
6767
parameters, each drawn from a set of possible values. Some parameter values
6868
are known to cause the simulation to fail. libEnsemble can stop
6969
unresponsive evaluations and recover computational resources for future
70-
evaluations. The ``gen_f`` can possibly update the sampling after discovering
70+
evaluations. The ``gen_f`` can update the sampling strategy after discovering
7171
regions where evaluations of ``sim_f`` fail.
7272

7373
* A user has a simulation ``sim_f`` that requires calculating multiple
7474
expensive quantities, some of which depend on other quantities. The ``sim_f``
75-
can observe intermediate quantities to stop related calculations and
75+
can monitor intermediate quantities to stop related calculations early and
7676
preempt future calculations associated with poor parameter values.
7777

78-
* A user has a ``sim_f`` with multiple fidelities, with the higher-fidelity
79-
evaluations requiring more computational resources, and a
80-
``gen_f``/``alloc_f`` that decides which parameters should be evaluated and
81-
at what fidelity level. libEnsemble can coordinate these evaluations without
82-
requiring the user to know parallel programming.
78+
* A user has a ``sim_f`` with multiple fidelities, where higher-fidelity
79+
evaluations require more computational resources. A ``gen_f``/``alloc_f``
80+
pair decides which parameters should be evaluated and
81+
at what fidelity level. libEnsemble coordinates these evaluations without
82+
requiring the user to write parallel code.
8383

84-
* A user wishes to identify multiple local optima for a ``sim_f``. Furthermore,
84+
* A user wishes to identify multiple local optima for a ``sim_f``. In addition,
8585
sensitivity analysis is desired at each identified optimum. libEnsemble can
86-
use the points from the APOSMM ``gen_f`` to identify optima; and after a
87-
point is ruled to be an optimum, a different ``gen_f`` can produce a
88-
collection of parameters necessary for sensitivity analysis of ``sim_f``.
86+
use points from the APOSMM ``gen_f`` to identify optima. After a point is
87+
determined to be an optimum, a different ``gen_f`` can generate the
88+
parameter sets required for sensitivity analysis of ``sim_f``.
8989

90-
Combinations of these use cases are supported as well. An example of
91-
such a combination is using libEnsemble to solve an optimization problem that
92-
relies on simulations that fail frequently.
90+
Combinations of these use cases are also supported. For example, libEnsemble
91+
can be used to solve optimization problems where simulations fail
92+
frequently.
9393

9494
Glossary
9595
~~~~~~~~
9696

9797
Here we define some terms used throughout libEnsemble's code and documentation.
98-
Although many of these terms seem straightforward, defining such terms assists
99-
with keeping confusion to a minimum when communicating about libEnsemble and
98+
Although many of these terms seem straightforward, defining them helps reduce
99+
confusion when communicating about libEnsemble and
100100
its capabilities.
101101

102102
.. dropdown:: **Click Here for Glossary**
103103
:open:
104104

105-
* **Manager**: Single libEnsemble process facilitating communication between
106-
other processes. Within libEnsemble, the *Manager* process configures and
107-
passes work to and from the workers.
105+
* **Manager**: A single libEnsemble process that facilitates communication between
106+
other processes. The *Manager* configures and distributes work to
107+
workers and collects their output.
108108

109109
* **Worker**: libEnsemble processes responsible for performing units of work,
110-
which may include submitting or executing tasks. *Worker* processes run
111-
generation and simulation routines, submit additional tasks for execution,
112-
and return results to the manager.
110+
which may include executing tasks or submitting external jobs. Workers run
111+
generation and simulation routines and return results to the manager.
113112

114113
* **Calling Script**: libEnsemble is typically imported, parameterized, and
115114
initiated in a single Python file referred to as a *calling script*. ``sim_f``
116-
and ``gen_f`` functions are also commonly configured and parameterized here.
115+
and ``gen_f`` functions are commonly configured and parameterized here.
117116

118117
* **User function**: A generator, simulator, or allocation function. These
119-
are Python functions that govern the libEnsemble workflow. They
118+
Python functions govern the libEnsemble workflow. They
120119
must conform to the libEnsemble API for each respective user function, but otherwise can
121-
be created or modified by the user. libEnsemble comes with many examples of
122-
each type of user function.
120+
be created or modified by the user.
121+
libEnsemble includes many examples of each type.
123122

124-
* **Executor**: The executor can be used within user functions to provide a
125-
simple, portable interface for running and managing user tasks (applications).
126-
There are multiple executors including the base ``Executor`` and ``MPIExecutor``.
123+
* **Executor**: The executor provides a simple, portable interface for
124+
launching and managing user tasks (applications). Multiple executors are
125+
available, including the base ``Executor`` and ``MPIExecutor``.
127126

128-
* **Submit**: Enqueue or indicate that one or more jobs or tasks need to be
129-
launched. When using the libEnsemble Executor, a *submitted* task is executed
127+
* **Submit**: To enqueue or indicate that one or more jobs or tasks should be
128+
launched. When using the libEnsemble Executor, a *submitted* task is either executed
130129
immediately or queued for execution.
131130

132-
* **Tasks**: Sub-processes or independent units of work. Workers perform
133-
*tasks* as directed by the manager; tasks may include submitting external
131+
* **Tasks**: Subprocesses or independent units of work. Workers perform
132+
tasks as directed by the manager. Tasks may include launching external
134133
programs for execution using the Executor.
135134

136135
* **Persistent**: Typically, a worker communicates with the manager
137-
before and after initiating a user ``gen_f`` or ``sim_f`` calculation. However, user
138-
functions may also be constructed to communicate directly with the manager,
139-
for example, to efficiently maintain and update data structures instead of
140-
communicating them between manager and worker. These calculations
141-
and the workers assigned to them are referred to as *persistent*.
142-
143-
* **Resource Manager** libEnsemble has a built-in resource manager that can detect
144-
(or be provided with) a set of resources (e.g., a node-list). Resources are
145-
divided up among workers (using *resource sets*) and can be dynamically
136+
before and after initiating a user ``gen_f`` or ``sim_f`` calculation. Persistent user
137+
functions instead communicate directly with the manager during execution,
138+
allowing them to maintain and update data structures efficiently. These
139+
calculations and their assigned workers are referred to as *persistent*.
140+
141+
* **Resource Manager**: libEnsemble includes a built-in resource manager that can detect
142+
(or be provided with) available resources (e.g., a node list). Resources are
143+
divided among workers using *resource sets* and can be dynamically
146144
reassigned.
147145

148146
* **Resource Set**: The smallest unit of resources that can be assigned (and
149-
dynamically reassigned) to workers. By default it is the provisioned resources
150-
divided by the number of workers (excluding any workers given in the
151-
``zero_resource_workers`` libE_specs option). However, it can also be set
152-
directly by the ``num_resource_sets`` libE_specs option.
147+
dynamically reassigned) to workers. By default this is the provisioned resources
148+
divided by the number of workers (excluding any workers listed in the
149+
``zero_resource_workers`` ``libE_specs`` option). It can also be set
150+
explicitly using the ``num_resource_sets`` ``libE_specs`` option.
153151

154-
* **Slot**: The ``resource sets`` enumerated on a node (starting with zero). If
155-
a resource set has more than one node, then each node is considered to have slot
152+
* **Slot**: Resource sets enumerated on a node (starting from zero). If
153+
a resource set spans multiple nodes, each node is considered to have slot
156154
zero.

docs/spelling_wordlist.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ init
6666
instantiation
6767
intercommunications
6868
interoperable
69-
intitializing
69+
initializing
7070
intranode
7171
ints
7272
invocable

examples/tutorials/aposmm/aposmm_tutorial_notebook.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,7 @@
369369
"mimetype": "text/x-python",
370370
"name": "python",
371371
"nbconvert_exporter": "python",
372-
"pygments_lexer": "ipython3",
373-
"version": "3.13.1"
372+
"pygments_lexer": "ipython3"
374373
}
375374
},
376375
"nbformat": 4,

examples/tutorials/xopt_bayesian_gen/xopt_EI_example.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@
256256
"mimetype": "text/x-python",
257257
"name": "python",
258258
"nbconvert_exporter": "python",
259-
"pygments_lexer": "ipython3",
260-
"version": "3.12.11"
259+
"pygments_lexer": "ipython3"
261260
}
262261
},
263262
"nbformat": 4,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
globus-compute-sdk==4.6.0
1+
globus-compute-sdk==4.7.0

libensemble/tests/functionality_tests/test_asktell_sampling_external_gen.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
import numpy as np
1919
from gest_api.vocs import VOCS
2020

21-
# from gest_api.vocs import ContinuousVariable
21+
from libensemble import Ensemble
2222

2323
# Import libEnsemble items for this test
2424
from libensemble.alloc_funcs.start_only_persistent import only_persistent_gens as alloc_f
2525

2626
# from libensemble.gen_classes.external.sampling import UniformSampleArray
2727
from libensemble.gen_classes.external.sampling import UniformSample
28-
from libensemble import Ensemble
29-
from libensemble.specs import GenSpecs, SimSpecs, AllocSpecs, ExitCriteria, LibeSpecs
28+
from libensemble.specs import AllocSpecs, ExitCriteria, GenSpecs, LibeSpecs, SimSpecs
29+
30+
# from gest_api.vocs import ContinuousVariable
3031

3132

3233
def sim_f_array(In):

libensemble/tests/regression_tests/support.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import copy
22

33
import numpy as np
4+
45
from libensemble.specs import input_fields, output_data
56

67
branin_vals_and_minima = np.array(

libensemble/tests/regression_tests/test_1d_sampling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# TESTSUITE_NPROCS: 2 4
1515

1616
import numpy as np
17+
1718
from libensemble import Ensemble
1819
from libensemble.gen_funcs.sampling import latin_hypercube_sample as gen_f
1920

libensemble/tests/regression_tests/test_2d_sampling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# TESTSUITE_NPROCS: 2 4
1515

1616
import numpy as np
17+
1718
from libensemble import Ensemble
1819
from libensemble.gen_funcs.sampling import latin_hypercube_sample as gen_f
1920

0 commit comments

Comments
 (0)