Parallel with Julia
Overview
Teaching: 5 min min
Exercises: 0 minQuestions
How to run parallel with Julia in Palmetto
Objectives
- Request compute node with multiple cores:
qsub -I -l select=1:ncpus=16:mem=32gb:interconnect=any,walltime=4:00:00
- Load the Julia module:
$ module load julia/1.4.0-gcc/8.3.1
- Set the environment variable JULIA_NUM_THREADS to the number of requested CPUs:
$ export JULIA_NUM_THREADS=8
- Start Julia with -p option to specify the number of workers:
julia -p 8
- Within Julia, load the Distributed package:
julia> using Distributed
- Double check that the number of threads is set properly:
julia> println(Threads.nthreads())
- You can use this option with ps:
ps -p <pid> -L -o pid,tid,psr,pcpu
where
Key Points
parallel, julia