Skip to content

Commit

Permalink
Updated memory attribute to use peak_rss for calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantjoon committed Feb 5, 2025
1 parent 23716d8 commit 55dab0f
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,17 @@ class CO2FootprintFactory implements TraceObserverFactory {
}
// TODO how to handle double, Double datatypes for ceiling?
if ( cpu_usage == 0.0 ) {
warnings << "The reported CPU usage is 0.0 for at last one task!"
warnings << "The reported CPU usage is 0.0 for at least one task!"
}
Double uc = cpu_usage / (100.0 * nc) as Double

/**
* Factors of memory power usage
*/
// nm: size of memory available [GB] -> requested memory
Long memory = trace.get('memory') as Long
if ( memory == null ) {
// TODO if 'memory' not set, returns null, hande somehow?
log.error "TraceRecord field 'memory' is not set!"
System.exit(1)
}
Double nm = memory/1000000000 as Double
// TODO handle if more memory/cpus used than requested?
// nm: (Peak resident set size i.e. high water mark) [GB] -> maximum amount of physical memory (RAM) that the process had in use at any point during its execution.
Double memory = trace.get('peak_rss') as Double

Double nm = memory/(1024*1024*1024) as Double

// Pm: power draw of memory [W per GB]
Double pm = config.getPowerdrawMem()
Expand Down

0 comments on commit 55dab0f

Please sign in to comment.