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.
New: Try out the to generate customized scripts for running ensembles with your MPI applications.
Install libEnsemble and its dependencies from PyPI using pip:
pip install libensemble
Other install methods are described in the docs.
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:
importnumpyasnpfromlibensembleimportEnsemblefromlibensemble.gen_funcs.samplingimportuniform_random_samplefromlibensemble.sim_funcs.six_hump_camelimportsix_hump_camelfromlibensemble.specsimportExitCriteria, GenSpecs, LibeSpecs, SimSpecsif__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() ifsampling.is_manager: sampling.save_output(__file__) print("Some output data:\n", sampling.H[["x", "f"]][:10])Try some other examples live in Colab.
| Description | Try online |
|---|---|
| Simple Ensemble that makes a Sine wave. | |
| Ensemble with an MPI application. | |
| Optimization example that finds multiple minima. | |
| Surrogate model generation with gpCAM. |
There are many more examples in the regression tests and Community Examples repository.
Support:
- Ask questions or report issues on GitHub.
- Email
[email protected]to request libEnsemble Slack page. - Join the libEnsemble mailing list for updates about new releases.
Further Information:
- Documentation is provided by ReadtheDocs.
- Contributions to libEnsemble are welcome.
- Browse production functions and workflows in the Community Examples repository.
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} }