Skip to main content

libEnsemble

PyPI Conda Spack

Tests Coverage Documentation Status Code style: black JOSS Status

libEnsemble: A complete toolkit for dynamic ensembles of calculations

libEnsemble empowers model-driven ensembles to solve design, decision, and inference problems on the world’s leading supercomputers such as Frontier, Aurora, and Perlmutter.

  • Dynamic ensembles: Generate parallel tasks on-the-fly based on previous computations.

  • Extreme portability and scaling: Run on or across laptops, clusters, and leadership-class machines.

  • Heterogeneous computing: Dynamically and portably assign CPUs, GPUs, or multiple nodes.

  • Application monitoring: Ensemble members can run, monitor, and cancel apps.

  • Data-flow between tasks: Running ensemble members can send and receive data.

  • Low start-up cost: No additional background services or processes required.

Quickstart

New: libEnsemble nows supports the gest-api generator standard, and can run with Optimas and Xopt generators.

The Script Creator to generate customized scripts for running ensembles with your MPI applications.

Installation

Install libEnsemble and its dependencies from PyPI using pip:

pip install libensemble

Other install methods are described in the docs.

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:

import numpy as np

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

if __name__ == "__main__":

    libE_specs = LibeSpecs(nworkers=4)

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

    gen_specs = GenSpecs(
        gen_f=uniform_random_sample,
        outputs=[("x", float, 2)],
        user={
            "gen_batch_size": 50,
            "lb": np.array([-3, -2]),
            "ub": np.array([3, 2]),
        },
    )

    exit_criteria = ExitCriteria(sim_max=100)

    sampling = Ensemble(
        libE_specs=libE_specs,
        sim_specs=sim_specs,
        gen_specs=gen_specs,
        exit_criteria=exit_criteria,
    )

    sampling.add_random_streams()
    sampling.run()

    if sampling.is_manager:
        sampling.save_output(__file__)
        print("Some output data:\n", sampling.H[["x", "f"]][:10])

Inline Example

Try some other examples live in Colab.

Description

Try online

Simple Ensemble that makes a Sine wave.

Simple Ensemble

Ensemble with an MPI application.

Ensemble with an MPI application

Optimization example that finds multiple minima.

Optimization example

Surrogate model generation with gpCAM.

Surrogate Modeling

Bayesian Optimization with Xopt.

Bayesian Optimization with Xopt

There are many more examples in the regression tests and Community Examples repository.

Resources

Support:

Further Information:

Cite libEnsemble:

@article{Hudson2022,
  title   = {{libEnsemble}: A Library to Coordinate the Concurrent
             Evaluation of Dynamic Ensembles of Calculations},
  author  = {Stephen Hudson and Jeffrey Larson and John-Luke Navarro and Stefan M. Wild},
  journal = {{IEEE} Transactions on Parallel and Distributed Systems},
  volume  = {33},
  number  = {4},
  pages   = {977--988},
  year    = {2022},
  doi     = {10.1109/tpds.2021.3082815}
}

Metadata

Release files for libensemble 1.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libensemble 1.6.1
File Size Uploaded
libensemble-1.6.1.tar.gz 7.2 MB Details

Release files / libensemble-1.6.1.tar.gz

Download URL libensemble-1.6.1.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
a3f44cf0bc2196b3fa9e8d343911d1799f09166cddc8e0f0c457249ddeef1827
BLAKE2b-256 checksum
How to use checksums
8a857b4a4bea11f40e53f8099a9978079e6b9a84b734d660258e10a1d9787378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.6.1 This release

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.10.2

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page