Skip to content

Commit 16da6c8

Browse files
Updating benchmark data
1 parent 9b2d808 commit 16da6c8

31 files changed

+159
-119
lines changed

src/data/benchmark_blocks_BLAS.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.104650
2-
512 0.873165
3-
1024 7.320097
1+
256 0.060490
2+
512 0.512852
3+
1024 4.203045
4+
2048 34.561330
5+
4096 291.356990

src/data/benchmark_blocks_BLAS_MP.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.133424
2-
512 0.738715
3-
1024 4.116122
1+
256 0.020453
2+
512 0.236462
3+
1024 1.788613
4+
2048 15.762803
5+
4096 130.438630

src/data/benchmark_blocks_NoBLAS.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.601513
2-
512 2.010825
3-
1024 14.243098
1+
256 0.125000
2+
512 0.953125
3+
1024 7.640625
4+
2048 60.562500
5+
4096 485.718750

src/data/benchmark_float_18.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.004334
2-
512 0.019533
3-
1024 0.147355
1+
256 0.001228
2+
512 0.007793
3+
1024 0.052957
4+
2048 0.389164
5+
4096 3.035921

src/data/benchmark_float_20.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.002996
2-
512 0.019488
3-
1024 0.141876
1+
256 0.001223
2+
512 0.007750
3+
1024 0.053096
4+
2048 0.387539
5+
4096 3.042942

src/data/benchmark_float_22.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.004537
2-
512 0.019813
3-
1024 0.161059
1+
256 0.001764
2+
512 0.008584
3+
1024 0.061115
4+
2048 0.470926
5+
4096 3.803679

src/data/benchmark_float_24.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.010669
2-
512 0.074771
3-
1024 0.699697
1+
256 0.004415
2+
512 0.035783
3+
1024 0.286922
4+
2048 2.353680
5+
4096 19.387153

src/data/benchmark_float_26.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.131005
2-
512 1.299020
3-
1024 8.850115
1+
256 0.056815
2+
512 0.506669
3+
1024 4.147431
4+
2048 34.695722
5+
4096 290.457733

src/data/benchmark_integer_18.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.092843
2-
512 0.759280
3-
1024 5.759017
1+
256 0.060725
2+
512 0.480752
3+
1024 3.813639
4+
2048 30.555814
5+
4096 245.128241

src/data/benchmark_integer_20.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.093085
2-
512 0.780829
3-
1024 5.916821
1+
256 0.060548
2+
512 0.476654
3+
1024 3.803149
4+
2048 30.443846
5+
4096 245.004002

src/data/benchmark_integer_22.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.090962
2-
512 0.711311
3-
1024 5.932683
1+
256 0.060411
2+
512 0.478618
3+
1024 3.801294
4+
2048 30.433349
5+
4096 245.126253

src/data/benchmark_integer_24.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.089326
2-
512 0.716516
3-
1024 5.863130
1+
256 0.068369
2+
512 0.478048
3+
1024 3.829007
4+
2048 30.668390
5+
4096 245.311900

src/data/benchmark_integer_26.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
256 0.090416
2-
512 0.737959
3-
1024 5.879954
1+
256 0.060966
2+
512 0.481131
3+
1024 3.843690
4+
2048 30.489705
5+
4096 245.108636

src/data/benchmark_modulo_Barrett.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.349905
2-
512 2.884986
3-
1024 21.453475
1+
256 0.218750
2+
512 1.687500
3+
1024 13.531250
4+
2048 107.671875
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.060192
2-
512 0.509851
3-
1024 3.235947
1+
256 0.277262
2+
512 1.320997
3+
1024 6.976223
4+
2048 40.347728
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.055740
2-
512 0.544654
3-
1024 4.393463
1+
256 0.300370
2+
512 1.281565
3+
1024 6.697673
4+
2048 37.871269
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.054218
2-
512 0.442351
3-
1024 3.072420
1+
256 0.306009
2+
512 1.242683
3+
1024 7.175216
4+
2048 38.146906
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.090017
2-
512 0.436566
3-
1024 2.908950
1+
256 0.348979
2+
512 1.307635
3+
1024 6.600367
4+
2048 38.324097
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.090896
2-
512 0.444606
3-
1024 3.990551
1+
256 0.285025
2+
512 1.408056
3+
1024 7.688562
4+
2048 47.684510

