Add option to report only total consumed energy
This commit is contained in:
parent
dcf88a6da0
commit
ba5b2d80f5
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,8 @@ def parse_arguments(args):
|
||||||
help="Job did run on Hawk-AI")
|
help="Job did run on Hawk-AI")
|
||||||
parser.add_argument('--report-nodes', action='store_true',
|
parser.add_argument('--report-nodes', action='store_true',
|
||||||
help='Report power of all nodes, not just statisitcs across nodes.')
|
help='Report power of all nodes, not just statisitcs across nodes.')
|
||||||
|
parser.add_argument('--energy-only', action='store_true',
|
||||||
|
help='Return only total consumed energy, not detailed power')
|
||||||
parser.add_argument('jobid', type=parse_jobid,
|
parser.add_argument('jobid', type=parse_jobid,
|
||||||
nargs='+',
|
nargs='+',
|
||||||
help='Job ID such as "2260215" or "2260215.hawk-pbs5"')
|
help='Job ID such as "2260215" or "2260215.hawk-pbs5"')
|
||||||
|
@ -259,6 +261,13 @@ class App:
|
||||||
print('No data found for job ID "{}"'.format(jobid))
|
print('No data found for job ID "{}"'.format(jobid))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if self.config.energy_only:
|
||||||
|
if power.energy:
|
||||||
|
print(power.energy)
|
||||||
|
else:
|
||||||
|
print('No total energy for job ID "{}"'.format(jobid))
|
||||||
|
continue
|
||||||
|
|
||||||
fn = power.to_file(jobid, header)
|
fn = power.to_file(jobid, header)
|
||||||
if fn:
|
if fn:
|
||||||
print('Created file {fn}'.format(fn=fn))
|
print('Created file {fn}'.format(fn=fn))
|
||||||
|
|
Loading…
Reference in a new issue