stefan-m-lenz / JuliaConnectoR

A functionally oriented interface for calling Julia from R
Other
100 stars 6 forks source link

Mutlithreading through juliaConnectoR #7

Closed bakaburg1 closed 3 years ago

bakaburg1 commented 3 years ago

Hello! First of all many compliments for this package, it is quite well done!

I am a bit confused about how should juliaConnectoR be used to harness Julia multithreading capabilities. I understood that one needs to start Julia with the -t option to use multiple threads, but I wouldn't know how to do it through juliaConnectoR.

Many Thanks!

stefan-m-lenz commented 3 years ago

Thanks!

The number of threads in Julia can also be set via the JULIA_NUM_THREADS environment variable. The environment variable can be set also from R. It needs to be set before starting Julia:

> library(JuliaConnectoR)
> Sys.setenv(JULIA_NUM_THREADS = 6)
> juliaCall("Threads.nthreads")
Starting Julia ...
[1] 6
bakaburg1 commented 3 years ago

Great, thanks!

Il giorno sab 5 giu 2021 alle ore 20:25 Stefan Lenz < @.***> ha scritto:

Thanks!

The number of threads in Julia can also be set via the JULIA_NUM_THREADS environment variable. The environment variable can be set also from R. It needs to be set before starting Julia:

library(JuliaConnectoR) Sys.setenv(JULIA_NUM_THREADS = 6) juliaCall("Threads.nthreads") Starting Julia ... [1] 6

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stefan-m-lenz/JuliaConnectoR/issues/7#issuecomment-855277522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF52WF62BEZIUKK57S56O3TRJTYRANCNFSM46EZ7GZQ .