Skip to content

Commit

Permalink
additional docs cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ankona committed Oct 24, 2024
1 parent 3c5a8a3 commit 87319c5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 179 deletions.
15 changes: 8 additions & 7 deletions doc/api/smartsim_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,26 @@ Types of Containers:
Singularity


.. _rs-api:
.. _ls_api:

RunSettings
LaunchSettings
-----------


When running SmartSim on laptops and single node workstations,
the base ``RunSettings`` object is used to parameterize jobs.
``RunSettings`` include a ``run_command`` parameter for local
the base ``LaunchSettings`` object is used to parameterize jobs.
``LaunchSettings`` include a ``run_command`` parameter for local
launches that utilize a parallel launch binary like
``mpirun``, ``mpiexec``, and others.


.. autosummary::

RunSettings.add_exe_args
RunSettings.env_vars
RunSettings.launch_args
RunSettings.update_env

.. autoclass:: RunSettings
.. autoclass:: LaunchSettings
:inherited-members:
:undoc-members:
:members:
Expand Down
6 changes: 1 addition & 5 deletions doc/batch_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ launching capabilities tailored for specific workload managers (WLMs). Each Smar
`launcher` interfaces with a ``BatchSettings`` subclass specific to a system's WLM:

- The Slurm `launcher` supports:
- :ref:`SbatchSettings<sbatch_api>`
- The PBS Pro `launcher` supports:
- :ref:`QsubBatchSettings<qsub_api>`
- The LSF `launcher` supports:
- :ref:`BsubBatchSettings<bsub_api>`
- :ref:`LaunchSettings<ls_api>`

.. note::
The local `launcher` does not support batch jobs.
Expand Down
8 changes: 4 additions & 4 deletions doc/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Settings are given to ``Model`` and ``Ensemble`` objects to provide parameters f
Once a workflow component is initialized (e.g. ``Orchestrator``, ``Model`` or ``Ensemble``), a user has access
to the associated entity API which supports configuring and retrieving the entities' information:

* :ref:`Orchestrator API<orchestrator_api>`
* :ref:`Model API<model_api>`
* :ref:`FeatureStore API<feature_api>`
* :ref:`Application API<application_api>`
* :ref:`Ensemble API<ensemble_api>`

There is no limit to the number of SmartSim entities a user can
Expand Down Expand Up @@ -103,10 +103,10 @@ associated ``Experiment.create_...`` factory method shown below.
- Return Type
* - ``create_database``
- ``orch = exp.create_database([port, db_nodes, ...])``
- :ref:`Orchestrator <orchestrator_api>`
- :ref:`FeatureStore <feature_api>`
* - ``create_model``
- ``model = exp.create_model(name, run_settings)``
- :ref:`Model <model_api>`
- :ref:`Application <application_api>`
* - ``create_ensemble``
- ``ensemble = exp.create_ensemble(name[, params, ...])``
- :ref:`Ensemble <ensemble_api>`
Expand Down
167 changes: 4 additions & 163 deletions doc/run_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ for each job scheduler.

.. group-tab:: Slurm

The Slurm `launcher` supports the :ref:`SrunSettings API <srun_api>` as well as the :ref:`MpirunSettings API <openmpi_run_api>`,
:ref:`MpiexecSettings API <openmpi_exec_api>` and :ref:`OrterunSettings API <openmpi_orte_api>` that each can be used to run executables
with launch binaries like `"srun"`, `"mpirun"`, `"mpiexec"` and `"orterun"`. Below we step through initializing a ``SrunSettings`` and ``MpirunSettings``
The Slurm `launcher` supports the :ref:`LaunchSettings API <ls_api>` that can be
used to run executables with launch binaries like `"srun"`, `"mpirun"`, `"mpiexec"`
and `"orterun"`. Below we step through initializing a ``LaunchSettings``
instance on a Slurm based machine using the associated `run_command`.

**SrunSettings**
**LaunchSettings**

Run a job with the `srun` command on a Slurm based system. Any arguments passed in
the `run_args` dict will be converted into `srun` arguments and prefixed with `"--"`.
Expand All @@ -151,165 +151,6 @@ for each job scheduler.
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
**MpirunSettings**

Run a job with the `mpirun` command (MPI-standard) on a Slurm based system. Any
arguments passed in the `run_args` dict will be converted into `mpirun` arguments
and prefixed with `"--"`. Values of `None` can be provided for arguments that do
not have values.

.. code-block:: python
from smartsim import Experiment
# Initialize the Experiment and provide launcher Slurm
exp = Experiment("name-of-experiment", launcher="slurm")
# Initialize a MpirunSettings object
run_settings = exp.create_run_settings(exe="echo", exe_args="Hello World", run_command="mpirun")
# Set the number of cpus to use per task
run_settings.set_cpus_per_task(2)
# Set the number of tasks for this job
run_settings.set_tasks(100)
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
Users may replace `mpirun` with `mpiexec` or `orterun`.


.. note::
SmartSim will look for an allocation by accessing the associated WLM job ID environment variable. If an allocation
is present, the entity will be launched on the reserved compute resources. A user may also specify the allocation ID
when initializing a run settings object via the `alloc` argument. If an allocation is specified, the entity receiving
these run parameters will launch on that allocation.

