@@ -96,6 +96,7 @@ def linesinfile(file_name):
96
96
threads = list ()
97
97
exp = 0
98
98
max_threads = int (args .threads )
99
+ plot_data = list ()
99
100
start_threads = int (args .startthreads )
100
101
base = int (args .base )
101
102
if base == 1 :
@@ -142,10 +143,10 @@ def linesinfile(file_name):
142
143
if int (args .alg ) == 4 :
143
144
if start_threads == 1 :
144
145
methods = ['Raw sequential' ,'pThread 1D' ,'Open MP parallel sections' ,
145
- 'KAAPIC 1D ' ,'Intel TBB Invoke' ]
146
+ 'KAAPIC Spawn ' ,'Intel TBB Invoke' ]
146
147
else :
147
148
methods = ['pThread 1D' ,'Open MP parallel sections' ,
148
- 'KAAPIC 1D ' ,'Intel TBB Invoke' ]
149
+ 'KAAPIC Spawn ' ,'Intel TBB Invoke' ]
149
150
150
151
# lists for all methods we have, those are lists of lists:
151
152
# e.g. time_series[i] is a list of len(threads) elements of the timings
@@ -170,23 +171,23 @@ def linesinfile(file_name):
170
171
# generate random matrices without timestamp if no increasing is done
171
172
if int (args .inc ) == - 1 :
172
173
if int (args .alg ) == 1 :
173
- os .system ('../.. /src/f4rt -G -R ' + args .rowsa + ' -C ' + args .colsa )
174
- os .system ('../.. /src/f4rt -G -R ' + args .colsa + ' -C ' + args .colsb )
174
+ os .system ('/home/eder/repos/devel-F4RT /src/f4rt -G -R ' + args .rowsa + ' -C ' + args .colsa )
175
+ os .system ('/home/eder/repos/devel-F4RT /src/f4rt -G -R ' + args .colsa + ' -C ' + args .colsb )
175
176
else :
176
- os .system ('../.. /src/f4rt -G -R ' + args .rowsa + ' -C ' + args .colsa )
177
+ os .system ('/home/eder/repos/devel-F4RT /src/f4rt -G -R ' + args .rowsa + ' -C ' + args .colsa )
177
178
178
179
bench_file = "bench-" + str (hash_value )
179
180
f = open (bench_file ,"w" )
180
181
181
- strstr = '../.. /src/f4rt -' + algorithm + ' \
182
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
182
183
-A random-mat-'+ args .rowsa + '-' + args .colsa + '.mat '
183
184
if int (args .alg ) == 1 :
184
185
strstr += '-B random-mat-' + args .colsa + '-' + args .colsb + '.mat'
185
186
186
187
thrds_str = str (threads )
187
188
thrds_str = thrds_str .replace ('[' ,'' )
188
189
thrds_str = thrds_str .replace (']' ,'' )
189
- thrds_str = thrds_str
190
+ plot_data = thrds_str
190
191
if int (args .alg ) == 1 :
191
192
f .write (args .rowsa + ',' + args .colsa + ',' + args .colsb + '\r \n ' )
192
193
else :
@@ -289,14 +290,16 @@ def linesinfile(file_name):
289
290
rowSizes .append (rows )
290
291
cols = int (args .colsa ) + k * int (args .inc )
291
292
colSizes .append (cols )
292
- os .system ('../../src/f4rt -G -R ' + str (rows )+ ' -C ' + str (cols ))
293
+ plot_data .append (str (rowSizes [k ])+ '/' + str (colSizes [k ]))
294
+ os .system ('/home/eder/repos/devel-F4RT/src/f4rt -G -R ' + str (rows )+ ' -C ' + str (cols ))
293
295
else :
294
296
for k in range (0 ,int (args .count )+ 1 ):
295
297
rows = (2 ** k ) * int (args .rowsa )
296
298
rowSizes .append (rows )
297
299
cols = (2 ** k ) * int (args .colsa )
298
300
colSizes .append (cols )
299
- os .system ('../../src/f4rt -G -R ' + str (rows )+ ' -C ' + str (cols ))
301
+ os .system ('/home/eder/repos/devel-F4RT/src/f4rt -G -R ' + str (rows )+ ' -C ' + str (cols ))
302
+ plot_data .append (str (rowSizes [k ])+ '/' + str (colSizes [k ]))
300
303
301
304
bench_file = "bench-" + str (hash_value )
302
305
f = open (bench_file ,"w" )
@@ -314,7 +317,7 @@ def linesinfile(file_name):
314
317
block = 256
315
318
if int (max_threads ) == 1 :
316
319
for k in range (0 ,int (args .count )+ 1 ):
317
- strstr = '../.. /src/f4rt -' + algorithm + ' \
320
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
318
321
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat '
319
322
320
323
print (strstr + ' -m0 >> ' + bench_file + '...' )
@@ -324,7 +327,7 @@ def linesinfile(file_name):
324
327
# pThread computations 1D outer
325
328
block = 128
326
329
for k in range (0 ,int (args .count )+ 1 ):
327
- strstr = '../.. /src/f4rt -' + algorithm + ' \
330
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
328
331
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat -b ' + str (block )
329
332
330
333
print (strstr + ' -m4 -t ' + str (max_threads )+ ' >> bench-' + str (hash_value )+ '...' )
@@ -334,7 +337,7 @@ def linesinfile(file_name):
334
337
# OpenMP computations 1D outer
335
338
block = 256
336
339
for k in range (0 ,int (args .count )+ 1 ):
337
- strstr = '../.. /src/f4rt -' + algorithm + ' \
340
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
338
341
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat -b ' + str (block )
339
342
340
343
print (strstr + ' -m1 -d 1 -t ' + str (max_threads )+ ' >> bench-' + str (hash_value )+ '...' )
@@ -344,7 +347,7 @@ def linesinfile(file_name):
344
347
# KAAPIC computations 1D
345
348
block = 64
346
349
for k in range (0 ,int (args .count )+ 1 ):
347
- strstr = '../.. /src/f4rt -' + algorithm + ' \
350
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
348
351
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat -b ' + str (block )
349
352
350
353
print ('KAAPI_CPUCOUNT=' + str (max_threads )+ ' ' + strstr + ' -m3 -t ' + str (max_threads )+ ' >> bench-' + str (hash_value )+ '...' )
@@ -354,7 +357,7 @@ def linesinfile(file_name):
354
357
# TBB computations 1D auto
355
358
block = 32
356
359
for k in range (0 ,int (args .count )+ 1 ):
357
- strstr = '../.. /src/f4rt -' + algorithm + ' \
360
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
358
361
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat -b ' + str (block )
359
362
360
363
print (strstr + ' -m2 -t ' + str (max_threads )+ ' >> bench-' + str (hash_value )+ '...' )
@@ -364,7 +367,7 @@ def linesinfile(file_name):
364
367
if int (args .alg ) != 4 :
365
368
# TBB computations 1D affinity
366
369
for k in range (0 ,int (args .count )+ 1 ):
367
- strstr = '../.. /src/f4rt -' + algorithm + ' \
370
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
368
371
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat '
369
372
370
373
print (strstr + ' -m2 -t ' + str (max_threads )+ ' -a >> bench-' + str (hash_value )+ '...' )
@@ -373,7 +376,7 @@ def linesinfile(file_name):
373
376
374
377
# TBB computations 1D simple
375
378
for k in range (0 ,int (args .count )+ 1 ):
376
- strstr = '../.. /src/f4rt -' + algorithm + ' \
379
+ strstr = '/home/eder/repos/devel-F4RT /src/f4rt -' + algorithm + ' \
377
380
-A random-mat-'+ str (rowSizes [k ])+ '-' + str (colSizes [k ])+ '.mat '
378
381
379
382
print (strstr + ' -m2 -t ' + str (max_threads )+ ' -s >> bench-' + str (hash_value )+ '...' )
@@ -412,7 +415,8 @@ def linesinfile(file_name):
412
415
# get threads for plot, stored in the first line of bench file
413
416
#plot_threads = f.readline().strip().replace(' ','').split(',')
414
417
# for compatibility to the other scripts just store this again
415
- threads = plot_threads
418
+ plot_data = plot_threads
419
+ print (plot_data )
416
420
threads = list (map (lambda x : int (x ) - 1 , threads ))
417
421
418
422
@@ -432,43 +436,31 @@ def linesinfile(file_name):
432
436
#plot this data
433
437
434
438
#line style, sequential method only if start_threads == 1
435
- if int (args .alg ) == 1 :
436
- if start_threads == 1 :
437
- stride = 1
438
- coloring = ['k' ,'c' ,'b' ,'b' ,'g' ,'y' ,'y' ,'#7d053f' ,'#7d053f' ,'#7d053f' ,'r' ,'r' ,'r' ]
439
- styles = ['None' ,'-' ,'-' ,'--' ,'-' ,'-' ,'-' ,'-' ,'--' ,':' ,'-' ,'--' ,':' ]
440
- markers = ['^' ,'None' ,'None' ,'None' ,'None' ,'o' ,'s' ,'None' ,'None' ,
441
- 'None' ,'None' ,'None' ,'None' ]
442
- else :
443
- stride = 1
444
- coloring = ['c' ,'b' ,'b' ,'g' ,'y' ,'y' ,'#7d053f' ,'#7d053f' ,'#7d053f' ,'r' ,'r' ,'r' ]
445
- styles = ['-' ,'-' ,'--' ,'-' ,'-' ,'-' ,'-' ,'--' ,':' ,'-' ,'--' ,':' ]
446
- markers = ['None' ,'None' ,'None' ,'None' ,'o' ,'s' ,'None' ,'None' ,
447
- 'None' ,'None' ,'None' ,'None' ]
448
- if int (args .alg ) == 2 or int (args .alg ) == 3 :
449
- if start_threads == 1 :
450
- stride = 1
451
- coloring = ['k' ,'c' ,'b' ,'y' ,'#7d053f' ,'#7d053f' ,'#7d053f' ]
452
- styles = ['None' ,'-' ,'-' ,'-' ,'-' ,'--' ,':' ]
453
- markers = ['^' ,'None' ,'None' ,'o' ,'None' ,'None' ,
454
- 'None' ]
455
- else :
456
- stride = 1
457
- coloring = ['c' ,'b' ,'y' ,'#7d053f' ,'#7d053f' ,'#7d053f' ]
458
- styles = ['-' ,'-' ,'-' ,'-' ,'--' ,':' ]
459
- markers = ['None' ,'None' ,'o' ,'None' ,'None' ,
460
- 'None' ]
461
- if int (args .alg ) == 4 :
462
- if start_threads == 1 :
463
- stride = 1
464
- coloring = ['k' ,'c' ,'b' ,'y' ,'#7d053f' ]
465
- styles = ['None' ,'-' ,'-' ,'-' ,'-' ]
466
- markers = ['^' ,'None' ,'None' ,'o' ,'None' ]
467
- else :
468
- stride = 1
469
- coloring = ['c' ,'b' ,'y' ,'#7d053f' ]
470
- styles = ['-' ,'-' ,'-' ,'-' ]
471
- markers = ['None' ,'None' ,'o' ,'None' ]
439
+ stride = 1
440
+ coloring = \
441
+ [\
442
+ '#0099cc' ,'#33cc00' ,'#ff1b54' ,'#0033cc' ,'#9900cc' ,'#800020' ,\
443
+ '#ff4011' ,'#ffbf01' ,'#00144f' ,'#ff1450' ,\
444
+ '#0099cc' ,'#33cc00' ,'#cc0033' ,'#0033cc' ,'#9900cc' ,'#800020' ,\
445
+ '#ff4011' ,'#ffbf01' ,'#00144f' ,'#ff1450' ,\
446
+ '#0099cc' ,'#33cc00' ,'#cc0033' ,'#0033cc' ,'#9900cc' ,'#800020' ,\
447
+ '#ff4011' ,'#ffbf01' ,'#00144f' ,'#ff1450' ,\
448
+ '#0099cc' ,'#33cc00' ,'#cc0033' ,'#0033cc' ,'#9900cc' ,'#800020' ,\
449
+ '#ff4011' ,'#ffbf01' ,'#00144f' ,'#ff1450' \
450
+ ]
451
+ styles = [\
452
+ '-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,\
453
+ '--' ,'--' ,'--' ,'--' ,'--' ,'--' ,'--' ,'--' ,'--' ,'--' ,\
454
+ ':' ,':' ,':' ,':' ,':' ,':' ,':' ,':' ,':' ,':' ,\
455
+ '-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' \
456
+ ]
457
+ markers = [\
458
+ 'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,\
459
+ 'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,\
460
+ 'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,'None' ,\
461
+ 'o' ,'o' ,'o' ,'o' ,'o' ,'o' ,'o' ,'o' ,'o' ,'o' \
462
+ ]
463
+
472
464
473
465
pl .rc ('legend' ,** {'fontsize' :5 })
474
466
fig = pl .figure ()
@@ -517,11 +509,14 @@ def linesinfile(file_name):
517
509
group_labels = plot_threads
518
510
519
511
#ax.set_xticklabels(group_labels)
520
- threads_tmp = range (0 ,len (plot_threads ))
512
+ threads_tmp = range (0 ,len (plot_data ))
513
+ #threads_tmp = range(0,len(plot_threads))
521
514
# get right scale for a4 paper size
522
- scale_tmp = 38 / (len (plot_threads ))
515
+ scale_tmp = 38 / (len (plot_data ))
516
+ #scale_tmp = 38 / (len(plot_threads))
523
517
threads = range (0 ,38 ,scale_tmp )
524
- tick_lbs = plot_threads
518
+ print (threads )
519
+ tick_lbs = plot_data
525
520
ax .xaxis .set_ticks (threads )
526
521
ax .xaxis .set_ticklabels (tick_lbs )
527
522
@@ -591,11 +586,13 @@ def linesinfile(file_name):
591
586
ax = pl .gca ()
592
587
593
588
#ax.set_xticklabels(group_labels)
594
- threads_tmp = range (0 ,len (plot_threads ))
589
+ threads_tmp = range (0 ,len (plot_data ))
590
+ #threads_tmp = range(0,len(plot_threads))
595
591
# get right scale for a4 paper size
596
- scale_tmp = 38 / (len (plot_threads ))
592
+ scale_tmp = 38 / (len (plot_data ))
593
+ #scale_tmp = 38 / (len(plot_threads))
597
594
threads = range (0 ,38 ,scale_tmp )
598
- tick_lbs = plot_threads
595
+ tick_lbs = plot_data
599
596
ax .xaxis .set_ticks (threads )
600
597
ax .xaxis .set_ticklabels (tick_lbs )
601
598
0 commit comments