1diff -u -r source.orig/src/vizhp2p source/src/vizhp2p
2--- source.orig/src/vizhp2p 1970-01-01 01:00:01.000000000 +0100
3+++ source/src/vizhp2p 2021-08-24 10:41:42.926881770 +0200
4@@ -94,25 +94,25 @@
5 with open(hostfile) as fd:
6 for line in fd:
7 if line.startswith(motif_rank):
8- print line
9+ print(line)
10 c,v = line[len(motif_rank)+1:-1].split(separator)
11 nodes[c] = v
12
13 # display k worst nodes indices
14- print "\nTop %d bad mean:" % k
15+ print("\nTop %d bad mean:" % k)
16 mean_order = np.argsort(a_mean)
17- print [nodes[str(c)] for c in mean_order[:k]]
18+ print([nodes[str(c)] for c in mean_order[:k]])
19 mean_st = "Top nodes with bad mean:\n"
20 for i in range(0, k, hostname_per_line):
21 mean_st += repr([nodes[str(c)] for c
22 in mean_order[i:i + hostname_per_line]]) + "\n"
23
24- print "Top %d bad std:" % k
25- print [nodes[str(c)] for c in np.argsort(a_std)[-k:][::-1]]
26+ print("Top %d bad std:" % k)
27+ print([nodes[str(c)] for c in np.argsort(a_std)[-k:][::-1]])
28
29- print "Top %d bad mean/std:" % k
30+ print("Top %d bad mean/std:" % k)
31 pen_order = np.argsort(a_mean / a_std)
32- print [nodes[str(c)] for c in pen_order[:k]]
33+ print([nodes[str(c)] for c in pen_order[:k]])
34 pen_st = "Top nodes with bad mean/std:\n"
35 for i in range(0, k, hostname_per_line):
36 pen_st += repr([nodes[str(c)] for c
37@@ -293,9 +293,9 @@
38 # and 'p' (snapshot)
39 def onrefresh(event):
40 if event.key == 'r':
41- print "refreshing...",
42+ print("refreshing...", end=' ')
43 loop()
44- print "ok"
45+ print("ok")
46 elif event.key == 'q':
47 exit()
48 elif event.key == 'p':
49@@ -303,9 +303,9 @@
50 fig1.savefig(snapfile)
51 snapfile = outputname + "_snapshot_time.png"
52 fig2.savefig(snapfile)
53- print 'snapshot saved (%s)' % snapfile
54+ print('snapshot saved (%s)' % snapfile)
55 else:
56- print "The answer to %s is 42." % event.key
57+ print("The answer to %s is 42." % event.key)
58
59
60 if __name__ == "__main__":
61@@ -356,11 +356,11 @@
62 countfile = outputname + ".count.bin"
63
64 print("visu_hp2p configuration:")
65- print(" DATAFILE : %s"%resfile)
66- print(" BIN_TIMER_FILE : %s"%resfile_time)
67- print(" HOSTFILE : %s"%hostfile)
68- print(" Bad nodes to display: %d"%k)
69- print(" GUI resolution : %s"%resolution)
70+ print((" DATAFILE : %s"%resfile))
71+ print((" BIN_TIMER_FILE : %s"%resfile_time))
72+ print((" HOSTFILE : %s"%hostfile))
73+ print((" Bad nodes to display: %d"%k))
74+ print((" GUI resolution : %s"%resolution))
75
76 hostname_per_line = 4 # for GUI layout
77 refresh_in_sec = 60
78@@ -377,7 +377,7 @@
79 # wait for resfile
80 while not os.path.exists(resfile) :
81 time.sleep(5)
82- print "Waiting for input files..."
83+ print("Waiting for input files...")
84
85 # add callback on key press event
86 cid1 = fig1.canvas.mpl_connect('key_press_event', onrefresh)
87Only in source/src: vizhp2p.bak
88diff -u -r source.orig/src/vizhp2p_html source/src/vizhp2p_html
89--- source.orig/src/vizhp2p_html 1970-01-01 01:00:01.000000000 +0100
90+++ source/src/vizhp2p_html 2021-08-24 10:41:54.799946303 +0200
91@@ -118,7 +118,7 @@
92 hostfile = args.hostfile
93 clustername = args.clustername
94 if len(args.OutputName) == 0:
95- print "No DATAFILE given! Please provide Hp2p output files name !"
96+ print("No DATAFILE given! Please provide Hp2p output files name !")
97 exit(0)
98 else:
99 outputname = args.OutputName.split('.')[0]
100@@ -134,13 +134,13 @@
101 else:
102 outfile = args.outfile
103
104- print "%s configuration:"%commandname
105- print " DATAFILE : %s"%resfile
106- print " HOSTFILE : %s"%hostfile
107- print " CLUSTER : %s"%clustername
108- print " OUTPUTFILE : %s"%outfile
109+ print("%s configuration:"%commandname)
110+ print(" DATAFILE : %s"%resfile)
111+ print(" HOSTFILE : %s"%hostfile)
112+ print(" CLUSTER : %s"%clustername)
113+ print(" OUTPUTFILE : %s"%outfile)
114 if not os.path.exists(resfile):
115- print "%s doesn't exist...Exiting"%resfile
116+ print("%s doesn't exist...Exiting"%resfile)
117 exit(0)
118
119 # Data management
120Only in source/src: vizhp2p_html.bak