Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions doc/source/user_guide/installation_perlmutter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,42 @@ environment, in which to install `optimas`.

python3 -m pip install optimas

Running
~~~~~~~
Running an optimas job
~~~~~~~~~~~~~~~~~~~~~~

Before using `optimas`, execute the following commands to activate
the virtual environment:
In order to run a new optimas job, create a new folder in the ``$SCRATCH``
directory, and add the files needed to describe your optimization, i.e. typically:

* a file ``run_optimization.py``
* a template simulation input script
* a file ``analysis_script.py`` that postprocesses the simulation results

(See a typical example `here <https://github.com/optimas-org/optimas/tree/main/examples/ionization_injection>`_.)

Then, create a file ``submission_script`` with the following content:

::

#!/bin/bash -l
#SBATCH -t <walltime>
#SBATCH -N <n_nodes>
#SBATCH -A <nersc_account>
#SBATCH -C gpu
#SBATCH -q regular
#SBATCH --exclusive
#SBATCH --gpu-bind=none
#SBATCH --gpus-per-node=4

module load cray-python/3.9.13.1
source $HOME/sw/perlmutter/gpu/venvs/optimas/bin/activate

python run_optimization.py

where ``<walltime>``, ``<n_nodes>`` and ``<nersc_account>`` should be replaced
by the wall time, number of nodes and NERSC account number that you want to use.

Then run:

::

sbatch submission_script