Julia

Simple Julia

Interactive Mode

  1. SSH onto the mercury login node ssh <BoothID>@mercury.chicagobooth.edu

  2. Request an interactive session on a compute node srun --account=<account> --pty bash --login

  3. Browse the software modules to find the appropriate version module avail

  4. Load the module with the desired version module load julia/1.8

  5. Start the command-line REPL by typing: julia

Batch Mode

The following Julia script (hello_world.jl) is a simple script.

hello_world.jl
1println("Hello, World!")

The previous script can be run on Mercury by creating a submit script (submit.sh) that contains job-specific information. Typing sbatch submit.sh will add your job to the queue.

submit.sh
 1#!/bin/bash
 2
 3#SBATCH --account=phd
 4
 5#SBATCH --partition=standard
 6#SBATCH --mem=2G
 7#SBATCH --time=0-01:00:00
 8
 9#SBATCH --job-name=simple_program
10
11# load the Julia module
12module load julia/1.8
13
14# execute Julia script
15srun julia hello_world.jl