Skip to content

Commit ac3fedf

Browse files
authored
Merge branch 'dev' into extend_readme
2 parents 44fe992 + 37bf8a2 commit ac3fedf

File tree

3 files changed

+13
-58
lines changed

3 files changed

+13
-58
lines changed

plugins/nf-co2footprint/src/main/nextflow/co2footprint/CO2FootprintFactory.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class CO2FootprintFactory implements TraceObserverFactory {
142142
// TODO if requested more than used, this is not taken into account, right?
143143
Double cpu_usage = trace.get('%cpu') as Double
144144
if ( cpu_usage == null ) {
145-
log.warn "cpu_usage is null"
145+
log.debug "cpu_usage is null"
146146
// TODO why is value null, because task was finished so fast that it was not captured? Or are there other reasons?
147147
// Assuming requested cpus were used with 100%
148148
cpu_usage = nc * 100

plugins/nf-co2footprint/src/resources/CO2FootprintReportTemplate.html

+9-54
Original file line numberDiff line numberDiff line change
@@ -142,68 +142,18 @@ <h4>Workflow execution completed unsuccessfully!</h4>
142142
(<span id="completed_fromnow"></span>duration: <strong>${workflow.duration}</strong>)
143143
</dd>
144144

145-
<dl>
146-
<div class="progress" style="height: 1.6rem; margin: 1.2rem auto; border-radius: 0.20rem;">
147-
<div style="width: ${workflow.stats.succeedPct}%" class="progress-bar bg-success" data-toggle="tooltip" data-placement="top" title="$workflow.stats.succeedCount tasks succeeded"><span class="text-truncate">&nbsp; $workflow.stats.succeedCount succeeded &nbsp;</span></div>
148-
<div style="width: ${workflow.stats.cachedPct}%" class="progress-bar bg-secondary" data-toggle="tooltip" data-placement="top" title="$workflow.stats.cachedCount tasks were cached"><span class="text-truncate">&nbsp; $workflow.stats.cachedCount cached &nbsp;</span></div>
149-
<div style="width: ${workflow.stats.ignoredPct}%" class="progress-bar bg-warning" data-toggle="tooltip" data-placement="top" title="$workflow.stats.ignoredCount tasks reported and error and were ignored"><span class="text-truncate">&nbsp; $workflow.stats.ignoredCount ignored &nbsp;</span></div>
150-
<div style="width: ${workflow.stats.failedPct}%" class="progress-bar bg-danger" data-toggle="tooltip" data-placement="top" title="$workflow.stats.failedCount tasks failed"><span class="text-truncate">&nbsp; $workflow.stats.failedCount failed &nbsp;</span></div>
151-
</div>
152-
</dl>
153-
154145
<dt>Nextflow command</dt>
155146
<dd><pre class="nfcommand"><code>${workflow.commandLine}</code></pre></dd>
156147
</dl>
157148

158149
<dl class="row small">
159-
<dt class="col-sm-3">CPU-Hours</dt>
160-
<dd class="col-sm-9"><samp>${workflow.stats.computeTimeFmt}</samp></dd>
161-
162-
<dt class="col-sm-3">Launch directory</dt>
163-
<dd class="col-sm-9"><samp>${workflow.launchDir}</samp></dd>
164-
165-
<dt class="col-sm-3">Work directory</dt>
166-
<dd class="col-sm-9"><samp>${workflow.workDir.toUriString()}</samp></dd>
167-
168-
<dt class="col-sm-3">Project directory</dt>
169-
<dd class="col-sm-9"><samp>${workflow.projectDir}</samp></dd>
170-
171-
<% if (workflow.scriptName) { %>
172-
<dt class="col-sm-3">Script name</dt>
173-
<dd class="col-sm-9"><samp>${workflow.scriptName}</samp></dd>
174-
<% } %>
175-
176-
<% if (workflow.scriptId) { %>
177-
<dt class="col-sm-3">Script ID</dt>
178-
<dd class="col-sm-9"><code>${workflow.scriptId}</code></dd>
179-
<% } %>
180-
181-
<dt class="col-sm-3">Workflow session</dt>
182-
<dd class="col-sm-9"><code>${workflow.sessionId}</code></dd>
183-
184-
<% if (workflow.repository) { %>
185-
<dt class="col-sm-3">Workflow repository</dt>
186-
<dd class="col-sm-9"><code>${workflow.repository}</code>, revision <code>${workflow.revision}</code> (commit hash <code>${workflow.commitId}</code>)</dd>
187-
<% } %>
188-
189-
<dt class="col-sm-3">Workflow profile</dt>
190-
<dd class="col-sm-9">${workflow.profile}</dd>
191-
192-
<% if (workflow.container) { %>
193-
<dt class="col-sm-3">Workflow container</dt>
194-
<dd class="col-sm-9"><samp>${workflow.container}</samp></dd>
195-
196-
<dt class="col-sm-3">Container engine</dt>
197-
<dd class="col-sm-9"><samp>${workflow.containerEngine?:'-'}</samp></dd>
198-
<% } %>
199-
200150
<dt class="col-sm-3">Nextflow version</dt>
201151
<dd class="col-sm-9">version ${workflow.nextflow.version}, build ${workflow.nextflow.build} (${workflow.nextflow.timestamp})</dd>
202152
</dl>
203153

204-
<dt>Total CO2 footprint measures</dt>
154+
<dt>Total CO2e footprint measures</dt>
205155
<dl class="row small">
206-
<dt class="col-sm-3">Total CO2 emission</dt>
156+
<dt class="col-sm-3">Total CO2e emission</dt>
207157
<dd class="col-sm-9">${co2_totals.co2}g</dd>
208158

209159
<dt class="col-sm-3">Total energy consumption</dt>
@@ -230,17 +180,22 @@ <h4>Workflow execution completed unsuccessfully!</h4>
230180
<% } %>
231181
</dl>
232182

183+
<dl class="row small">
233184
<p>The calculation of these values is based on the carbon footprint computation method
234185
developed in the Green Algorithms project: www.green-algorithms.org</p>
235186
<p>Lannelongue, L., Grealey, J., Inouye, M.,
236187
Green Algorithms: Quantifying the Carbon Footprint of Computation.
237188
Adv. Sci. 2021, 2100707. https://doi.org/10.1002/advs.202100707</p>
189+
</dl>
238190
</div>
239191
</div>
240192

241193
<div class="container">
242-
<h2 id="resources" style="padding-top: 80px;">CO2 Footprint Measures</h2>
243-
<p>These plots give an overview of the distribution of resource usage for each process.</p>
194+
<h2 id="resources" style="padding-top: 80px;">CO2e Footprint Measures</h2>
195+
<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).
198+
</p>
244199

