-
Notifications
You must be signed in to change notification settings - Fork 0
/
wl1ball_runtime_benchmark.jl
43 lines (35 loc) · 1.48 KB
/
wl1ball_runtime_benchmark.jl
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
#w1ball_runtime_benchmark.jl
using BenchmarkTools, Random, Distributions
BenchmarkTools.DEFAULT_PARAMETERS.gcsample = true
BenchmarkTools.DEFAULT_PARAMETERS.samples = 100
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 20
include("weighted_simplex_and_ball/wl1ball.jl")
println("You are using ", nthreads(), " threads for parallel computing")
println("Warning: following experiments are for 80 threads!")
function wsortscan_test()
Random.seed!(12345); res = @benchmark wball_sortscan_s($(rand(Normal(0,1), 10^8)), $(rand(10^8)), 1)
println("serial: ", median(res))
for i = 1:10
Random.seed!(12345); res = @benchmark wball_sortscan_p($(rand(Normal(0,1), 10^8)), $(rand(10^8)), 1, )
println(i*8, " : ", median(res))
end
end
function wmichelot_test()
Random.seed!(12345); res = @benchmark wball_michelot_s($(rand(Normal(0,1), 10^8)), $(rand(10^8)), 1)
println("serial: ", median(res))
for i = 1:10
Random.seed!(12345); res = @benchmark wball_michelot_p($(rand(Normal(0,1), 10^8)), $(rand(10^8)), 1, $(i*8))
println(i*8, " : ", median(res))
end
end
function wcondat_test()
Random.seed!(12345); res = @benchmark wball_condat_s($(rand(Normal(0,1), 10^8)), $(rand(10^8)), 1)
println("serial: ", median(res))
for i = 1:10
Random.seed!(12345); res = @benchmark wball_condat_p($(rand(Normal(0,1), 10^8)), $(rand(10^8)), 1, $(i*8))
println(i*8, " : ", median(res))
end
end
wsortscan_test()
wmichelot_test()
wcondat_test()