Skip to content

Commit 35d39fa

Browse files
committed
Update configuration references and improve logging in ensemble example
- Corrected template file name in driver.py from `simpletemplate.conf` to `template.conf`. - Replaced service info logging with print statements in instance_component.py for better visibility during execution. - Added USE_PORTAL configuration option in platform.conf. - Expanded README.md to provide clearer instructions and details about the ensemble example.
1 parent 199cd16 commit 35d39fa

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# Simple ensemble example shows how to create an ensemble
1+
# Simple ensemble example
2+
3+
This shows how to run an ensemble for three instances.
4+
5+
Note that there will be Dask related errors and warnings at the end that can be
6+
ignored. These are due to Dask not having a clean shutdown.
7+
8+
## Contents
9+
10+
* `__init__.py` -- empty python init file
11+
* `driver.py` -- top-level driver
12+
* `instance_component.py` -- component worker code
13+
* `instance_driver.py` -- component driver code
14+
15+
* `ensemble.conf` -- top-level configuration file
16+
* `platform.conf` -- platform configuration file
17+
* `template.conf` -- ensemble instance configuration file
18+
19+
20+
## Instructions
21+
22+
To run the code, run:
23+
24+
```bash
25+
ips.py --platform platform.conf --simulation ensemble.conf
26+
```

examples-proposed/020-simple-ensemble/driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def step(self, timestamp=0.0):
3232
# correspond to the variable values. Naturally, the size of the lists
3333
# should be identical. Note that placeholders for these variables must
3434
# be defined in a special template IPS configuration file, in this case,
35-
# `simpletemplate.conf`.
35+
# `template.conf`.
3636
variables = {
3737
'instance_component': {
3838
'A': [3, 2, 4],

examples-proposed/020-simple-ensemble/instance_component.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def step(self, timestamp: float = 0.0, **keywords):
1212
# the `run_ensemble()` `name` argument prepended to a unique number
1313
# for each instance. E.g., ENSEMBLE_INSTANCE might be "MY_INSTANCE_23".
1414
instance_id = self.services.get_config_param('ENSEMBLE_INSTANCE')
15-
self.services.info(f'{instance_id}: Start of step of instance '
16-
f'component.')
17-
15+
print(f'{instance_id}: Start of step of instance '
16+
f'component.')
17+
1818
# Echo the parameters we're expecting, A, B, and C
19-
self.services.info(f'{instance_id}: instance component parameters: '
20-
f'A={self.A}, B={self.B}, C={self.C}')
19+
print(f'{instance_id}: instance component parameters: '
20+
f'A={self.A}, B={self.B}, C={self.C}')
2121

22-
self.services.info(f'{instance_id}: End of step of instance '
23-
f'component.')
22+
print(f'{instance_id}: End of step of instance '
23+
f'component.')

examples-proposed/020-simple-ensemble/platform.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ CORES_PER_NODE = 2
55
SOCKETS_PER_NODE = 1
66
NODE_ALLOCATION_MODE = shared
77
HOST = localhost
8-
SCRATCH =
8+
USE_PORTAL = False
9+
SCRATCH =

0 commit comments

Comments
 (0)