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 -l
  3. Browse the software modules to find the appropriate version module avail
  4. Load the module with the desired version module load julia/1.1.1
  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
1
println("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
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/bin/bash

#SBATCH --account=phd

#SBATCH --partition=standard
#SBATCH --mem=2G
#SBATCH --time=0-01:00:00

#SBATCH --job-name=simple_program

# load the Julia module
module load julia/1.1.1

# execute Julia script
srun julia hello_world.jl