General information
Mathematica is a platform for all forms of computations. It's used mostly for symbolic math but can do much more. The full manual is available from the program level and on the web.
There are 7 Mathematica licenses available at CAMK. The software consists of two independent components - the graphical frontend and the kernel, so actually there are 7 frontend licenses and 7 kernel licenses. Each of them can be used separatelly, e.g. the frontend for editing notebooks and the kernel for calculations in the text mode (useful in the batch system).
Please do not leave Mathematica sessions open when not needed!
To display current usage of the Mathematica licenses type monitorlm
on chuck.
If all the licenses are busy please negotiate directly with their users. System administrators can kill abandoned (no immediate contact), idle (no kernel activity) sessions.
To start Mathematica on any workstation in the CAMK network type mathematica
or (if it wasn't set up) /Vol/share/Mathematica/<select version>/Executables/mathematica.
On the cluster - remember to login to chcuk with X forwarding: ssh -X chuck .
Various ways of using Mathematica under the queueing system are presented below. Please refer to man sbatch/srun
and Cluster user's guide to learn about the queueing system and job submission.
2+2 Integrate[x,{x,0,1}]To process it and save the output to outfile.m file type
math < infile.m > outfile.m
math -nopromt < infile.m > outfile.m
#SLURM -N batch_math1
#SLURM -mem=100m
#SLURM -p short
cd my_directory math < infile.m > outfile.m
Tip
To convert Mathematica notebook file into plain text file use Mathematica's Front End features:Tip
By default only output lines go to standard output. If you want also input lines to appear there add in the first line of yourinfile
:AppendTo[$Echo, "stdout"]
a=Plot[Cos[2*x],{x,0,Pi}] Export["a.eps",a]Log in to the cluster frontend:
ssh -X chuck
and submitt a job script like this:
#SLURM -N batch_math1
#SLURM -mem=100m
#SLURM -p short
cd my_directory math < in.m > outfile.m
> srun --pty bash -l
> math
Quit
and to finish the job type logout
.> mathematica
Tip
You can also create the job script to start an interactive session. (Each line starting with #PBS is expected to contain command line options to qsub). Example: qsub jobfile wherejobfile
contains
#SLURM -N math_job1
#SLURM -mem=100m
#SLURM -p short
#SLURM --pty
Log in to chuck
ssh -X chuck
(the -X is important) and type
mathematica
That's it! Remember that all the limits for interactive processes on chuck apply (the cpu time and memory limits are listed in the message after you log in).
On some systems an error message may pop up during frontend start - do not click OK, close this window with the small cross in the upper right corner instead. If you can't see mathematical symbols properly please send request to adm@camk.edu.pl
to install the mathematica fonts on your computer.