edwardlavender / patter

Particle filters, smoothers and sampling algorithms for animal movement modelling, with a focus on passive acoustic telemetry systems.
https://edwardlavender.github.io/patter/
Other
2 stars 1 forks source link

Set threads on Windows #11

Open edwardlavender opened 1 month ago

edwardlavender commented 1 month ago

On Windows, setting threads via .threads in julia_connect() or via JULIA_NUM_THREADS does not work.

See also: https://github.com/Non-Contradiction/JuliaCall/issues/193

edwardlavender commented 1 month ago

See here https://github.com/Non-Contradiction/JuliaCall/issues/193#issuecomment-2259955184 for a work around on Windows. Either set JULIA_NUM_THREADS from CMD (as an administrator) and launch R/RStudio from the same CMD session or modify the JULIA_NUM_THREADS environment variable globally.

In R/RStudio, you can then run:

library(patter)
julia_connect()

in the usual way and the Julia process will be started with JULIA_NUM_THREADS.