Julia

Julia

Julia [1] is a flexible dynamic language, appropriate for scientific and numerical computing, with performance comparable to traditional statically-typed languages. Julia provides ease and expressiveness for high-level numerical computing, in the same way as languages such as R, MATLAB, and Python, but also supports general programming. To achieve this, Julia builds upon the lineage of mathematical programming languages, but also borrows much from popular dynamic languages, including Lisp, Perl, Python, Lua, and Ruby.

Running Julia in HPC

Interactive Job

Request a node (rider). 

srun -c 4 --mem=16gb -t 6:00:00 --pty bash

Note: In Rider, Julia can run only in particular set of nodes (srun -C dodeca96gb --pty bash). Also, syntax may have been changed e.g. need to use include instead of require.

Load the module

module load julia

Run Julia

julia

julia> string(10*15)

"150"

shell> echo "Hello World"

Hello World

julia>

Note: julia gets transitioned to shell mode by typing colon (;) after the prompt. For details, visit [2]. Press  "Ctrol + d" to exit

Batch Job

Example: WordCount

Copy the directory "examples" from /usr/local/doc/JULIA and cd to that directory

cp -r /usr/local/doc/JULIA/examples .

cd examples

Serial Job

Submit the Serial job

sbatch job-serial.slurm

See the output in the output.txt file.

silk=48

Moist=1

Dando=3

gay=20

again)_=5

Kuk!=1

Paglia=2

Burke's=4

...

Parallel Job

Submit the Parallel job

sbatch job-parallel.slurm

You will see the similar output as serial job

References:

[1] Julia Home