This lesson is being piloted (Beta version)

Parallel with Julia

Overview

Teaching: 5 min min
Exercises: 0 min
Questions
  • How to run parallel with Julia in Palmetto

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

where is the process ID which you can get from top or from ps -u .

Key Points

  • parallel, julia