Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Multicore

Julia is developed to working work within parallel computing environments within asynchronous tasks, multi-threading, distributing computing as well as on GPUs.

...

Code Block
[@blog1 testing]$ cat num_of_threads.jl
println("Num of Threads: ", Threads.nthreads())

[@blog1 testing]$ salloc -A arcc<your-project> -t 1:00:00 -c 8
[@m001 testing]$ julia num_of_threads.jl
Num of Threads: 1
[@m001 testing]$ export JULIA_NUM_THREADS=8
[@m001 testing]$ julia num_of_threads.jl
Num of Threads: 8
[@m001 testing]$ julia --threads 4 num_of_threads.jl
Num of Threads: 4

Although you can define more threads than requested cores, from our observations your code will still only run on the number of actual cores requests:

...