Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article gives a 3 simple examples showing how to run Mathematica on Talapas.

Versions

We have several versions available, to view run, module available Mathematica

Talapas Desktop

  1. Access Open OnDemand, Open OnDemand

  2. In the top ribbon, select the ‘Interactive Apps' dropdown menu. Choose ‘Talapas Desktop'.

  3. Enter account and job resource information. Once an allocation is granted, click 'Launch noVNC in New Tab'.

  4. In the top ribbon of the Talapas Desktop, click the MATE Terminal icon to open a terminal window.

  5. Enter,

Code Block
module load Mathematica
mathematica

This will launch the Mathematica 12 GUI.

Versions

As of this article update, we have the following versions of R installed on Talapas:

Code Block
3.3.3
3.3.3_intel-17
3.4.1
3.4.2
3.4.3
3.4.4
3.5.1
3.5.3
3.6.1
3.6.1_gcc7
3.6.2
4.0.2
4.0.2_gcc7
Info

Note: packages within each version of R are not the same! There may be different packages or different package versions.

Intel R

Intel is the default. To run an Intel compiled version of R, e.g 4.0.2, run:

Code Block
$ module load R/4.0.2
$ R

gcc R

We have 2 versions of R compiled with gcc7 (3.6.1_gcc7 and 4.0.2_gcc7) built specifically to support RStan. To use these versions you must first load gcc. E.g. 4.0.2, run:

Code Block
$ module load gcc

Lmod is automatically replacing "intel/17" with "gcc/7.3".

$ module load R/4.0.2
$ R

Verify the path of the R executable that is loaded use the bash command which:

Code Block
$ which R
/packages/R/4.0.2_gcc7/bin/R

The output above shows the executable to R version 4.0.2 built with gcc7.

R Packages

To list installed packages and version information, run:

Code Block
$ module load R/4.0.2
$ R
> installed.packages()[,c("Package","Version")]
                     Package                Version
abind                "abind"                "1.4-5"
...

Running R Interactive

  1. ssh onto a talapas login node, How-to Log Into Talapas

  2. Start an interactive job, How-to Start an Interactive Job

  3. Once on the allocated node enter,

Code Block
$ module load Mathematica
math

This will launch the Mathematica 12 Kernel.

R/4.0.2
$ R

Running R in Batch

For longer running non-interactive use cases call Mathematica R in batch. Create the file math

First, create your file, e.g. demo.r, which contains R syntax.

Next, create your batch job file, e.g. r-job.srun. In the file, and add the desired slurm declarations, load the module(s), and call to the application.

Code Block
languagebash
#!/bin/bash

#SBATCH --account=<pirg-name>
#SBATCH --job-name=matr-job
#SBATCH --output=matr-job.out
#SBATCH --error=matr-job.err

module load MathematicaR/4.0.2

mathR -run-save < math-file.m/gpfs/projects/<pirg-name>/<user-name>/demo.r
Info

‘Save current workspace’ with --save

The example above preserves R session output. Also include the save.image function in your demo.r file, e.g. save.image("/gpfs/projects/<pirg-name>/<user-name>/demo.RData")

Submit the job

Use the sbatch command to submit the job.

Code Block
languagebash
$ sbatch matr-job.srun