Skip to content

Commit

Permalink
styling
Browse files Browse the repository at this point in the history
  • Loading branch information
amandarichardsonn committed Sep 20, 2024
1 parent fc36311 commit ffcbbe0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions smartsim/builders/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ def __init__(
replicas: int = 1,
) -> None:
"""Initialize an ``Ensemble`` of Application instances
An Ensemble can be tailored to align with one of the following
creation strategies: parameter expansion or replicas.
**Parameter Expansion**
Parameter expansion allows users to assign different parameter values to
multiple Applications. This is done by specifying input to `Ensemble.file_parameters`,
`Ensemble.exe_arg_parameters` and `Ensemble.permutation_strategy`. The `permutation_strategy`
Expand All @@ -87,22 +87,22 @@ def __init__(
file_parameters=file_params,permutation_strategy="step")
This configuration will yield the following permutations:
.. highlight:: python
.. code-block:: python
[ParamSet(params={'SPAM': 'a', 'EGGS': 'c'}, exe_args={'EXE': ['a'], 'ARGS': ['d']}),
ParamSet(params={'SPAM': 'b', 'EGGS': 'd'}, exe_args={'EXE': ['b', 'c'], 'ARGS': ['e', 'f']})]
Each ParamSet contains the parameters assigned from file_params and the corresponding executable
arguments from exe_arg_parameters.
**Replication**
**Replication**
The replication strategy involves creating identical Applications within an Ensemble.
This is achieved by specifying the `replicas` argument in the Ensemble.
For example, by applying the `replicas` argument to the previous parameter expansion
example, we can double our Application output:
.. highlight:: python
.. code-block:: python
Expand All @@ -113,7 +113,7 @@ def __init__(
This configuration will result in each ParamSet being replicated, effectively doubling
the number of Applications created.
:param name: name of the ensemble
:param exe: executable to run
:param exe_args: executable arguments
Expand Down Expand Up @@ -345,4 +345,4 @@ def build_jobs(self, settings: LaunchSettings) -> tuple[Job, ...]:
apps = self._create_applications()
if not apps:
raise ValueError("There are no members as part of this ensemble")
return tuple(Job(app, settings, app.name) for app in apps)
return tuple(Job(app, settings, app.name) for app in apps)

0 comments on commit ffcbbe0

Please sign in to comment.