Raad2: Julia

From TAMUQ Research Computing User Documentation Wiki
Jump to navigation Jump to search


Introduction

TBD

Available version on raad2

- 1.5.2

Submitting Interactive Job

# Submit a 02 Core Job.
muarif092@raad2a:~> sinteractive
muarif092@nid00388:~> module load julia/152
muarif092@nid00388:~> julia --threads 2
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.2 (2020-09-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> Threads.nthreads()
2
julia> a = zeros(10)
julia> Threads.@threads for i = 1:10
           a[i] = Threads.threadid()
       end

julia> a
julia> exit
muarif092@nid00388:~> exit
exit
Connection to raad2-login2 closed.
muarif092@raad2a:~>

Submitting Batch Job

Sample job file and Julia script can be found here; /lustre/share/examples/slurm-sample-jobs

A sample batch job should like below;

slurm.job

#!/bin/sh
#SBATCH -J julia_job
#SBATCH -p s_long
#SBATCH --qos=sl
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --output=DemoJob.o%j
#SBATCH --error=DemoJob.o%j
#SBATCH --hint=nomultithread
#SBATCH --gres=craynetwork:0    # Do not remove this line if you are submitting to s_short, s_long and s_debug

# This is a template job to RUN Julia Program
module load Julia/152
srun -n 1 julia --threads 8 script.jl

script.jl

a = zeros(50)
Threads.@threads for i = 1:50
           a[i] = Threads.threadid()
       end
println(a)