-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
273 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
====== | ||
Summit | ||
====== | ||
|
||
Summit_ is an IBM AC922 system located at the Oak Ridge Leadership Computing Facility. | ||
Each of the approximately 4,600 compute nodes on Summit contains two IBM POWER9 processors and six NVIDIA Volta V100 accelerators. | ||
|
||
Summit features three tiers of nodes: login, launch, and compute nodes. | ||
Users on login nodes submit batch runs to the launch nodes. | ||
Launch nodes execute user batch-scripts to run on the compute nodes via ``jsrun``. | ||
|
||
Configuring Python | ||
------------------ | ||
|
||
Begin by loading the Python 3 Anaconda module:: | ||
|
||
$ module load python | ||
|
||
You can now create your own custom Conda_ environment:: | ||
|
||
conda create --name myenv python=3.7 | ||
|
||
Now activate environment:: | ||
|
||
export PYTHONNOUSERSITE=1 # Make sure get python from conda env | ||
. activate myenv | ||
|
||
If you are installing any packages with extensions, ensure the correct compiler module | ||
is loaded. If using mpi4py_, this must be installed from source, referencing the compiler. | ||
At time of writing, mpi4py must be built with gcc:: | ||
|
||
module load gcc | ||
|
||
With your environment activated:: | ||
|
||
CC=mpicc MPICC=mpicc pip install mpi4py --no-binary mpi4py | ||
|
||
Installing libEnsemble | ||
---------------------- | ||
|
||
Obtaining libEnsemble is now as simple as ``pip install libensemble``. | ||
Your prompt should be similar to the following line: | ||
|
||
.. code-block:: console | ||
(my_env) user@login5:~$ pip install libensemble | ||
.. note:: | ||
If you encounter pip errors, run ``python -m pip install --upgrade pip`` first | ||
|
||
Job Submission | ||
-------------- | ||
|
||
Summit uses LSF_ for job management and submission. For libEnsemble, the most | ||
important command is ``bsub``, for submitting batch scripts from the login nodes | ||
to execute on the Launch nodes. | ||
|
||
It is recommended to run libEnsemble on the Launch nodes (assuming workers are submitting | ||
MPI jobs) using ``local`` comm mode (multiprocessing). In the future, Balsam may be used | ||
to run libEnsemble on compute nodes. | ||
|
||
Interactive Runs | ||
^^^^^^^^^^^^^^^^ | ||
|
||
Users can run interactively with ``bsub`` by specifying the ``-Is`` flag, similarly | ||
to the following:: | ||
|
||
$ bsub -W 30 -P [project] -nnodes 8 -Is | ||
|
||
This will place the user on a launch node. Then, to launch MPI jobs to the compute | ||
nodes use ``jsrun`` where you would use ``mpirun``. | ||
|
||
.. note:: | ||
You will need to re-activate your conda virtual environment. | ||
|
||
Batch Runs | ||
^^^^^^^^^^ | ||
|
||
Batch scripts specify run-settings using ``#BSUB`` statements. The following | ||
simple example depicts configuring and launching libEnsemble to a launch node with | ||
multiprocessing. This script also assumes the user is using the ``parse_args()`` | ||
convenience function within libEnsemble's ``utils.py``. | ||
|
||
.. code-block:: bash | ||
#!/bin/bash -x | ||
#BSUB -P <project code> | ||
#BSUB -J libe_mproc | ||
#BSUB -W 60 | ||
#BSUB -nnodes 128 | ||
#BSUB -alloc_flags "smt1" | ||
# --- Prepare Python --- | ||
# Load conda module and gcc. | ||
module load python | ||
module load gcc | ||
# Name of Conda environment | ||
export CONDA_ENV_NAME=my_env | ||
# Activate Conda environment | ||
export PYTHONNOUSERSITE=1 | ||
source activate $CONDA_ENV_NAME | ||
# --- Prepare libEnsemble --- | ||
# Name of calling script | ||
export EXE=calling_script.py | ||
# Communication Method | ||
export COMMS='--comms local' | ||
# Number of workers. | ||
export NWORKERS='--nworkers 128' | ||
hash -r # Check no commands hashed (pip/python...) | ||
# Launch libE | ||
python $EXE $COMMS $NWORKERS > out.txt 2>&1 | ||
With this saved as ``myscript.sh``, allocating, configuring, and queueing | ||
libEnsemble on Summit becomes:: | ||
|
||
$ bsub script myscript.sh | ||
|
||
Additional Information | ||
---------------------- | ||
|
||
See the OCLF guides_ on for more information about Summit. | ||
|
||
.. _Summit: https://www.olcf.ornl.gov/for-users/system-user-guides/summit/ | ||
.. _LSF: https://www.olcf.ornl.gov/wp-content/uploads/2018/12/summit_workshop_fuson.pdf | ||
.. _guides: https://www.olcf.ornl.gov/for-users/system-user-guides/summit/ | ||
.. _Conda: https://conda.io/en/latest/ | ||
.. _mpi4py: https://mpi4py.readthedocs.io/en/stable/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ Programming with libEnsemble | |
.. toctree:: | ||
job_controller/jc_index | ||
logging | ||
|
||
.. toctree:: | ||
utilities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,9 @@ | ||
Utilities | ||
========= | ||
|
||
libEnsemble features several modules and tools to assist in writing consistent | ||
libEnsemble features a utilities module to assist in writing consistent | ||
calling scripts and user functions. | ||
|
||
Input consistency | ||
----------------- | ||
|
||
Users can check the formatting and consistency of ``exit_criteria`` and each | ||
``specs`` dictionary with the ``check_inputs()`` function from the ``utils`` | ||
module. Provide any combination of these data structures as keyword arguments. | ||
For example:: | ||
|
||
from libensemble.utils import check_inputs | ||
check_inputs(sim_specs=my-sim_specs, gen_specs=my-gen_specs, exit_criteria=ec) | ||
|
||
Parameters as command-line arguments | ||
------------------------------------ | ||
|
||
The ``parse_args()`` function can be used to pass common libEnsemble parameters as | ||
command-line arguments. | ||
|
||
In your calling script:: | ||
|
||
from libensemble.utils import parse_args | ||
nworkers, is_master, libE_specs, misc_args = parse_args() | ||
|
||
From the shell, for example:: | ||
|
||
$ python calling_script --comms local --nworkers 4 | ||
|
||
Usage: | ||
|
||
.. code-block:: bash | ||
usage: test_... [-h] [--comms [{local,tcp,ssh,client,mpi}]] | ||
[--nworkers [NWORKERS]] [--workers WORKERS [WORKERS ...]] | ||
[--workerID [WORKERID]] [--server SERVER SERVER SERVER] | ||
[--pwd [PWD]] [--worker_pwd [WORKER_PWD]] | ||
[--worker_python [WORKER_PYTHON]] | ||
[--tester_args [TESTER_ARGS [TESTER_ARGS ...]]] | ||
.. automodule:: utils | ||
:members: | ||
:no-undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.