|
2 | 2 | from matplotlib import pyplot as plt |
3 | 3 | from pylab import rcParams |
4 | 4 |
|
5 | | -fs = 12 |
| 5 | +fs = 8 |
6 | 6 |
|
7 | 7 | Nsamples = 4 |
8 | | -#Nprocs = numpy.array([2, 4, 6, 8, 10, 12, 24]) |
9 | | -Nprocs = numpy.array([2, 4, 6, 8]) |
| 8 | + |
| 9 | +machine = "cub" |
| 10 | + |
| 11 | +if machine=="dora": |
| 12 | + Nprocs = numpy.array([2, 4, 6, 8, 10, 12, 24]) |
| 13 | +if machine=="cub": |
| 14 | + Nprocs = numpy.array([2, 4, 6, 8]) |
10 | 15 | Niter = 4 |
11 | 16 | timers = numpy.zeros([3, Nprocs.size, Nsamples]) |
12 | 17 | timers_avg = numpy.zeros([3, Nprocs.size]) |
|
85 | 90 |
|
86 | 91 | plt.xlabel('Number of cores', fontsize=fs) |
87 | 92 | plt.ylabel('Speedup', fontsize=fs, labelpad=2) |
88 | | -plt.xticks(Nprocs, fontsize=fs) |
89 | | -#plt.xticks([2,6,10,14,18,22], fontsize=fs) |
| 93 | +if machine=="dora": |
| 94 | + plt.xticks([2,6,10,14,18,22], fontsize=fs) |
| 95 | +if machine=="cub": |
| 96 | + plt.xticks(Nprocs, fontsize=fs) |
90 | 97 |
|
91 | 98 | plt.yticks(fontsize=fs) |
92 | 99 | plt.grid(True) |
93 | | -plt.legend(loc='upper left', fontsize=fs, prop={'size':fs-3}) |
| 100 | +plt.legend(loc='upper left', fontsize=fs, prop={'size':fs}) |
94 | 101 | plt.ylim([ymin, ymax]) |
95 | 102 |
|
96 | 103 | # Saveing figure |
|
104 | 111 | plt.plot(Nprocs, timers_avg[2,:], linewidth=1.0, marker='>', markersize=fs, color='r', label='OpenMP(pipe)') |
105 | 112 | plt.plot(Nprocs, time_serial_f + 0.0*timers_avg[0,:], linewidth=1.0, color='k') |
106 | 113 | nodes = list(Nprocs) |
107 | | -#ymin = 0 |
108 | 114 | ymax = max(map(max,timers_avg))+1.0 |
109 | 115 |
|
110 | 116 | NN = Nprocs[ numpy.size(Nprocs) - 2] - 0.75 |
111 | 117 |
|
112 | | -plt.gca().annotate('Serial runtime', xy=( NN, 1.075*time_serial_f), xytext=( NN, 1.075*time_serial_f ), fontsize=fs-4) |
| 118 | +plt.gca().annotate('Serial runtime', xy=( NN, 1.075*time_serial_f), xytext=( NN, 1.075*time_serial_f ), fontsize=fs-1) |
113 | 119 | plt.gca().set_yscale('log') |
114 | 120 | #plt.gca().set_xscale('log') |
115 | 121 | plt.xlabel('Number of cores', fontsize=fs) |
116 | 122 | plt.ylabel('Runtime [sec.] (log-scaled)', fontsize=fs, labelpad=2) |
| 123 | + |
117 | 124 | plt.tick_params(axis='both', which='major', labelsize=fs) |
| 125 | + |
118 | 126 | plt.gca().set_ylim([2.0, 50.0]) |
119 | | -plt.gca().set_xticks(Nprocs) |
120 | | -#plt.xticks([2,6,10,14,18,22], fontsize=fs) |
| 127 | +if machine=="dora": |
| 128 | + plt.gca().set_xticks([2,6,10,14,18,22]) |
| 129 | +if machine=="cub": |
| 130 | + plt.gca().set_xticks(Nprocs) |
121 | 131 | plt.gca().set_yticks([5, 10, 20, 50]) |
122 | 132 | plt.gca().set_yticklabels(["5", "10", "20", "50"]) |
123 | 133 | plt.gca().get_yaxis().get_major_formatter().labelOnlyBase = False |
124 | 134 | plt.grid(True) |
125 | | -#plt.legend(loc='upper right', prop={'size':fs-3}) |
126 | | -plt.legend(loc='lower left', prop={'size':fs-3}) |
| 135 | +if machine=="dora": |
| 136 | + plt.legend(loc='upper right', prop={'size':fs}) |
| 137 | +if machine=="cub": |
| 138 | + plt.legend(loc='lower left', prop={'size':fs}) |
127 | 139 |
|
128 | 140 | # Saveing figure |
129 | 141 | fig.savefig('Runtime.pdf',bbox_inches='tight') |
|
0 commit comments