Skip to content

Latest commit

 

History

History

Mathematica

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Purpose:

Example code to illustrate Mathematica use on the FASRC cluster. The specific example computes PI via Monte-Carlo method.

Contents:

  • pi_monte_carlo.m: Mathematica source code
  • run.sbatch: Batch-job submission script

Example Batch-Job Submission Script:

#!/bin/bash
#SBATCH -J pi_monte_carlo
#SBATCH -o pi_monte_carlo.out
#SBATCH -e pi_monte_carlo.err
#SBATCH -p test
#SBATCH -N 1
#SBATCH -c 1
#SBATCH -t 0-00:30
#SBATCH --mem=4000

# Load required software modules
module load mathematica/13.3.0-fasrc01
srun -n 1 -c 1 math -script pi_monte_carlo.m

Example Usage:

module load mathematica/13.3.0-fasrc01
sbatch run.sbatch

Example Output:

$ cat pi_monte_carlo.out
3.141592653589793
3.1411491999999996
19.342046`7.738047405306663