.. group-tab:: PBS Pro
The PBS Pro `launcher` supports the :ref:`AprunSettings API <aprun_api>` as well as the :ref:`MpirunSettings API <openmpi_run_api>`,
:ref:`MpiexecSettings API <openmpi_exec_api>` and :ref:`OrterunSettings API <openmpi_orte_api>` that each can be used to run executables
with launch binaries like `"aprun"`, `"mpirun"`, `"mpiexec"` and `"orterun"`. Below we step through initializing a ``AprunSettings`` and ``MpirunSettings``
instance on a PBS Pro based machine using the associated `run_command`.

**AprunSettings**

Run a job with `aprun` command on a PBS Pro based system. Any arguments passed in
the `run_args` dict will be converted into `aprun` arguments and prefixed with `--`.
Values of `None` can be provided for arguments that do not have values.

.. code-block:: python
from smartsim import Experiment
# Initialize the experiment and provide launcher PBS Pro
exp = Experiment("name-of-experiment", launcher="pbs")
# Initialize a AprunSettings object
run_settings = exp.create_run_settings(exe="echo", exe_args="Hello World", run_command="aprun")
# Set the number of cpus to use per task
run_settings.set_cpus_per_task(2)
# Set the number of tasks for this job
run_settings.set_tasks(100)
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
**MpirunSettings**

Run a job with `mpirun` command on a PBS Pro based system. Any arguments passed
in the `run_args` dict will be converted into `mpirun` arguments and prefixed with `--`.
Values of `None` can be provided for arguments that do not have values.

.. code-block:: python
from smartsim import Experiment
# Initialize the experiment and provide launcher PBS Pro
exp = Experiment("name-of-experiment", launcher="pbs")
# Initialize a MpirunSettings object
run_settings = exp.create_run_settings(exe="echo", exe_args="Hello World", run_command="mpirun")
# Set the number of cpus to use per task
run_settings.set_cpus_per_task(2)
# Set the number of tasks for this job
run_settings.set_tasks(100)
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
Users may replace `mpirun` with `mpiexec` or `orterun`.

.. group-tab:: PALS
The PALS `launcher` supports the :ref:`MpiexecSettings API <openmpi_exec_api>` that can be used to run executables
with the `mpiexec` launch binary. Below we step through initializing a ``MpiexecSettings`` instance on a PALS
based machine using the associated `run_command`.

**MpiexecSettings**

Run a job with `mpiexec` command on a PALS based system. Any arguments passed in the `run_args` dict will be converted into `mpiexec` arguments and prefixed with `--`.
Values of `None` can be provided for arguments that do not have values.

.. code-block:: python
from smartsim import Experiment
# Initialize the experiment and provide launcher PALS
exp = Experiment("name-of-experiment", launcher="pals")
# Initialize a MpiexecSettings object
run_settings = exp.create_run_settings(exe="echo", exe_args="Hello World", run_command="mpiexec")
# Set the number of tasks for this job
run_settings.set_tasks(100)
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
.. group-tab:: LSF
The LSF `launcher` supports the :ref:`JsrunSettings API <jsrun_api>` as well as the :ref:`MpirunSettings API <openmpi_run_api>`,
:ref:`MpiexecSettings API <openmpi_exec_api>` and :ref:`OrterunSettings API <openmpi_orte_api>` that each can be used to run executables
with launch binaries like `"jsrun"`, `"mpirun"`, `"mpiexec"` and `"orterun"`. Below we step through initializing a ``JsrunSettings`` and ``MpirunSettings``
instance on a LSF based machine using the associated `run_command`.

**JsrunSettings**

Run a job with `jsrun` command on a LSF based system. Any arguments passed in the
`run_args` dict will be converted into `jsrun` arguments and prefixed with `--`.
Values of `None` can be provided for arguments that do not have values.

.. code-block:: python
from smartsim import Experiment
# Initialize the experiment and provide launcher LSF
exp = Experiment("name-of-experiment", launcher="lsf")
# Initialize a JsrunSettings object
run_settings = exp.create_run_settings(exe="echo", exe_args="Hello World", run_command="jsrun")
# Set the number of cpus to use per task
run_settings.set_cpus_per_task(2)
# Set the number of tasks for this job
run_settings.set_tasks(100)
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
**MpirunSettings**

Run a job with `mpirun` command on a LSF based system. Any arguments passed in the
`run_args` dict will be converted into `mpirun` arguments and prefixed with `--`.
Values of `None` can be provided for arguments that do not have values.

.. code-block:: python
from smartsim import Experiment
# Initialize the experiment and provide launcher LSF
exp = Experiment("name-of-experiment", launcher="lsf")
# Initialize a MpirunSettings object
run_settings = exp.create_run_settings(exe="echo", exe_args="Hello World", run_command="mpirun")
# Set the number of cpus to use per task
run_settings.set_cpus_per_task(2)
# Set the number of tasks for this job
run_settings.set_tasks(100)
# Set the number of tasks for this job
run_settings.set_tasks_per_node(25)
Users may replace `mpirun` with `mpiexec` or `orterun`.
.. group-tab:: Dragon
The Dragon `launcher` does not need any launch binary. Below we step through initializing a ``DragonRunSettings`` instance on a Slurm-
Expand Down

0 comments on commit 87319c5

Please sign in to comment.