Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f9c290a
remove some mentions of pyyaml and tomli. bump the version in the spa…
jlnav Apr 14, 2026
b1391e7
modernize initial programming_libe example. Adjust ensemble.py to onl…
jlnav Apr 14, 2026
d1f6c82
Merge branch 'develop' into docs/pre_2_adjusts
jlnav Apr 17, 2026
0119813
nitpicky
jlnav Apr 17, 2026
fcb005a
trying out Furo theme in docs
jlnav Apr 20, 2026
5e0ac53
deps
jlnav Apr 20, 2026
41734b7
terse-er wording
jlnav Apr 21, 2026
f3d2125
tentative update of README example for v2.0
jlnav Apr 23, 2026
ba2d662
remove alloc mention from overview_usecases. it's too deep, too much …
jlnav Apr 23, 2026
64177b7
fixes to ensemble.py docstring
jlnav Apr 23, 2026
d493418
claude-assisted dramatic improvement towards ensemble.ready()
jlnav Apr 23, 2026
117dc47
monospacing adjusts
jlnav Apr 23, 2026
a1519bb
Merge branch 'develop' into docs/pre_2_adjusts
jlnav Apr 23, 2026
5bb30fb
Claude-audited specs docs. Specify standardized sims/gens approaches
jlnav Apr 23, 2026
1504c23
remove summit docs. move Resources and History sections to Additional…
jlnav Apr 23, 2026
8d8ad6f
move work_dict and worker_array info to dev guide section
jlnav Apr 24, 2026
c02acba
simply enough, clarify in SUPPORT.rst that issues can be opened
jlnav Apr 24, 2026
2be8f23
remove sim_gen_alloc_api - it had become redundant compared to the ex…
jlnav Apr 24, 2026
6e1f4e6
tabbed content refactoring - gen_f/sim_f references point to the func…
jlnav Apr 24, 2026
d46335c
remove some redundant content. emphasize simulator-workers
jlnav Apr 24, 2026
81953fe
remove zero-resource-workers mention
jlnav Apr 24, 2026
7600b39
more pixi info. update executor overview. mypy fixes
jlnav Apr 24, 2026
d503a69
small tweaks. remove summit_submir_mproc.sh. refer to calling scripts…
jlnav Apr 24, 2026
9f7cd89
fix persis_info examples
jlnav Apr 28, 2026
4c26b07
updating history_array.rst for gest-api considerations. remove more s…
jlnav Apr 28, 2026
c192b1c
additional AGENTS.md considerations. New writing-a-new-simf tab
jlnav Apr 28, 2026
56d57e6
convert Executor pages to single page with tabs for Overview, Base, MPI
jlnav Apr 28, 2026
5e09359
standardized APOSMM example
jlnav Apr 28, 2026
9034598
fix test
jlnav Apr 28, 2026
86fbd07
Merge branch 'develop' into docs/pre_2_adjusts
jlnav Apr 29, 2026
89de7f1
I guess sections cant be within tabs, unfortunately?
jlnav Apr 29, 2026
3dff0bf
refactors of generator and simulator guides using pytorch tutorials a…
jlnav Apr 29, 2026
699e06f
move alloc_f data into one page in Additional References
jlnav Apr 30, 2026
bb81e03
remove xSDK_policy_compatibility. They have our older compatibility.m…
jlnav May 1, 2026
1d8d60d
remove posters.rst - this content is/will-be very out-of-date
jlnav May 1, 2026
76df2dc
remove more Summit/Sierra code/docs on this branch too
jlnav May 1, 2026
2782abc
Merge branch 'develop' into docs/pre_2_adjusts
jlnav May 6, 2026
d83fc90
large refactoring, replacing many uses of tabs throughout with tabbed…
jlnav May 6, 2026
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: 0 additions & 4 deletions .claude/skills/generate-scripts/references/aposmm.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ When using a SciPy method, must also supply `opt_return_codes` — e.g. [0] for
| `lhs_divisions` | int | Latin hypercube partitions (0 or 1 = uniform) |
| `rk_const` | float | Multiplier for r_k value |

## Worker Configuration

With `gen_on_manager=True`, the persistent generator runs on the manager process and all `nworkers` are available for simulations.

## Local Optimizer Methods

