Skip to content

Commit

Permalink
response to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mtitov committed Mar 20, 2024
1 parent a45c613 commit 56c8485
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/radical/entk/tools/darshan.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,20 @@ def get_parsed_data(log: str, target_counters: Union[str, List[str]]) -> set:

data = set()

if not target_counters:
return data

grep_patterns = '-e ' + ' -e '.join(ru.as_list(target_counters))
parser_cmd = (f'darshan-parser {log} | grep {grep_patterns} | '
"awk '{print $5\":\"$6}'")
out, err, ret = ru.sh_callout(parser_cmd, env=_darshan_env, shell=True)
if ret:
print(f'[ERROR] Darshan not able to parse "{log}": {err}')
else:
for o in out.split('\n'):
if not o:
for line in out.split('\n'):
if not line:
continue
value, file = o.split(':')
value, file = line.split(':', 1)
try: value = int(value)
except ValueError: value = 0
if value > 0 and file.startswith('/'):
Expand Down

0 comments on commit 56c8485

Please sign in to comment.