![]() |
|||||||
|
Using Mathematica on Ada
04-Jun-2008 Introduction Mathematica
is a fully integrated technical computing system, combining
interactive calculation (both numeric and symbolic), visualization tools,
and a complete programming environment. There are currently two ways to run Mathematica on the Ada cluster as described
below. These examples are intended to present a very simple
configuration to run a minimal Mathematica job on Ada. Adjust your
configuration according to the complexity of your jobs. Running Mathematica with the Graphical User Interface In order to run Mathematica with the Graphical User Interface (GUI), follow the
steps below: 1. Login to Ada using SSHIn order to login to Ada, you must use the SSH software configured to
tunnel (or redirect) X displays:
2. Configure your Ada environment to run MathematicaAfter you have logged into Ada, use the module command to configure your Ada environment to run Mathematica.
The module command will establish all of the environment variables needed to run the Mathematica program. 3. Launch MathematicaRun the mathematica command to launch
the GUI. This will run Mathematica on one of Ada's login
nodes. From this point you will be able to write and test
your Mathematica programs using the GUI. It is important to note that if
you run a Mathematica program from this point, you will be running on the login
node, not on a compute node. This is acceptable only for
debugging of short programs
(< 30 minutes in duration). Programs using a lot of CPU time
on the login nodes will impact all users on the system.
Therefore, any programs found running for more than 30 minutes on the
login nodes are subject to being killed at the system administrators
descretion!
For instructions on setting up Mathematica fonts on Macintosh, Windows, and various versions of Unix, please see the Mathematica Technical Support website.
Running Mathematica on Compute NodesIt is preferable to run Mathematica jobs on the compute nodes of Ada, not the
login nodes. This is accomplished by running your Mathematica program
from inside a PBS batch script as follows:
1. Login to Ada using SSHLogin to Ada using SSH. X11
tunneling as described in the previous section is not required.
2. Configure your Ada environment to run MathematicaAfter you have logged into Ada, use the module command to configure your Ada environment to run Mathematica..
The module command will establish all of the environment variables needed to run the Mathematica program. 3. Write a Mathematica ProgramWrite your Mathematica program and save it in a file. For our example we will use a sample Mathematica program called math.m as illustrated below. This example will demonstrate a Mathematica program that accepts input from the command line and from a file while writing output to a file.
Save your program in a directory, such
as /home/adauser/mathematica where adauser is your username.
You may want to create your files using the nano, vi or emacs text editors or use the Mathematica
GUI. 4. Write a PBS Batch ScriptInclude your Mathematica program (math.m in our example) in a PBS batch script named math.pbs, for example, as follows:
NOTE:
This example will submit the math.m program to a single compute node on the cluster. Output from the program will be found in a file called output.dat.
Input will come from the command line arguments and a file called input.dat. The latter file should contain a single number. Output and
errors from the PBS batch script will be found in a file named JobID.OU and JobID.ER, respectively,
where JobID is the PBS Job ID
number assigned to your job. There will be a different
number for each job you submit. In the example above, substitute your username in place of adauser. 5. Submit the PBS JobOnce you have written the PBS batch script math.pbs above, you must submit the job to the scheduler as follows:
NOTE: This will
submit a single Mathematica job to a single processor on Ada. Use the showq command to determine if
your job is running or queued. In the example above, substitute your username in place of adauser. More Information (Mathematica User's Guide)The examples above are intended to be a very minimal example of how to
get a single Mathematica compute job to run on a compute node. There are
a variety of ways to run multiple jobs. One way to run multiple
jobs is to repeat the process above for each job that you need to
run. Thus, you would submit your jobs serially, one per PBS batch
script. You can also write Unix/Linux shell scripts to submit multiple jobs from within the shell script utilizing only one batch script. This topic is beyond the scope of this document. To get more help with Mathematica, use the Mathematica User's Guide available on the Wolfram Mathematica web site.
Getting HelpIf you need assistance running Mathematica on Ada, please contact the Help Desk at 713-348-4357.
|
|||||||
|