Please note!

The provision and support of Mathematica on LRZ HPC systems (Supercomputer, Linux Cluster) will end on 31.12.2022!


What is Mathematica?

Mathematica is a computer algebra system which can be utilized for symbolic and numerical computing as well as visualization.

Please refer to https://www.wolfram.com for further details and software documentation.

License Terms and Usage Conditions

The LRZ governs a Campus agreement with Wolfram. Access to Mathematica can be provided to following institutions:

  • Ludwig-Maximilians-Universität München (LMU Munich)
  • Technical University of Munich (TUM)
  • University of Applied Sciences Munich (HM)
  • Weihenstephan-Triesdorf University of Applied Sciences

Please consult https://www.lrz.de/services/swbezug/ for details on licensing.

Basic usage

Mathematica modules

On LRZ HPC systems, you may list all available Mathematica versions:

module avail mathematica

Mathematica can be used by loading its module. We highly recommend to choose a particular – better: the newest – version, e. g.:

module load mathematica/12.0

Basic commands

  • Start Mathematica without GUI (recommended option):

    > math
  • Start Mathematica with GUI:

    > mathematica

Common Batch Job

Batch jobs are used for all Mathematica production runs. We highly recommend to use batch jobs. Note: In batch jobs you must provide a Mathematica script to the math command! Due to a missing X-server on compute nodes, you may not use graphical operations. The following table summarizes Slurm scripts for typical use cases.

CoolMUC-2CoolMUC-2SuperMUC-NG

Slurm job script

Serial job

Slurm job script

Memory-intensive serial job or parallel job on a single compute node

Slurm job script

Memory-intensive serial job or parallel job on a single compute node

math_serial_cm2.slurm
#!/bin/bash
#SBATCH -o ./out/math_job.%j.%N.out
#SBATCH -e ./out/math_job.%j.%N.err
#SBATCH -D ./
#SBATCH -J math_serial_batch_job
#SBATCH --get-user-env
#SBATCH --export=NONE
#SBATCH --clusters=serial
#SBATCH --partition=serial_std
#SBATCH --nodes=1
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=10000
#SBATCH --time=0:30:00
# As needed, modify memory option "--mem" in MB
 
module load slurm_setup

module load mathematica/12.0

cd my_work_dir
math -noprompt -script mathematica_script.m > out.log
math_parallel_cm2.slurm
#!/bin/bash
#SBATCH -o ./out/math_job.%j.%N.out
#SBATCH -e ./out/math_job.%j.%N.err
#SBATCH -D ./
#SBATCH -J math_parallel_batch_job
#SBATCH --get-user-env
#SBATCH --export=NONE
#SBATCH --clusters=cm2_tiny
#SBATCH --partition=cm2_tiny
#SBATCH --nodes=1
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=28
#SBATCH --time=0:30:00
 
module load slurm_setup

module load mathematica/12.0

cd my_work_dir
math -noprompt -script mathematica_script.m > out.log
math_parallel_sng.slurm
#!/bin/bash
#SBATCH -o ./out/math_job.%j.%N.out
#SBATCH -e ./out/math_job.%j.%N.err
#SBATCH -D ./
#SBATCH -J math_parallel_batch_job
#SBATCH --get-user-env
#SBATCH --export=NONE
#SBATCH --partition=micro
#SBATCH --nodes=1
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=48
#SBATCH --time=00:30:00
#SBATCH --account=insert_your_projectID_here

module load slurm_setup

module load mathematica/12.0

cd my_work_dir
math -noprompt -script mathematica_script.m > out.log
  • No labels