Skip to main content

Library to coordinate the concurrent evaluation of dynamic ensembles of calculations

Project description

libEnsemble

https://img.shields.io/pypi/v/libensemble.svg?color=blue https://img.shields.io/conda/v/conda-forge/libensemble?color=blue https://img.shields.io/spack/v/py-libensemble?color=blue

https://github.com/Libensemble/libensemble/actions/workflows/ci.yml/badge.svg?branch=develop https://codecov.io/github/Libensemble/libensemble/graph/badge.svg Documentation Status Code style: black

libEnsemble: A complete toolkit for dynamic ensembles of calculations

Adaptive, portable, and scalable software for connecting “deciders” to experiments or simulations.

  • 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.

libEnsemble is effective at solving design, decision, and inference problems on parallel resources.

Quickstart

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 via python this_file.py --comms local --nworkers 4:

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, SimSpecs
from libensemble.tools import add_unique_random_streams

if __name__ == "__main__":
    sampling = Ensemble(parse_args=True)
    sampling.sim_specs = SimSpecs(
        sim_f=six_hump_camel,
        inputs=["x"],
        outputs=[("f", float)],
    )
    sampling.gen_specs = GenSpecs(
        gen_f=uniform_random_sample,
        outputs=[("x", float, (2,))],
        user={
            "gen_batch_size": 500,
            "lb": np.array([-3, -2]),
            "ub": np.array([3, 2]),
        },
    )

    sampling.persis_info = add_unique_random_streams({}, sampling.nworkers + 1)
    sampling.exit_criteria = ExitCriteria(sim_max=101)
    sampling.run()
    sampling.save_output(__file__)

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

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}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libensemble-1.1.0.tar.gz (6.7 MB view details)

Uploaded Source

File details

Details for the file libensemble-1.1.0.tar.gz.

File metadata

  • Download URL: libensemble-1.1.0.tar.gz
  • Upload date:
  • Size: 6.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.16

File hashes

Hashes for libensemble-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3e3ddc4233272d3651e9d62c7bf420018930a4b9b135ef9ede01d5356235c1c6
MD5 961b8a607e51a0d807b52c04c3747f31
BLAKE2b-256 ad34e2558349e9191df3c5a6fee4152c962d6e244ac1a9a9026265e7cbc3c74f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page