-
Notifications
You must be signed in to change notification settings - Fork 6
/
scale_test_job.sh
executable file
·82 lines (71 loc) · 1.91 KB
/
scale_test_job.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#PBS -A P48500028
#PBS -N SCALE_TEST
#PBS -j oe
#PBS -q regular
#PBS -l walltime=12:00:00
#PBS -l select=50:ncpus=36:mpiprocs=36
function run_test(){
EXE=./test-ideal
# for (( i=1440; i>360; i-=18 )); do
for (( i=64; i>1; i-=2 )); do
echo -n "[" $i ","
cafrun -np $i ${EXE} | grep "Model run time" | sed -e's/Model run time:/ /;s/$/],/;s/seconds//'
done
echo -n "[ 1, "
cafrun -np 1 ${EXE} | grep "Model run time" | sed -e's/Model run time:/ /;s/$/]/;s/seconds//'
}
cat <<EOF
#!/usr/bin/env python
# `cat input-parameters.txt`
import numpy as np
import matplotlib.pyplot as plt
d=np.array([
EOF
run_test
cat <<EOF
])
plt.plot(d[:,0], d[:,0] / d[-1,0],"o",color="C1", label="Ideal")
plt.plot(d[:,0], d[-1,1] / d[:,1], "x",color="C0", label="CAF")
plt.xlabel("Number of Processors")
plt.ylabel("Speedup")
plt.legend( )
plt.tight_layout( )
plt.title("`cat input-parameters.txt`")
plt.savefig("speedup.png")
plt.clf( )
plt.plot(d[:,0], d[:,1], "x",color="C0", label="CAF")
plt.xlabel("Number of Processors")
plt.ylabel("Run time (s)")
plt.legend( )
plt.title("`cat input-parameters.txt`")
plt.savefig("runtime.png")
EOF
# Example output
# Creates a python script that will plot the scaling data
#!/usr/bin/env python
# import numpy as np
# import matplotlib.pyplot as plt
#
# d=np.array([
# [ 180 , 5.9 ],
# [ 144 , 7.3 ],
# [ 108 , 9.4 ],
# [ 72 , 13.6 ],
# [ 36, 26.3 ]
# ])
# plt.plot(d[:,0],d[:,0]/d[-1,0],"o",color="C1", label="Ideal")
# plt.plot(d[:,0],d[-1,1]/d[:,1],"x",color="C0", label="CAF")
#
# plt.xlabel("Number of Processors")
# plt.ylabel("Speedup")
# plt.tight_layout( )
# plt.savefig("speedup.png")
#
# plt.clf( )
# plt.plot(d[:,0], d[:,1], "x",color="C0", label="CAF")
# plt.xlabel("Number of Processors")
# plt.ylabel("Run time (s)")
# plt.legend( )
# plt.tight_layout( )
# plt.savefig("runtime.png")