### SciPy (no extra install)
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ repos:
rev: v1.19.1
hooks:
- id: mypy
exclude: ^libensemble/utils/(launcher|loc_stack|runners|pydantic|output_directory)\.py$|libensemble/tests/(regression_tests|functionality_tests|unit_tests|scaling_tests)/.*
exclude: ^docs/conf\.py$|libensemble/utils/(launcher|loc_stack|runners|pydantic|output_directory)\.py$|libensemble/tests/(regression_tests|functionality_tests|unit_tests|scaling_tests)/.*
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Information about Generators
Its fields match ``sim_specs/gen_specs["out"]`` or ``vocs`` attributes, plus additional reserved fields for metadata.
- Prior to libEnsemble v1.6.0, generators were plain functions. They often ran in "persistent" mode, meaning they executed in a
long-running loop, sending and receiving points to and from the manager until the ensemble was complete.
- A ``gest-api`` or "standardized" generator is a class that at a minimum implements ``suggest`` and ``ingest`` methods, and is parameterized by a ``vocs``.
- See ``libensemble/generators.py`` for more information about the ``gest-api`` standard.
- A ``gest-api`` or "standardized" generator is a class that inherits from ``gest_api.Generator``, implements ``suggest`` and ``ingest`` methods (which process lists of dictionaries, not NumPy arrays), and is parameterized by a ``vocs``.
- See ``libensemble/gen_classes/external/sampling.py`` for simple examples of the pure ``gest-api`` interface. (Note: ``libensemble.generators.LibensembleGenerator`` exists to wrap legacy NumPy-based workflows, but pure ``gest_api.Generator`` is preferred).
- Generators are often used for simple sampling, optimization, calibration, uncertainty quantification, and other simulation-based tasks.
- **Automatic Variable Mapping**: Subclasses of ``LibensembleGenerator`` (like ``UniformSample``) automatically map all ``VOCS`` variables to a single multi-dimensional ``"x"`` field in the History array if no explicit ``variables_mapping`` is provided.
- **Automatic Variable Mapping**: When using ``LibensembleGenerator`` subclasses, they automatically map all ``VOCS`` variables to a single multi-dimensional ``"x"`` field in the History array if no explicit ``variables_mapping`` is provided. Pure ``gest_api.Generator`` classes handle variables natively.
- **Mandatory Input Fields**: Even for simple generators that don't ingest data, ``gen_specs["in"]`` or ``gen_specs["persis_in"]`` must be defined if using an allocation function like ``only_persistent_gens`` that attempts to send rows. If these are empty, the manager will raise an ``AssertionError`` stating that no fields were requested to be sent.
- **Default Allocator**: ``only_persistent_gens`` is the default allocator for standardized ``gest-api`` generators. It treats these generators as persistent entities that communicate throughout the run.

