Mathematica

Description

Mathematica is the tool of choice at the frontiers of scientific research, in engineering analysis and modeling, in technical education from high school to graduate school, and wherever quantitative methods are used.

Version

  • 12.3

Authorized Users

  • CIRCE account holders
  • RRA account holders
  • SC account holders

Platforms

  • CIRCE cluster
  • RRA cluster
  • SC cluster
  • Workstation/PC

Modules

Mathematica requires the following module file to run:

  • apps/mathematica/12.3

Installation

Please note: in order to install/use Mathematica, you must do one of the following:

  • Use Mathematica from a machine on-campus (ex: a desktop/laptop connected via wired/wifi)
  • Use the USF VPN (https://vpn.usf.edu) to connect from off-campus first, then start Mathematica


Installing Mathematica On Windows

  1. Log into https://mirror.rc.usf.edu/isos/Mathematica/V12.3/ using your NetID and password.
  2. Download the Mathematica_12.3.1_WIN.zip, and double-click it to unpack and start the installation.
  3. In the "Wolfram Mathematica Download Manager" window, click the Launch button
  4. In the "Wolfram Mathematica Setup" window, click Next
  5. In the "Destination Location" window, click Next
  6. In the "Select Components" window, ensure all boxes are checked, and click "Next"
  7. In the "Start Menu Folder" window, click Next
  8. In the "Ready to Install" window, click Install
  9. When the install is complete, ensure "Launch Wolfram Mathematica" is checked, and click Finish
  10. When Mathematica launches, it will open the "Wolfram Product Activation" window. Click on the Other ways to activate button.
  11. In the "Select a method to activate" window, click on Connect to a network license server
  12. In the "Connect to a Network License Server" window, enter license0.rc.usf.edu in the "Server name" box, and click the Activate button
  13. If you agree to the license terms, click the "I accept the terms of this agreement" check box, and click the Ok button
  14. Mathematica will now start as normal.

Installing Mathematica On Linux

  1. Log into https://mirror.rc.usf.edu/isos/Mathematica/V12.3/ using your NetID and password.
  2. Download the file named Mathematica_12.3.1_LINUX.sh to a temporary directory on your PC. Once the file has finished downloading you may disconnect from the FTP server.
  3. Next, become root user by using the su command. Then change to the temporary directory where you downloaded the sh file. Inside the temporary directory, run the following command:
    • # sh ./Mathematica_12.3.1_LINUX.sh
  4. For the first question (if asked), select (1) for a full installation or hit ENTER.
  5. For the second question regarding the installation path we recommend using the default directory. Press ENTER to continue or enter a different installation directory now. The installation should now start. Please be patient as files are copied over.
  6. For the last question about executable scripts, just press enter. if the installer says files already exist, select (1) or press ENTER to overwrite the old files.
  7. The next question asks if you would like to install a password. Please enter 2 for Network License. When the installer asks for a license server, please enter license0.rc.usf.edu and press enter.
  8. Once the installation is complete, you should be able to type in mathematica at the command line to start the program. If this does not work, you will have to add ‘/usr/local/bin’ to your path. Please edit your .bashrc file and add the line
    • PATH=$PATH:/usr/local/bin.
  9. Re-login to your computer and issue the mathematica command.
  10. The application launcher asks for a license key. Please select the “Additional Options” button and enter license0.rc.usf.edu in the license server field on the next screen.

Running Mathematica on CIRCE/SC

The Mathematica user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.

  • Note on CIRCE: Make sure to run your jobs from your $WORK directory!
  • Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.

Submitting a Job

There are two ways to run Mathematica on CIRCE depending on the runtime of your particular job.

Jobs Shorter than 30 Minutes in Length

Establishing a GUI connection to CIRCE/SC

To use Mathematica, you will need to connect to CIRCE/SC with GUI redirection, either using:

  • CIRCE/SC Desktop Environment
  • SSH with X11 redirection
    • If connecting from OSX or Linux via SSH, please ensure that you use one of the following commands to properly redirect X11:
      • [user@localhost ~]$ ssh -X circe.rc.usf.edu
        or
      • [user@localhost ~]$ ssh -X sc.rc.usf.edu

Once connected to CIRCE/SC, you can open Mathematica using the steps below:

[user@login0 ~]$ module add apps/mathematica/11.
[user@login0 ~]$ mathematica

Jobs Longer than 30 Minutes in Length

To run Mathematica jobs on CIRCE/SC, users will need to submit their jobs to the scheduling environment if their jobs take more than 30 minutes to run on a standard PC.

If, for example, you have a Mathematica script file named test.math with all your functions defined in it, you would set up a submit script to use the Mathematica kernel like this:

  • The script below (for testing, name it “mathematica-test.sh”) can be copied into your job directory (the folder with your input files) and modified so that you can submit batch processes to the queue.
#!/bin/bash
#
#SBATCH --comment=mathematica-test
#SBATCH --ntasks=1
#SBATCH --job-name=mathematica-test
#SBATCH --output=output.%j.mathematica-test
#SBATCH --time=00:30:00

#### SLURM 1 processor Mathematica test to run for 30 minutes.

module purge
module load apps/mathematica/13.0

math < test.math

 
Next, you can change to your job’s directory, and run the sbatch command to submit the job:

[user@login0 ~]$ cd my/jobdir
[user@login0 jobdir]$ sbatch ./mathematica-test.sh
  • You can view the status of your job with the “squeue -u <username>” command

Mathematica Notebook files

If you’re using Mathematica notebook files (.nb) and you wish to submit the job to CIRCE, you must first convert the notebook file to a Mathematica package file.

Please use the following steps to convert a notebook file to a standard Mathematica package.

  1. Open the notebook file in Mathematica.
  2. Clear out any solved calculations.
  3. Click on “Edit” and then “Select all”.
  4. Click on “Cell”, “Cell Properties”, and then select “Initialization Cell”.
  5. Click on “File”, “Save as”, and then change “Files of type” to “Mathematica Package”.

You’ll then use the file you just saved as an input file using the CIRCE submission sample above, e.g. “math < filesaved.m”.

Documentation

Home Page, User Guides, and Manuals

More Job Information

See the following for more detailed job submission information:

Reporting Bugs

Report bugs with Mathematica to the IT Help Desk: rc-help@usf.edu