How to launch research software applications (Matlab, Stata, R) on Andes and Polaris high-performance linux machines (HPC's)

Launching software from Andes, Polaris:  

See  for more details on running research software on our Linux HPC's such as Andes and Polaris.  

Begin by ensuring that you have FastX installed on your Mac/Win system:
and that you are able to open an Xterm session on or

Once you get the Xterm window open and the '$' prompt, do a quick test to make sure your terminal command line can also open up an external X window by typing xclock& at the command line: 

       $ xclock&

In a few seconds, you should see a new window open with a small clock in it.  Close the clock window when it appears.  If not, re-install your X Window software (FastX, MobaXterm, XQuartz)

Click back inside the terminal window, and press the Enter/Return key to get a new command prompt ($).  Then, type the following command below to load the software you'd like to use (matlab, stata, R, etc) at the "$" prompt in your terminal window: 

       $ module load matlab

And then the software name to launch the interactive software in a new terminal X Window. 

       $ matlab ​​​​ 

Some software packages have more than one version installed.  Stata is one example.  Type module avail stata to see available versions

       $ module avail stata

       $ module load stata/15 ​​​​ 

       $ xstata 

       $ spss

       $ sas

Your DartFS file storage system is available at this same command prompt.  You can drag and drop files in, or use a Unix cp or mv command.  Type  ls to view files:
       $    ls


You can run R script files using the Rscript command.  mmand prompt.
       $    Rscript myRscript.R

Matlab can be run without the graphical interface
       $    matlab -nodisplay -nojvm -nosplash -nodesktop 

                      <  M A T L A B >  



Matlab scripts can be run at the prompt without the graphical interface

          Author a script on your desktop installation of Matlab, and save it to DartFS.  Samlpe script titled "testmfile.m", which contains the following code: 


This script can then be run by logging with your DartFS account and navigating to the directory 
         $ module load matlab       

         $ matlab -nodisplay -nodesktop -nosplash -nojvm -r "run testmfile.m"

Scripts can be written to accept parameters and write to files  

         $  matlab -nodisplay -nodesktop -nosplash -nojvm -r "matlabfunctionwritefile(25)" ​​​​​​​​​​​​​​​​​​​​​

Scripts can also be written to export data out to your DartFS file storage: 

Example:  a script called "script.m" containing the following:
A = magic(5);
outputfile1 = 'output1.xlsx';
outputfile2 = '//dartfs-hpc/rc/home/2/username2/output2.xlsx';

Then run on Polaris at the command line like this:
[usrname@polaris ~]$ module load matlab
[usrname@polaris ~]$ matlab -nodisplay -nodesktop -nosplash -nojvm -r "run script.m"

This will output files "output1.xlsx" and "output2.xlsx" to the user's home directory.  Note the use of the full file path in the second file - this method could be used to write to subfolders on your DartFS file system.

SSH Terminal and X Window Clients

     Windows / Mac / Linux "FastX"

     Windows:  Gitbash 

     Mac:  use built-in 'Terminal' Unix Shell 

     See this link for more help with the Andes Polaris Linux HPC machines: 



Article ID: 78493
Fri 5/17/19 12:34 PM
Fri 2/14/20 11:26 AM