tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
hp2p: init at 3.3
Bruno Bzeznik
4 years ago
a4127fa9
612a8fa1
+160
3 changed files
expand all
collapse all
unified
split
pkgs
tools
networking
hp2p
default.nix
python3.patch
top-level
all-packages.nix
+38
pkgs/tools/networking/hp2p/default.nix
···
1
1
+
{ lib, stdenv, fetchFromGitHub, mpi, python3Packages, autoconf, automake } :
2
2
+
3
3
+
stdenv.mkDerivation rec {
4
4
+
pname = "hp2p";
5
5
+
version = "3.3";
6
6
+
7
7
+
src = fetchFromGitHub {
8
8
+
owner = "cea-hpc";
9
9
+
repo = "hp2p";
10
10
+
rev = version;
11
11
+
sha256 = "0zvlwb941rlp3vrf9yzv7njgpj3mh4671ch7qvxfa4hq2ivd52br";
12
12
+
};
13
13
+
14
14
+
patches = [ ./python3.patch ];
15
15
+
enableParallelBuilding = true;
16
16
+
nativeBuildInputs = [ autoconf automake python3Packages.wrapPython ];
17
17
+
buildInputs = [ mpi ] ++ (with python3Packages; [ python numpy matplotlib plotly mpldatacursor ]) ;
18
18
+
pythonPath = (with python3Packages; [ numpy matplotlib plotly mpldatacursor ]) ;
19
19
+
20
20
+
preConfigure = ''
21
21
+
patchShebangs autogen.sh
22
22
+
./autogen.sh
23
23
+
export CC=mpicc
24
24
+
export CXX=mpic++
25
25
+
'';
26
26
+
27
27
+
postInstall = ''
28
28
+
wrapPythonPrograms
29
29
+
'';
30
30
+
31
31
+
meta = with lib; {
32
32
+
description = "A MPI based benchmark for network diagnostics";
33
33
+
homepage = "https://github.com/cea-hpc/hp2p";
34
34
+
platforms = platforms.unix;
35
35
+
license = licenses.cecill-c;
36
36
+
maintainers = [ maintainers.bzizou ];
37
37
+
};
38
38
+
}
+120
pkgs/tools/networking/hp2p/python3.patch
···
1
1
+
diff -u -r source.orig/src/vizhp2p source/src/vizhp2p
2
2
+
--- source.orig/src/vizhp2p 1970-01-01 01:00:01.000000000 +0100
3
3
+
+++ source/src/vizhp2p 2021-08-24 10:41:42.926881770 +0200
4
4
+
@@ -94,25 +94,25 @@
5
5
+
with open(hostfile) as fd:
6
6
+
for line in fd:
7
7
+
if line.startswith(motif_rank):
8
8
+
- print line
9
9
+
+ print(line)
10
10
+
c,v = line[len(motif_rank)+1:-1].split(separator)
11
11
+
nodes[c] = v
12
12
+
13
13
+
# display k worst nodes indices
14
14
+
- print "\nTop %d bad mean:" % k
15
15
+
+ print("\nTop %d bad mean:" % k)
16
16
+
mean_order = np.argsort(a_mean)
17
17
+
- print [nodes[str(c)] for c in mean_order[:k]]
18
18
+
+ print([nodes[str(c)] for c in mean_order[:k]])
19
19
+
mean_st = "Top nodes with bad mean:\n"
20
20
+
for i in range(0, k, hostname_per_line):
21
21
+
mean_st += repr([nodes[str(c)] for c
22
22
+
in mean_order[i:i + hostname_per_line]]) + "\n"
23
23
+
24
24
+
- print "Top %d bad std:" % k
25
25
+
- print [nodes[str(c)] for c in np.argsort(a_std)[-k:][::-1]]
26
26
+
+ print("Top %d bad std:" % k)
27
27
+
+ print([nodes[str(c)] for c in np.argsort(a_std)[-k:][::-1]])
28
28
+
29
29
+
- print "Top %d bad mean/std:" % k
30
30
+
+ print("Top %d bad mean/std:" % k)
31
31
+
pen_order = np.argsort(a_mean / a_std)
32
32
+
- print [nodes[str(c)] for c in pen_order[:k]]
33
33
+
+ print([nodes[str(c)] for c in pen_order[:k]])
34
34
+
pen_st = "Top nodes with bad mean/std:\n"
35
35
+
for i in range(0, k, hostname_per_line):
36
36
+
pen_st += repr([nodes[str(c)] for c
37
37
+
@@ -293,9 +293,9 @@
38
38
+
# and 'p' (snapshot)
39
39
+
def onrefresh(event):
40
40
+
if event.key == 'r':
41
41
+
- print "refreshing...",
42
42
+
+ print("refreshing...", end=' ')
43
43
+
loop()
44
44
+
- print "ok"
45
45
+
+ print("ok")
46
46
+
elif event.key == 'q':
47
47
+
exit()
48
48
+
elif event.key == 'p':
49
49
+
@@ -303,9 +303,9 @@
50
50
+
fig1.savefig(snapfile)
51
51
+
snapfile = outputname + "_snapshot_time.png"
52
52
+
fig2.savefig(snapfile)
53
53
+
- print 'snapshot saved (%s)' % snapfile
54
54
+
+ print('snapshot saved (%s)' % snapfile)
55
55
+
else:
56
56
+
- print "The answer to %s is 42." % event.key
57
57
+
+ print("The answer to %s is 42." % event.key)
58
58
+
59
59
+
60
60
+
if __name__ == "__main__":
61
61
+
@@ -356,11 +356,11 @@
62
62
+
countfile = outputname + ".count.bin"
63
63
+
64
64
+
print("visu_hp2p configuration:")
65
65
+
- print(" DATAFILE : %s"%resfile)
66
66
+
- print(" BIN_TIMER_FILE : %s"%resfile_time)
67
67
+
- print(" HOSTFILE : %s"%hostfile)
68
68
+
- print(" Bad nodes to display: %d"%k)
69
69
+
- print(" GUI resolution : %s"%resolution)
70
70
+
+ print((" DATAFILE : %s"%resfile))
71
71
+
+ print((" BIN_TIMER_FILE : %s"%resfile_time))
72
72
+
+ print((" HOSTFILE : %s"%hostfile))
73
73
+
+ print((" Bad nodes to display: %d"%k))
74
74
+
+ print((" GUI resolution : %s"%resolution))
75
75
+
76
76
+
hostname_per_line = 4 # for GUI layout
77
77
+
refresh_in_sec = 60
78
78
+
@@ -377,7 +377,7 @@
79
79
+
# wait for resfile
80
80
+
while not os.path.exists(resfile) :
81
81
+
time.sleep(5)
82
82
+
- print "Waiting for input files..."
83
83
+
+ print("Waiting for input files...")
84
84
+
85
85
+
# add callback on key press event
86
86
+
cid1 = fig1.canvas.mpl_connect('key_press_event', onrefresh)
87
87
+
Only in source/src: vizhp2p.bak
88
88
+
diff -u -r source.orig/src/vizhp2p_html source/src/vizhp2p_html
89
89
+
--- source.orig/src/vizhp2p_html 1970-01-01 01:00:01.000000000 +0100
90
90
+
+++ source/src/vizhp2p_html 2021-08-24 10:41:54.799946303 +0200
91
91
+
@@ -118,7 +118,7 @@
92
92
+
hostfile = args.hostfile
93
93
+
clustername = args.clustername
94
94
+
if len(args.OutputName) == 0:
95
95
+
- print "No DATAFILE given! Please provide Hp2p output files name !"
96
96
+
+ print("No DATAFILE given! Please provide Hp2p output files name !")
97
97
+
exit(0)
98
98
+
else:
99
99
+
outputname = args.OutputName.split('.')[0]
100
100
+
@@ -134,13 +134,13 @@
101
101
+
else:
102
102
+
outfile = args.outfile
103
103
+
104
104
+
- print "%s configuration:"%commandname
105
105
+
- print " DATAFILE : %s"%resfile
106
106
+
- print " HOSTFILE : %s"%hostfile
107
107
+
- print " CLUSTER : %s"%clustername
108
108
+
- print " OUTPUTFILE : %s"%outfile
109
109
+
+ print("%s configuration:"%commandname)
110
110
+
+ print(" DATAFILE : %s"%resfile)
111
111
+
+ print(" HOSTFILE : %s"%hostfile)
112
112
+
+ print(" CLUSTER : %s"%clustername)
113
113
+
+ print(" OUTPUTFILE : %s"%outfile)
114
114
+
if not os.path.exists(resfile):
115
115
+
- print "%s doesn't exist...Exiting"%resfile
116
116
+
+ print("%s doesn't exist...Exiting"%resfile)
117
117
+
exit(0)
118
118
+
119
119
+
# Data management
120
120
+
Only in source/src: vizhp2p_html.bak
+2
pkgs/top-level/all-packages.nix
···
1648
1648
1649
1649
hostctl = callPackage ../tools/system/hostctl { };
1650
1650
1651
1651
+
hp2p = callPackage ../tools/networking/hp2p { };
1652
1652
+
1651
1653
hpe-ltfs = callPackage ../tools/backup/hpe-ltfs { };
1652
1654
1653
1655
http2tcp = callPackage ../tools/networking/http2tcp { };