src/data/benchmark_modulo_SIMD1.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.284792
2-
512 2.405989
3-
1024 18.936896
1+
256 0.171875
2+
512 1.515625
3+
1024 12.140625
4+
2048 91.812500

src/data/benchmark_modulo_SIMD2.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.283364
2-
512 2.401201
3-
1024 17.964999
1+
256 0.187500
2+
512 1.468750
3+
1024 11.625000
4+
2048 87.187500

src/data/benchmark_modulo_SIMD3.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.331526
2-
512 2.526606
3-
1024 18.769032
1+
256 0.171875
2+
512 1.500000
3+
1024 12.046875
4+
2048 90.187500

src/data/benchmark_modulo_naive.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.222980
2-
512 1.881384
3-
1024 14.705631
1+
256 0.265625
2+
512 2.078125
3+
1024 16.687500
4+
2048 133.937500

src/data/benchmark_order_ijk.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.344155
2-
512 1.089599
3-
1024 37.425532
1+
256 0.546875
2+
512 0.937500
3+
1024 14.156250
4+
2048 194.296875

src/data/benchmark_order_ikj.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.116009
2-
512 0.877172
3-
1024 7.293895
1+
256 0.062500
2+
512 0.500000
3+
1024 4.015625
4+
2048 32.359375

src/data/benchmark_order_jik.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.123963
2-
512 1.067085
3-
1024 37.076965
1+
256 0.109375
2+
512 0.906250
3+
1024 8.671875
4+
2048 123.671875

src/data/benchmark_order_jki.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.145821
2-
512 1.343724
3-
1024 61.732275
1+
256 0.125000
2+
512 1.062500
3+
1024 15.375000
4+
2048 220.890625

src/data/benchmark_order_kij.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.107567
2-
512 0.913795
3-
1024 7.402726
1+
256 0.062500
2+
512 0.500000
3+
1024 4.078125
4+
2048 32.390625

src/data/benchmark_order_kji.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
256 0.168071
2-
512 1.326327
3-
1024 62.548309
1+
256 0.125000
2+
512 1.187500
3+
1024 14.171875
4+
2048 240.890625

src/main.c

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void benchmark_loops_order(double p){
305305
The most efficient one is IKJ.
306306
*/
307307
int m = 1; // Executes m times each algo
308-
for (int i=8; i<11; i++){
308+
for (int i=8; i<12; i++){
309309
int n = (int) pow(2, i);
310310
double sum_ijk = 0;
311311
double sum_kij = 0;
@@ -340,10 +340,10 @@ void benchmark_loops_order(double p){
340340

341341
void benchmark_modulos(double p, double u, double u_overline, double u_b, u_int32_t s, u_int32_t t){
342342
/* Benchmarking different modulos.
343-
The most efficient one SIMD2.
343+
The 3 SIMD are the most efficient.
344344
*/
345345
int m = 1; // Executes m times each algo
346-
for (int i=8; i<11; i++){
346+
for (int i=8; i<12; i++){
347347
int n = (int) pow(2, i);
348348
double sum_mod_naive = 0;
349349
double sum_mod_SIMD1 = 0;
@@ -376,10 +376,9 @@ void benchmark_modulos(double p, double u, double u_overline, double u_b, u_int3
376376

377377
void benchmark_modulos_MP(double p, double u, double u_overline, double u_b, u_int32_t s, u_int32_t t){
378378
/* Benchmarking different modulos.
379-
The most efficient one SIMD2.
380379
*/
381380
int m = 1; // Executes m times each algo
382-
for (int i=8; i<11; i++){
381+
for (int i=8; i<12; i++){
383382
int n = (int) pow(2, i);
384383

385384
double sum_mod_MP_naive = 0;
@@ -416,7 +415,8 @@ void benchmark_blocks(double p, double u_overline){
416415
/* Benchmarking different modulos.
417416
*/
418417
int m = 1; // Executes m times each algo
419-
for (int i=8; i<11; i++){
418+
openblas_set_num_threads(1); // 8 is slower than 1.
419+
for (int i=8; i<13; i++){
420420
int n = (int) pow(2, i);
421421
int b = get_blocksize(get_bitsize(p), n);
422422

@@ -444,8 +444,9 @@ void benchmark_blocks(double p, double u_overline){
444444
void benchmark_blocks_MP(double p, double u_overline){
445445
/* Benchmarking different modulos.
446446
*/
447-
int m = 3; // Executes m times each algo
448-
for (int i=8; i<11; i++){
447+
int m = 1; // Executes m times each algo
448+
openblas_set_num_threads(1);
449+
for (int i=8; i<13; i++){
449450
int n = (int) pow(2, i);
450451
int b = get_blocksize(get_bitsize(p), n);
451452

@@ -472,7 +473,7 @@ void benchmark_float_integer(double p, double u_overline, double u_b, u_int32_t
472473
*/
473474
int m = 1; // Executes m times each algo
474475
openblas_set_num_threads(1);
475-
for (int i=8; i<11; i++){
476+
for (int i=8; i<13; i++){
476477
int n = (int) pow(2, i);
477478
int b = get_blocksize(get_bitsize(p), n);
478479

@@ -580,42 +581,45 @@ void clean_file_float_integer(){
580581
int main(){
581582
// Initialization
582583
srand(time(NULL));
583-
// double p = pow(2, 26) - 5;
584+
double p = pow(2, 26) - 5;
584585
// double p = pow(2, 24) - 3;
585586
// double p = pow(2, 22) - 3;
586587
// double p = pow(2, 20) - 3;
587-
double p = pow(2, 18) - 5;
588+
// double p = pow(2, 18) - 5;
588589

589590
// Precomputed constants for Modular functions
590591
double u = 1.0 / p; // Constant for SIMD
591592
fesetround(FE_UPWARD);
592593
double u_overline = 1.0 / p; // Constant for SIMD2 and SIMD3
593594
fesetround(FE_TONEAREST);
594-
// Constants for Barrett which is the integer version of SIMD
595+
// Constants for Barrett reductionm, which is the integer version of SIMD
595596
u_int32_t t = 32;
596597
u_int32_t s = 30 + get_bitsize(p) - t;
597598
u_int32_t u_b = (int) (pow(2, s+t) / p);
598599

599600

600-
// Benchmarking order of loop.
601-
// clean_file_loops();
602-
// benchmark_loops_order(p);
601+
/* Benchmarking the order of loop. */
602+
clean_file_loops();
603+
benchmark_loops_order(p);
603604

604-
// Benchmarking different modulos.
605-
// clean_file_modulos();
606-
// benchmark_modulos(p, u, u_overline, u_b);
605+
/* Benchmarking different modulo techniques. */
606+
clean_file_modulos();
607+
benchmark_modulos(p, u, u_overline, u_b, s, t);
607608

608-
// Benchmarking different modulos with OpenMP
609-
// clean_file_modulos_MP();
610-
// benchmark_modulos_MP(p, u, u_overline, u_b);
609+
/* Benchmarking parallelism apporach with previous modulo techniques. */
610+
clean_file_modulos_MP();
611+
benchmark_modulos_MP(p, u, u_overline, u_b, s, t);
611612

612-
// Benchmarking blocks.
613-
// clean_file_blocks();
614-
// benchmark_blocks(p, u_overline);
613+
/* Benchmarking block product approach. */
614+
clean_file_blocks();
615+
benchmark_blocks(p, u_overline);
615616

616-
// clean_file_blocks_MP();
617-
// benchmark_blocks_MP(p, u_overline);
617+
/* Benchmarking the final mixed implementation. */
618+
clean_file_blocks_MP();
619+
benchmark_blocks_MP(p, u_overline);
618620

621+
/* Benchmarking the progress made during this internship and work completed
622+
last year, using the same environment: 1 thread only, same A, B and p. */
619623
clean_file_float_integer();
620624
double P[5];
621625
P[0] = pow(2, 26) - 5;

0 commit comments

Comments
 (0)