Julia
Overview
Julia: The Julia Language: A fresh approach to technical computing.
Using
Use the module name julia
to discover versions available and to load the language.
Multicore
Julia is developed to work within parallel computing environments within asynchronous tasks, multi-threading, distributing computing as well as on GPUs.
For getting started with Multi-Threading and using multicores, you need to explicitly inform Julia how many cores to use, for example:
[@blog1 testing]$ cat num_of_threads.jl
println("Num of Threads: ", Threads.nthreads())
[@blog1 testing]$ salloc -A <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, from our observations your code will still only run on the number of actual cores requests:
[@m001 testing]$ export JULIA_NUM_THREADS=16
[@m001 testing]$ julia num_of_threads.jl
Num of Threads: 16
# Only 8 cores will actually be used.
MPI
ARCC has performed some basic testing with the MPI package on Beartooth. The process we used to set up the environment was:
We have observed the following warning the first (and only) time running MPI related code:
Note: Every time your wish to run/test your MPI related Julia code you will need to module load
the openmpi
module alongside julia
.