Closed mwappner closed 2 years ago
Thanks for reporting. There were two issues here:
jitcdde
implicitly and unnecessarily assumed that delays
was a list instead of a general iterable. This is now fixed.τ
is an array. Therefore we have to flatten it before passing it to jitcdde
as the parameter delays
.So, to use this speed-up (without updating) you need to call:
I = jitcdde(kuramotos,n=n,verbose=False, delays=list(τ.flat))
After that, specifying max_delay
should not result in a relevant speed-up. Mind that since A
and τ
are random, they influence the runtime as well, so you should fix random
’s seed when benchmarking.
Finally, I also added using the delays
parameter to the documentation as suggested. I wouldn’t consider the network large yet and the speed-up is only about 0.3 s on my machine, but it’s not bad to illustrate this.
The documentatio for this library encourages the user to give the model builder the
delay
andmax_delay
of a system when the system is large to cut down on overhead to the pre-processing times of the model. For this reason, I think the Kuramoto example should include this when defining the model:The line as written above doesn't work, and I'm not sure why; it throws
The example should of course include a working version of the line above. Note that on my system adding only the
max_delay
parameter reduced pre-processing times by 20% (from 1.9 seconds average to around 1.55). I'd expect the addition ofdelay
to make this even faster.