[Darshan-commits] [Git][darshan/darshan][master] 2 commits: convert dxt_analyzier to python3

Philip Carns xgitlab at cels.anl.gov
Thu Mar 11 09:12:41 CST 2021



Philip Carns pushed to branch master at darshan / darshan


Commits:
c436afe9 by Phil Carns at 2021-03-11T10:11:19-05:00
convert dxt_analyzier to python3

- includes changes suggested by futurize utility

- - - - -
8f4cdc1c by Philip Carns at 2021-03-11T09:12:38-06:00
Merge branch 'carns/issue-310-dxt-analyzer-python3' into 'master'

convert dxt_analyzier to python3

Closes #310

See merge request darshan/darshan!82
- - - - -


1 changed file:

- darshan-util/dxt_analyzer.py


Changes:

=====================================
darshan-util/dxt_analyzer.py
=====================================
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 ###
 #
@@ -73,6 +73,7 @@ python dxt_analyzer.py -i darshan_dxt-v.txt
 
 '''
 
+from builtins import str
 import numpy as np
 import matplotlib
 #matplotlib.use('PDF')
@@ -111,7 +112,7 @@ def store_useful_comment(pieces, finfo_dict, curr_fname):
     attribute = pieces[0].replace('# DXT, ', '')
     if attribute=='file_id':
         curr_fname = pieces[2].replace(' ','').rstrip('\n')
-        if curr_fname not in finfo_dict.keys():
+        if curr_fname not in list(finfo_dict.keys()):
             finfo_dict[curr_fname] = {'mount':'', 'fs':'', 'stripe_size':-1, 'stripe_width':-1, 'OST_list':[]}
         return curr_fname
     elif attribute=='mnt_pt':
@@ -185,9 +186,9 @@ def parse_dxt_log_line(line, curr_fname, finfo_dict):
 def get_verts_file(data, module, fname, action):
     '''make a list of rectangle vertices to plot the posix/mpi read/write activity for each rank for a specific file'''
     keyword = module+'_'+action
-    filedata = map(lambda x: x[1], filter(lambda x: x[0]==fname, data))
-    filtered = map(lambda x: x[1], filter(lambda x: x[0]==keyword, filedata))
-    activities = map(lambda x: (x[0], (x[2], x[3])), filtered)
+    filedata = [x[1] for x in [x for x in data if x[0]==fname]]
+    filtered = [x[1] for x in [x for x in filedata if x[0]==keyword]]
+    activities = [(x[0], (x[2], x[3])) for x in filtered]
     verts = np.zeros((1,4,2))
     for entry in activities:
         lx,rx,by,ty = entry[1][0], entry[1][1], entry[0] - 0.5 , entry[0] + 0.5
@@ -199,9 +200,9 @@ def get_verts_file(data, module, fname, action):
 def get_verts_all(data, module, action):
     '''make a list of rectangle vertices to plot the posix/mpi read/write activity for each rank'''
     keyword = module+'_'+action
-    IOdata = map(lambda x: x[1], data)
-    filtered = map(lambda x: x[1], filter(lambda x: x[0]==keyword, IOdata))
-    activities = map(lambda x: (x[0], (x[2], x[3])), filtered)
+    IOdata = [x[1] for x in data]
+    filtered = [x[1] for x in [x for x in IOdata if x[0]==keyword]]
+    activities = [(x[0], (x[2], x[3])) for x in filtered]
     verts = np.zeros((1,4,2))
     for entry in activities:
         lx,rx,by,ty = entry[1][0], entry[1][1], entry[0] - 0.5 , entry[0] + 0.5



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/913450d75064bb78bd76d7b286fcd6a1317bf1bf...8f4cdc1cd2d33e63aa85bf513f9e91246aea68c2

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/913450d75064bb78bd76d7b286fcd6a1317bf1bf...8f4cdc1cd2d33e63aa85bf513f9e91246aea68c2
You're receiving this email because of your account on xgitlab.cels.anl.gov.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20210311/a27a3ad5/attachment-0001.html>


More information about the Darshan-commits mailing list