Mathematica

Mathematica is a software system for numerical, symbolic, and graphical computations and visualization. Mathematica delivers users an interactive calculation tool and versatile programming language for fast and accurate solutions to technical problems.

Interactive Mode

  1. SSH onto the mercury login node with X11 forwarding ssh -X <BoothID>@mercury.chicagobooth.edu

  2. Request an interactive session on a compute node srun --pty bash --login

  3. Load the module with the desired version of Mathematica module load mathematica/12.1.0

  4. Start Mathematica by typing: mathematica

Note

Remember to use X11 forwarding to connect to Mathematica in interactive mode

Batch Mode

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

  2. Navigate to the folder containing your input script (example.nb) cd /path/to/working/dir

  3. Write a submission script

  4. Submit the batch job by typing: sbatch submit.sh

sample submit script
 1#!/bin/bash
 2#SBATCH --job-name=math_example
 3#SBATCH --account=phd
 4#SBATCH --partition=standard
 5
 6# load the appropriate module
 7module load mathematica/12.1.0
 8
 9# name of input source script
10myscript=example.m
11
12# run the mathematica notebook
13math -script ${myscript}