Commit 8baa8fbe authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

Merge branch 'cpu_stats_fix' into '1.4.x'

Handle case where CPU stats return 0

See merge request !42
parents d895b03d 464421de
Pipeline #21844 passed with stages
in 39 minutes and 35 seconds
......@@ -229,13 +229,18 @@ def run_experiment(configuration, name, force, use_docker, use_local):
cpu_stats = stats['cpu']
data_stats = stats['data']
cpu_total = cpu_stats['total']
# Likely means that GPU was used
if not cpu_total:
cpu_total = 1.0
logger.extra(" CPU time (user, system, total, percent): "
"%s, %s, %s, %d%%",
simplify_time(cpu_stats['user']),
simplify_time(cpu_stats['system']),
simplify_time(cpu_stats['total']),
simplify_time(cpu_total),
100. * (cpu_stats['user'] + cpu_stats['system']) /
cpu_stats['total'])
cpu_total)
logger.extra(" Memory usage: %s",
simplify_size(stats['memory']['rss']))
logger.extra(" Cached input read: %s, %s",
......@@ -247,7 +252,7 @@ def run_experiment(configuration, name, force, use_docker, use_local):
logger.extra(" Communication time: %s (%d%%)",
simplify_time(data_stats['network']['wait_time']),
100. * data_stats['network']['wait_time'] /
cpu_stats['total'])
cpu_total)
else:
logger.extra(" Environment: %s" % 'local environment')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment