You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains benchmark scripts used during the development of SIMD optimizations for SLiM. These files are provided for internal development use and are **not used in the build of SLiM**.
4
+
5
+
## Contents
6
+
7
+
-**`run_benchmarks.sh`** - Shell script that builds SLiM with and without SIMD, runs both benchmark scripts, and reports speedup comparisons.
8
+
9
+
-**`simd_benchmark.eidos`** - Eidos script that benchmarks SIMD-optimized math functions (`sqrt`, `abs`, `floor`, `ceil`, `round`, `trunc`, `sum`, `product`) on large arrays.
10
+
11
+
-**`slim_benchmark.slim`** - SLiM simulation benchmark (N=5000, 1Mb chromosome, 5000 generations with selection) for measuring overall simulation performance.
12
+
13
+
## Author
14
+
15
+
These benchmarks were developed by Andrew Kern as part of SIMD optimization work for SLiM.
16
+
17
+
## Usage
18
+
19
+
These files are not part of the SLiM build system. To run the benchmarks:
20
+
21
+
```bash
22
+
cd simd_benchmarks
23
+
./run_benchmarks.sh [num_runs]
24
+
```
25
+
26
+
This will build both SIMD-enabled and scalar versions of SLiM, run the benchmarks, and report the speedup.
27
+
28
+
## Results
29
+
30
+
Benchmark results look like the following (example output):
31
+
32
+
```
33
+
$ simd_benchmarks/run_benchmarks.sh
34
+
============================================
35
+
SIMD Benchmark Runner
36
+
============================================
37
+
SLiM root: /home/adkern/SLiM
38
+
Runs per benchmark: 3
39
+
40
+
Building with SIMD enabled...
41
+
Done.
42
+
Building with SIMD disabled...
43
+
Done.
44
+
45
+
============================================
46
+
Eidos Math Function Benchmarks
47
+
============================================
48
+
49
+
SIMD Build:
50
+
Running Eidos benchmark (SIMD)...
51
+
sqrt(): 0.105 sec
52
+
abs(): 0.171 sec
53
+
floor(): 0.164 sec
54
+
ceil(): 0.166 sec
55
+
round(): 0.164 sec
56
+
trunc(): 0.165 sec
57
+
sum(): 0.032 sec
58
+
product(): 0.003 sec (1000 elements, 10000 iters)
59
+
60
+
Scalar Build:
61
+
Running Eidos benchmark (Scalar)...
62
+
sqrt(): 0.108 sec
63
+
abs(): 0.166 sec
64
+
floor(): 0.231 sec
65
+
ceil(): 0.246 sec
66
+
round(): 0.473 sec
67
+
trunc(): 0.246 sec
68
+
sum(): 0.166 sec
69
+
product(): 0.017 sec (1000 elements, 10000 iters)
70
+
71
+
============================================
72
+
SLiM Simulation Benchmark
73
+
(N=5000, 5000 generations, selection)
74
+
============================================
75
+
76
+
Running 3 iterations each...
77
+
78
+
SIMD Build: 12.756s (avg)
79
+
Scalar Build: 12.316s (avg)
80
+
81
+
Speedup: .96x
82
+
83
+
============================================
84
+
Benchmark complete
85
+
============================================
86
+
```
87
+
so the takeaway is that SIMD provided significant speedups for eidos math functions, while the overall SLiM simulation speedup was minimal in this specific benchmark scenario.
0 commit comments