You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nf-co2footprint plugin estimates the energy consumption for each pipeline task based on the Nextflow resource usage metrics and information about the power consumption of the underlying compute system.
@@ -19,16 +21,6 @@ developed in the Green Algorithms project: www.green-algorithms.org
19
21
The nf-co2footprint plugin generates a detailed TXT carbon footprint report containing the energy consumption, the estimated CO<sub>2</sub> emission and other relevant metrics for each task.
20
22
Additionally, an HTML report is generated with information about the carbon footprint of the whole pipeline run and containing plots showing, for instance, an overview of the CO<sub>2</sub> emissions for the different processes.
21
23
22
-
23
-
## Testing the plugin prior release
24
-
25
-
The plugin can be tested prior release without using a local Nextflow build using the following steps:
26
-
27
-
1. Build the plugin: `make buildPlugins`
28
-
2. Copy `build/plugins/nf-co2footprint-<version>` to `$HOME/.nextflow/plugins`
29
-
30
-
The details on how to build and test the plugin during development using a local Nextflow build you can find in the [nf-hello README](https://github.com/nextflow-io/nf-hello/tree/master#readme).
31
-
32
24
## Quick Start
33
25
34
26
Declare the plugin in your Nextflow pipeline configuration file:
Include the config file for your pipeline run using the `-c` Nextflow parameter, for example as follows:
34
+
This is all that is needed. Run your pipeline with the usual command.
60
35
61
-
```bash
62
-
nextflow run nextflow-io/hello -c nextflow.config
63
-
```
36
+
You can find more information on plugins in the [Nextflow documentation](https://www.nextflow.io/docs/latest/plugins.html#plugins).
64
37
65
-
The following parameters are currently available:
66
-
-`file`: Name of the TXT carbon footprint report containing the energy consumption, the estimated CO<sub>2</sub> emission and other relevant metrics for each task.
67
-
-`reportFile`: Name of the HTML report containing information about the entire carbon footprint, overview plots and more detailed task-specific metrics.
68
-
-`ci`: carbon intensity of the respective energy production.
69
-
-`pue`: power usage effectiveness, efficiency coefficient of the data centre.
70
-
-`powerdrawMem`: power draw from memory.
38
+
> [!NOTE]
39
+
> To test the plugin prior to its first release, refer to the [contributing documentation](contributing/setup.md).
A CO<sub>2</sub> equivalent (CO<sub>2</sub>e) is a metric used to compare the emissions from various greenhouse gases based on their impact on global warming.
11
+
12
+
For this, the amounts of other gases are converted to the amount of CO<sub>2</sub> that would have the same impact on global warming (over a 100-year period).
13
+
14
+
The equation used for the calculation of the carbon footprint ($C$) is:
15
+
16
+
$C = t * (n_c * P_c * u_c + n_m * P_m) * PUE * CI$
17
+
18
+
Being:
19
+
20
+
-**$t$** the running time of the computation (h)
21
+
-**$n_c$** the number of cores
22
+
-**$n_m$** the size of memory available (GB)
23
+
-**$u_c$** the core usage factor (between 0 and 1)
24
+
-**$P_c$** the power draw of a computing core (W)
25
+
-**$P_m$** the power draw of memory (W, per GB)
26
+
-**$PUE$** the efficiency coefficient of the data centre
27
+
-**$CI$** the carbon intensity of energy production, which represents carbon footprint of producing 1 kWh of energy for a given country and energy mix.
28
+
29
+
## References
30
+
31
+
> **Green Algorithms: Quantifying the Carbon Footprint of Computation.**
To compile and run the tests use the following command:
11
+
12
+
```bash
13
+
./gradlew check
14
+
```
15
+
16
+
## Launch without a local Nextflow build
17
+
18
+
The plugin can be tested prior release without using a local Nextflow build using the following steps:
19
+
20
+
1. Build the plugin:
21
+
```bash
22
+
make buildPlugins
23
+
2. Copy `build/plugins/nf-co2footprint-<version>` to `$HOME/.nextflow/plugins`
24
+
4. Run nextflow with this command:
25
+
26
+
```bash
27
+
./launch.sh run -plugins [email protected]<script/pipeline name> [pipeline params]
28
+
```
29
+
30
+
## Launch it with Nextflow
31
+
32
+
To test with Nextflow for development purpose:
33
+
34
+
1. Clone the Nextflow repo into a sibling directory
35
+
36
+
```bash
37
+
cd .. && https://github.com/nextflow-io/nextflow
38
+
cd nextflow && ./gradlew exportClasspath
39
+
```
40
+
41
+
2. Append the following line to the `settings.gradle`in this project:
42
+
43
+
```bash
44
+
includeBuild('../nextflow')
45
+
```
46
+
47
+
3. Compile the plugin code
48
+
49
+
```bash
50
+
./gradlew compileGroovy
51
+
```
52
+
53
+
4. Run nextflow with this command:
54
+
55
+
```bash
56
+
./launch.sh run -plugins nf-co2footprint <script/pipeline name> [pipeline params]
57
+
```
58
+
59
+
## Change and preview the docs
60
+
61
+
The docs are generated using [Material forMkDocs](https://squidfunk.github.io/mkdocs-material/). To change the docs, edit the filesin the [docs/](docs/) folder and run the following command to generate the docs (after installing mkdocs via `pip install mkdocs-material`):
62
+
63
+
```bash
64
+
mkdocs serve
65
+
```
66
+
67
+
To preview the docs, open the URL provided by mkdocs in your browser.
Include the config file for your pipeline run using the `-c` Nextflow parameter, for example as follows:
20
+
21
+
```bash
22
+
nextflow run nextflow-io/hello -c nextflow.config
23
+
```
24
+
25
+
The following parameters are currently available:
26
+
27
+
-`file`: Name of the TXT carbon footprint report containing the energy consumption, the estimated CO<sub>2</sub> emission and other relevant metrics for each task.
28
+
-`reportFile`: Name of the HTML report containing information about the entire carbon footprint, overview plots and more detailed task-specific metrics.
29
+
-`ci`: carbon intensity of the respective energy production.
30
+
-`pue`: power usage effectiveness, efficiency coefficient of the data centre.
<p>These plots give an overview of the distribution of resource usage for each process.
196
-
A CO<sub>2</sub> equivalent (CO<sub>2</sub>e) is a metric used to compare the emissions from various greenhouse gases based on their impact on global warming.
197
-
For this, the amounts of other gases are converted to the amount of CO<sub>2</sub> that would have the same impact on global warming (over a 100-year period).
0 commit comments