Mathematica
Wolfram Mathematica is a modern technical computing system spanning most areas of technical computing - including neural networks, machine learning, image processing, geometry, data science, visualizations, and others. It is used in many technical, scientific, engineering, mathematical, and computing fields.External Links:
Mathematica website
Loading Mathematica
Currently there are three versions of Mathematica installed on HPC, 11.2.0, 12.0.0, and 14.1.0. To see the Mathematica modules available, type the command module avail mathematica.
The default version is 12.0.0. To use that version, load the default mathematica module
module load mathematicaIf you want to use the older version 11.2.0, then do
module load mathematica/11.2.0
Running Mathematica
Mathematica can be used in command mode for a batch job and can also be used in GUI mode for an interactive job.
Batch Mathematica
Here is an example batch job script. For more information on submitting batch job scripts and to see how to customize the a batch job script, check out the documentation on running jobs.
Suppose below is your input file test.m for Mathematica command math:
1+2 8-1 3*6 x=7 3x Sin[Pi/2] Cos[Pi/2] N[Exp[1]] N[Exp[2]]
To run the job in batch mode you create a batch job script named submit.sh containing:
#!/bin/bash #SBATCH --time=00:20:00 # Program will terminate after 20 minutes #SBATCH --ntasks=1 #SBATCH --output=out.%j # stdout goes to a file called "out." #SBATCH --error=err.%j # stderr goes to a file called "err. " module load mathematica math -noprompt < test.m
The job can be submitted as
sbatch submit.shThe job output in the Slurm output file "out.<Slurm job number>" should be like:
3 7 18 7 21 1 0 2.718281828459045 7.38905609893065
Interactive Mathematica
If it is necessary to run Mathematica in GUI mode, the HPC-VCL should be used. To run on the HPC-VCL, log in to an HPC-VCL node, and follow the instructions to create a reservation. After creating a reservation, you can connect to the HPC-VCL node in either of these ways: (1) download and launch the Remote Desktop (RDP) file provided by the VCL reservation, then open a terminal in that remote desktop session, or (2) SSH to the reserved node similarly to how you SSH to the login node now. For SSH from macOS, use the-X option for X11 forwarding and make sure an X11 display application is running. If you SSH using MobaXterm, the -X flag is not needed. After method (1) or method (2), run the commands below:
module load mathematica mathematica
Last modified: September 01 2026 21:22:40.
HPC Assistant