Skip to content

Commit

Permalink
Merge pull request #269 from jlnav/libensemble-1.0
Browse files Browse the repository at this point in the history
Update libensemble page for v1.0
  • Loading branch information
felker authored Oct 18, 2023
2 parents 20d8fa8 + 7ab17b3 commit e39df7f
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions docs/polaris/workflows/libensemble.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# libEnsemble

libEnsemble is a Python toolkit for running dynamic ensembles of calculations. Users provide generator and simulator functions to express their ensembles, where the generator can steer the ensemble based on previous results. A library of example functions is available which can be modified as needed. These functions can submit external executables at any scale and in a portable way. System details are detected, and dynamic resource management is provided. libEnsemble can be used in a consistent manner on laptops, clusters, and supercomputers with minimal required dependencies.
[libEnsemble](https://libensemble.readthedocs.io/en/main/) is a Python toolkit for running dynamic ensembles of calculations.

Users provide generator and simulator functions to express their ensembles, where the generator can steer the ensemble based on previous results. These functions can portably submit external executables at any scale.

System details are detected, and dynamic resource management is provided. This includes automatically detecting, assigning, and reassigning
GPUs for ensemble members.

libEnsemble can be used in a consistent manner on laptops, clusters, and supercomputers with minimal required dependencies.

## Getting libEnsemble on Polaris

Expand All @@ -22,7 +29,7 @@ See the docs for more details on using [python on Polaris](https://docs.alcf.anl
. /path/to-venv/bin/activate
```

Where /path/to-venv can be anywhere you have write access.
Where ``/path/to-venv`` can be anywhere you have write access.
For future uses just load the conda module and run the activate line.

You can also ensure you are using the latest version of libEnsemble:
Expand All @@ -35,25 +42,23 @@ See the docs for more details on using [python on Polaris](https://docs.alcf.anl

## libEnsemble examples

For a very simple example of using libEnsemble see the [Simple Sine tutorial](https://libensemble.readthedocs.io/en/main/tutorials/local_sine_tutorial.html)
For a very simple example of using libEnsemble see the [Simple Introduction tutorial](https://libensemble.readthedocs.io/en/main/tutorials/local_sine_tutorial.html)

For an example that runs a small ensemble using a C application (offloading work to the GPU), see
[the GPU app tutorial](https://libensemble.readthedocs.io/en/main/tutorials/forces_gpu_tutorial.html). The required files for the this tutorial can be found in [this directory](https://github.com/Libensemble/libensemble/tree/develop/libensemble/tests/scaling_tests/forces). Also, see the
[video demo](https://youtu.be/Ff0dYYLQzoU).

Note that when initializing the MPIExecutor on Polaris (**run_libe_forces.py** in the example), you currently need to use the following options to pick up the correct MPI runner:

exctr = MPIExecutor(custom_info={'mpi_runner':'mpich', 'runner_name':'mpiexec'})
[the GPU app tutorial](https://libensemble.readthedocs.io/en/main/tutorials/forces_gpu_tutorial.html).
The required files for this tutorial can be found
in [this directory](https://github.com/Libensemble/libensemble/tree/main/libensemble/tests/scaling_tests/forces).
A [video demo](https://youtu.be/Ff0dYYLQzoU) is also available.

## Job Submission

libEnsemble runs on the compute nodes on Polaris using either
``multi-processing`` or ``mpi4py``. The user can set the number of workers for
libEnsemble runs on the compute nodes on Polaris using either Python's
``multiprocessing`` or ``mpi4py``. The user can set the number of workers for
maximum concurrency. libEnsemble will detect the nodes available
from the PBS environment and use these for running simulations. Polaris supports
running multiple concurrent simulations on each node if desired,
running multiple concurrent simulations on each node if desired.

A simple example batch script for a libEnsemble use case that runs four workers on one node:
A simple example batch script for a libEnsemble use case that runs five workers on one node:

```shell
#!/bin/bash -l
Expand All @@ -65,7 +70,7 @@ A simple example batch script for a libEnsemble use case that runs four workers

export MPICH_GPU_SUPPORT_ENABLED=1
cd $PBS_O_WORKDIR
python run_libe_forces.py --comms local --nworkers 4
python run_libe_forces.py --comms local --nworkers 5
```

The script can be run with:
Expand Down

0 comments on commit e39df7f

Please sign in to comment.