optimization - Julia uses only 20-30% of my CPU. What should I do? -
i running program numeric ode integration in julia. running windows 10 (64bit), intel core i7-4710mq @ 2.50ghz (8 logical processors).
i noticed when code running on julia, max 30% of cpu in usage. going parallelazation documentation, started julia using: c:\users\*****\appdata\local\julia-0.4.5\bin\julia.exe -p 8
, expected see improvements. did not see them however.
therefore question following: there special way have write code in order use cpu more efficiently? maybe limitation posed operating system (windows 10)?
i submit code in julia console command: include("c:\\users\\****\\appdata\\local\\julia-0.4.5\\13. fast filesaving format.jl")
.
within code use additional packages with: using ode; using pyplot; using jld
.
i measure cpu usage windows' "task manager".
the -p 8
option julia
starts 8 worker processes, , disables multithreading in libraries blas , fftw workers don't oversubscribe physical threads on system – since kills performance in well-balanced distributed workloads. if want more speed out of -p 8
need distribute work between workers, e.g. having each of them independent computation, or having collaborate on computation via sharedarrays
. can't add workers , not change program. if using blas (doing lots of matrix multiplies) or fftw (doing lots of fourier transforms), if don't use -p
flag, you'll automatically multithreading libraries. otherwise, there no (non-experimental) user-level threading in julia yet. there experimental threading support , version 1.0 support threading, wouldn't recommend yet unless you're expert.
Comments
Post a Comment