245200
<h4>CO2e</h4>
246201
<ul class="nav nav-tabs" id="co2eplot_tabs" role="tablist">

plugins/nf-co2footprint/src/resources/assets/CO2FootprintReportTemplate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ $(function() {
102102
var energy_tickformat = (max <= 4) ? ('.2f') : ('.3s');
103103

104104

105-
Plotly.newPlot('co2eplot', co2e_data, { title: 'CO2 emission', yaxis: {title: 'CO2 emission (g)', tickformat: co2e_tickformat, rangemode: 'tozero'} });
105+
Plotly.newPlot('co2eplot', co2e_data, { title: 'CO2e emission', yaxis: {title: 'CO2e emission (g)', tickformat: co2e_tickformat, rangemode: 'tozero'} });
106106
Plotly.newPlot('energyplot', energy_data, { title: 'Energy consumption', yaxis: {title: 'Energy consumption (Wh)', tickformat: energy_tickformat, rangemode: 'tozero'} });
107107

108108
// Convert to readable units
@@ -211,10 +211,10 @@ $(function() {
211211

212212
// Column titles
213213
var energyConsumptionTitle = 'energy consumption (mWh)'; // Default column title
214-
var co2EmissionsTitle = 'CO2 emissions (mg)';
214+
var co2EmissionsTitle = 'CO2e emissions (mg)';
215215
if ($('#nf-table-humanreadable').val() == 'true') {
216216
energyConsumptionTitle = 'energy consumption'; // Change the column title if the button is selected
217-
co2EmissionsTitle = 'CO2 emissions';
217+
co2EmissionsTitle = 'CO2e emissions';
218218
}
219219

220220
var table = $('#tasks_table').DataTable({

0 commit comments

Comments
 (0)