What is Julia

Julia is a relatively young programming language for numerical computing with JIT (Just-In-Time) techniques implemented for faster execution.

Using Julia in HPC system

To setup required environment variables for Julia, please use following command. The version shown in bold is the default version on the corresponding HPC system.

System Julia version Command
HPC2021 1.6.1 module load julia/1.6.1

To work with Julia code interactively, type julia . To quit the julia environment, type exit() in the julia prompt.

Interactive process that executes over 15 minutes would be killed automatically. User are advised to run Julia in batch mode by submitting job to the SLURM queuing system with the way specified in the next heading.

Run batch Julia jobs

julia --history-file=no < INPUT_FILE > OUTPUT_FILE

Or, alternatively

julia --history-file=no INPUT_FILE.jl > OUTPUT_FILE

Run parallel Julia jobs

Julia has its own @parallel keyword which provides both internode and intranode parallelism natively. Other libraries, such as OpenMP or MPI, are not needed.

Julia documentation on the @parallel keyword is at https://docs.julialang.org/en/v0.6.2/stdlib/parallel/#Base.Distributed.@parallel

Sample SLURM command files and programs for both serial and parallel Julia program are provided at /share1/julia/samples

Julia Package Managements

To initiate Julia’s built-in package managee, the “pkg” mode, press ] key in the command prompt (to leave that mode, “backspace” at an empty prompt or use Ctrl+C). That should be acceptable for most users.

Selected package management commands:

To initialize the package directory, use activate.

To list packages installed, use status.

To install a package called Example, type: add Example.

For others, one is advised to consult Julia documents.

Further Readings

Official Julia documentations: https://docs.julialang.org/
Julia package list: https://pkg.julialang.org/