File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ #=
2+ This file benchmarks the parallel and serial computation of a recurrence matrix
3+ =#
4+ using DynamicalSystemsBase, RecurrenceAnalysis
5+ using Statistics, BenchmarkTools, Base. Threads
6+
7+ Ns = round .(Int, 10.0 .^ (2 : 0.5 : 4.5 ))
8+ ro = Systems. roessler ()
9+
10+ println (" I am using $(nthreads ()) threads. I am reporting results as:" )
11+ println (" time of (parallel/serial) for 3D and 1D trajectories." )
12+ for N in Ns
13+ tr = trajectory (ro, N* 0.1 ; dt = 0.1 , Tr = 10.0 )
14+ println (" For N = $(length (tr)) ..." )
15+ x = tr[:, 1 ]
16+ b_serial = @benchmark RecurrenceMatrix ($ (tr), 5.0 ; metric = Euclidean (), parallel = false )
17+ b_parallel = @benchmark RecurrenceMatrix ($ (tr), 5.0 ; metric = Euclidean (), parallel = true )
18+ b_s_1 = @benchmark RecurrenceMatrix ($ (x), 2.0 ; parallel = false )
19+ b_p_1 = @benchmark RecurrenceMatrix ($ (x), 2.0 ; parallel = true )
20+ threeD = median (b_serial. times)/ median (b_parallel. times)
21+ oneD = median (b_s_1. times)/ median (b_p_1. times)
22+ threeD, oneD = round .((threeD, oneD); sigdigits = 3 )
23+ println (" 3D=$(threeD) , 1D=$(oneD) " )
24+ end
You can’t perform that action at this time.
0 commit comments