Skip to content

Mathematica

Mathematica is a computational software system for symbolic and numerical mathematics, visualization, and programming.

Loading the module

module load Mathematica/14.2.0

To see all installed versions across clusters, check the software catalog or run module spider Mathematica.

Expand to see all available modules on each cluster
Mathematica/11.0.1 Mathematica/13.2.1 Mathematica/14.2.0
Mathematica/12.1.1
Mathematica/7.0.1

Batch job example

mathematica.slurm
#!/bin/bash
#SBATCH --qos=regular
#SBATCH --job-name=mathematica
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
#SBATCH --time=02:00:00
#SBATCH --output=%x.%j.out
#SBATCH --error=%x.%j.err

module load Mathematica/14.2.0

math -noprompt -run < my_script.m

End your script with Quit[]

Always include Quit[] at the end of your .m file so that Mathematica exits after execution.

Parallel kernels

Mathematica can launch parallel sub-kernels with LaunchKernels[n]. If you use this, request the corresponding number of CPUs with --cpus-per-task.

See also