Expand Down Expand Up @@ -97,3 +97,5 @@ When modernizing existing libEnsemble scripts (functionality tests, regression t
- **Remove Explicit `AllocSpecs`**: In libEnsemble 2.0, `only_persistent_gens` is the default allocator. Scripts that previously used `give_sim_work_first` or other simple allocators can often remove `alloc_specs` entirely when switching to standardized generators.
- **Generator Placement**: By default, generators run on the manager thread (Worker 0). This means all allocated workers are available for simulation tasks unless `gen_on_worker` is explicitly set to `True` in `libE_specs`.
- **Mandatory Fields**: Ensure `gen_specs["in"]` or `gen_specs["persis_in"]` includes at least one field (e.g., `["sim_id"]`) if feedback is sent back to the generator, to satisfy the allocator's requirements.
- **gest-api Simulators**: The gest-api pattern also applies to simulators. Set `SimSpecs.simulator` to a callable with signature `(input_dict: dict, **kwargs) -> dict` instead of providing a `sim_f`. libEnsemble automatically wraps it with `gest_api_sim` from `libensemble.sim_funcs.gest_api_wrapper` and handles all NumPy conversions. `SimSpecs.inputs` and `SimSpecs.outputs` can be derived automatically when `SimSpecs.vocs` is provided.
- **`safe_mode` is opt-in**: `libE_specs["safe_mode"]` defaults to `False`, meaning protected History fields (`gen_worker`, `gen_started_time`, `gen_ended_time`, `sim_worker`, `sim_started`, `sim_started_time`, `sim_ended`, `sim_ended_time`, `gen_informed`, `gen_informed_time`, `kill_sent`) are freely overwritable by default. Set `safe_mode=True` to enable protection. Overwriting these fields without understanding their purpose may crash libEnsemble.
26 changes: 18 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,49 @@ Basic Usage
===========

Create an ``Ensemble``, then customize it with general settings, simulation and generator parameters,
and an exit condition. Run the following four-worker example via ``python this_file.py``:
and an exit condition.

.. code-block:: python

import numpy as np
from gest_api.vocs import VOCS

from libensemble import Ensemble
from libensemble.gen_funcs.sampling import uniform_random_sample
from libensemble.gen_classes.sampling import UniformSample
from libensemble.sim_funcs.six_hump_camel import six_hump_camel
from libensemble.specs import ExitCriteria, GenSpecs, LibeSpecs, SimSpecs

if __name__ == "__main__":
# Define problem using VOCS
vocs = VOCS(
variables={"x": [-3, 3], "y": [-2, 2]},
objectives={"f": "MINIMIZE"},
)

# General settings
libE_specs = LibeSpecs(nworkers=4)

# Simulation parameters
sim_specs = SimSpecs(
sim_f=six_hump_camel,
inputs=["x"],
outputs=[("f", float)],
)

# Generator parameters (standardized generator)
gen_specs = GenSpecs(
gen_f=uniform_random_sample,
generator=UniformSample(vocs),
inputs=["sim_id"],
persis_in=["x", "f"],
outputs=[("x", float, 2)],
user={
"gen_batch_size": 50,
"lb": np.array([-3, -2]),
"ub": np.array([3, 2]),
},
vocs=vocs,
user={"gen_batch_size": 50},
)

# Exit criteria
exit_criteria = ExitCriteria(sim_max=100)

# Create and run ensemble
sampling = Ensemble(
libE_specs=libE_specs,
sim_specs=sim_specs,
Expand Down
4 changes: 4 additions & 0 deletions SUPPORT.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Support
-------

Open issues on Github at:

* https://github.com/Libensemble/libensemble/issues

Join the libEnsemble mailing list at:

* https://lists.mcs.anl.gov/mailman/listinfo/libensemble
Expand Down
Binary file added docs/_static/libE_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/libE_logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
199 changes: 0 additions & 199 deletions docs/advanced_installation.rst

This file was deleted.

41 changes: 41 additions & 0 deletions docs/advanced_installation/advanced_installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Advanced Installation
=====================

`pip <advanced_installation_pip.html>`__ \|\| `uv <advanced_installation_uv.html>`__ \|\| `pixi <advanced_installation_pixi.html>`__ \|\| `conda <advanced_installation_conda.html>`__ \|\| `Spack <advanced_installation_spack.html>`__

libEnsemble can be installed from ``pip``, ``uv``, ``pixi``, ``Conda``, or ``Spack``.

libEnsemble requires the following dependencies, which are typically
automatically installed alongside libEnsemble:

* Python_ ``>= 3.11``
* NumPy_ ``>= 1.21``
* psutil_ ``>= 5.9.4``
* `pydantic`_ ``>= 2``
* gest-api_ ``>= 0.1,<0.2``

We recommend installing in a virtual environment from ``uv``, ``conda`` or another source.

Further recommendations for selected HPC systems are given in the
:ref:`HPC platform guides<platform-index>`.

.. toctree::
:hidden:

advanced_installation_pip
advanced_installation_uv
advanced_installation_pixi
advanced_installation_conda
advanced_installation_spack

Globus Compute
--------------

`Globus Compute`_ may be installed optionally to submit simulation function instances to remote Globus Compute endpoints.

.. _Globus Compute: https://www.globus.org/compute
.. _Python: http://www.python.org
.. _NumPy: http://www.numpy.org
.. _psutil: https://pypi.org/project/psutil/
.. _pydantic: https://docs.pydantic.dev/1.10/
.. _gest-api: https://github.com/campa-consortium/gest-api
49 changes: 49 additions & 0 deletions docs/advanced_installation/advanced_installation_conda.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
conda
=====

`Advanced Installation <advanced_installation.html>`__ \|\| `pip <advanced_installation_pip.html>`__ \|\| `uv <advanced_installation_uv.html>`__ \|\| `pixi <advanced_installation_pixi.html>`__ \|\| **conda** \|\| `Spack <advanced_installation_spack.html>`__

Install libEnsemble with Conda_ from the conda-forge channel::

conda config --add channels conda-forge
conda install -c conda-forge libensemble

This package comes with some useful optional dependencies, including
optimizers and will install quickly as ready binary packages.

**Installing with mpi4py with Conda**

If you wish to use ``mpi4py`` with libEnsemble (choosing MPI out of the three
:doc:`communications options<../running_libE>`), you can use the
following.

.. note::
For clusters and HPC systems, always install ``mpi4py`` to use the
system MPI library (see pip instructions above).

For a standalone build that comes with an MPI implementation, you can install
libEnsemble using one of the following variants.

To install libEnsemble with MPICH_::

conda install -c conda-forge libensemble=*=mpi_mpich*

To install libEnsemble with `Open MPI`_::

conda install -c conda-forge libensemble=*=mpi_openmpi*

The asterisks will pick up the latest version and build.

.. note::
This syntax may not work without adjustments on macOS or any non-bash
shell. In these cases, try::

conda install -c conda-forge libensemble='*'=mpi_mpich'*'

For a complete list of builds for libEnsemble on Conda::

conda search libensemble --channel conda-forge

.. _Conda: https://docs.conda.io/en/latest/
.. _MPICH: https://www.mpich.org/
.. _Open MPI: https://www.open-mpi.org/
Loading
Loading