Skip to content

Commit d54ec48

Browse files
authored
Merge pull request #9 from Raiduy/codecarbon-update
Codecarbon update
2 parents 79242c5 + 94d0191 commit d54ec48

File tree

4 files changed

+7
-52
lines changed

4 files changed

+7
-52
lines changed

README.md

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -74,50 +74,5 @@ python experiment-runner/ <MyRunnerConfig.py>
7474

7575
The results of the experiment will be stored in the directory `RunnerConfig.results_output_path/RunnerConfig.name` as defined by your config variables.
7676

77-
### Events
77+
**More information about the profilers and use cases can be found in the [Wiki tab](https://github.com/S2-group/experiment-runner/wiki).**
7878

79-
When a user experiment is run, the following list of events are raised in order automatically by Experiment Runner:
80-
81-
- `BEFORE_EXPERIMENT` - Invoked only once.
82-
- For each variation, the following events are raised in order:
83-
1. `BEFORE_RUN` Invoked before each variation
84-
2. `START_RUN`
85-
3. `START_MEASUREMENT`
86-
4. `INTERACT`
87-
5. `CONTINUE` - Only to be used by `OperationType.SEMI` configs. (Not automatically subscribed to by the generated config.)
88-
6. `STOP_MEASUREMENT`
89-
7. `STOP_RUN`
90-
8. `POPULATE_RUN_DATA`
91-
9. Wait for `RunnerConfig.time_between_runs_in_ms` milliseconds
92-
- `AFTER_EXPERIMENT` - Invoked only once.
93-
94-
*TODO: Add visualization similar to [robot-runner timeline of events](documentation/ICSE_2021.pdf)*
95-
96-
Variations are automatically created by the Experiment Runner in accordance to the user-defined run table (Factors, Treatment levels, and variation exclusions).
97-
98-
Further detailed description of the events and their expected callback behavior can be found in the generated config. One thing to notice in the config is that, each callback function that is associated with a variation, accepts a `context: RunnerContext` parameter that describes the current variation.
99-
100-
## Internal Details
101-
102-
The framework offers an automation of the infrastructure overhead for measurement-based empirical experiments, as a consequence of its design, produced by the following **design drivers**:
103-
104-
- **User Authority**: Give the user full authority over the experiment execution in the Python-based configuration file.
105-
- **Focus on Orchestration**: Orchestrate the experiment on the basis of *events*. These events are characterized by their *moment of execution* in any experiment.
106-
- **Focus on Supporting Infrastructure**: Offer the user all, potentially necessary, supporting features (e.g. factors and treatment levels).
107-
108-
Experiment Runner consists of the following **components**:
109-
110-
- **Experiment orchestrator**: Is in charge of executing the whole experiment according to the experiment configuration provided by the user.
111-
- **Event manager**: Provides the user with subscribable events, to which callback methods can be set, which are called at the appropriate time by the Experiment Orchestrator.
112-
- **Progress manager**: Keeps track of the execution of each run of the experiment.
113-
- **Config Validator**: Provides a validation of a user's configuration file and checks system readiness.
114-
115-
*TODO: Add visualization similar to [robot-runner overview](documentation/overview.png)*
116-
117-
When Experiment Runner is passed a user-defined experiment config via command line arguments, it will:
118-
119-
- Validate the config
120-
- Output the config's values as read by Experiment Runner in the console for user validation
121-
- Create the experiment folder
122-
- Create the run table (.csv), and persist it in the experiment folder
123-
- Execute the experiment on a per-variation basis, going over each variation with its specified treatments in the run table.
File renamed without changes.

experiment-runner/Plugins/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pip install codecarbon
2222
To simply measure CO2 emissions (kg) and total energy consumed (kWh) and append them as data columns, use the following snippet:
2323

2424
```python
25-
from Plugins import CodecarbonWrapper
26-
from Plugins.CodecarbonWrapper import DataColumns as CCDataCols
25+
from Plugins.Profilers import CodecarbonWrapper
26+
from Plugins.Profilers.CodecarbonWrapper import DataColumns as CCDataCols
2727

2828
@CodecarbonWrapper.emission_tracker(
2929
data_columns=[CCDataCols.EMISSIONS, CCDataCols.ENERGY_CONSUMED],
@@ -38,8 +38,8 @@ This will add `codecarbon__emissions` and `codecarbon__energy_consumed` data col
3838
For a more fine-grained approach, the above snippet is equivalent to the following:
3939

4040
```python
41-
from Plugins import CodecarbonWrapper
42-
from Plugins.CodecarbonWrapper import DataColumns as CCDataCols
41+
from Plugins.Profilers import CodecarbonWrapper
42+
from Plugins.Profilers.CodecarbonWrapper import DataColumns as CCDataCols
4343

4444
class RunnerConfig:
4545

test/Plugins/test_CodecarbonWrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from ConfigValidator.Config.RunnerConfig import RunnerConfig
1111
from ProgressManager.Output.OutputProcedure import OutputProcedure as output
1212

13-
from Plugins import CodecarbonWrapper
14-
from Plugins.CodecarbonWrapper import DataColumns as CCDataCols
13+
from Plugins.Profilers import CodecarbonWrapper
14+
from Plugins.Profilers.CodecarbonWrapper import DataColumns as CCDataCols
1515

1616

1717
class TestEmissionTrackerIndividual(unittest.TestCase):

0 commit comments

Comments
 (0)