-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomparison.sh
88 lines (66 loc) · 1.47 KB
/
comparison.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
83
84
85
86
87
88
#!/bin/sh
#############
## FORTRAN ##
#############
cd fortran
echo "Fortran (ifort -O0): "
ifort fdtd2Ds.f90 -o fdtd-slow.exe -O0
time ./fdtd-slow.exe
echo "Fortran (ifort -O3): "
ifort fdtd2Ds.f90 -o fdtd.exe -O3
time ./fdtd.exe
echo "Fortran (gfortran): "
gfortran fdtd2Ds.f90 -o fdtd_gfortran.exe -O3
time ./fdtd_gfortran.exe
echo "Fortran (ifort -04 -... agresive)"
ifort fdtd2Ds.f90 -o fdtd_agressive.exe -O4 -check nobounds -xAVX -ftz -shared-intel -mcmodel=medium
time ./fdtd_agressive.exe
cd ..
###########
## JULIA ##
###########
cd julia
echo "julia :"
julia fdtd2ds.jl
#echo "julia (profiling version) :"
# profiler get confused by @simd/@inbounds in
# fdtd2ds.jl so I use fdtd2ds_prof.jl to spot the hotpots
#julia-b24213b893/bin/julia fdtd2ds_prof.jl
cd ..
############
## PYTHON ##
############
cd python
echo "python vectorised :"
python fdtd_wave_equation.py
echo "python loop+numba(jit) :"
python fdtd_wave_equation_jitted.py
cd ..
############
## MATLAB ##
############
cd matlab
echo "matlab :"
matlab -nodesktop -nosplash -r run
cd ..
##########
## RUST ##
##########
cd rust
cd old
echo "rust (homemade arrays):"
cargo build --release
time cargo run --release
cd ..
cd new
echo "rust (ndarray + unsafe):"
#if (uname)
#if [[ "$unamestr" == 'Linux' ]]; then
# cargo build --release -target=x86_64-unknown-linux-gnu --target-cpu=native
#else; then
# cargo build --release
#fi
#time cargo run --release
cargo build --release
time cargo run --release
cd ..