• Skip to Main Content
  • Go to the Website's Home
  • Go to Website News
  • Go to About this site
  • Skip to Audience Navigation Menu
  • About
    • Welcome to the College
    • Facts and Figures
    • Message from the Dean
    • Visit Us
    • College Administration
    • News Center
  • Research
    • Research Home
    • Departments
    • Centers & Labs
    • Faculty Directory
    • Opportunities for Undergraduates
  • Admissions
    • Undergraduate Admissions
    • Undergraduate Recruiting
    • Graduate Admissions
  • Academics
    • Departments
    • Undergraduate Programs and Degrees
    • Graduate Programs and Degrees
    • Course Guide/Bulletin
    • Teaching
    • Support Services
  • Departments
    • Aerospace Engineering
    • Atmospheric, Oceanic and Space Sciences
    • Biomedical Engineering
    • Chemical Engineering
    • Civil and Environmental Engineering
    • Electrical Engineering and Computer Science
    • Industrial and Operations Engineering
    • Interdisciplinary Professional Programs
    • Materials Science and Engineering
    • Mechanical Engineering
    • Naval Architecture and Marine Engineering
    • Nuclear Engineering and Radiological Sciences
  • Support the College
    • Giving
    • Involve Yourself
    • Corporate Relationships
  •   

College of Engineering

Center for Advanced Computing

  • Welcome
  • About
  • Getting Started
    • Getting Started
    • Learning About HPC
    • CAC Training Courses
  • Resources
    • Resources
    • Systems
    • Software
    • Storage
    • Networking
    • Visualization
    • Teragrid
  • Academics
  • Contact Us
  • Frequently Asked Questions
Follow Us On Twitter

Contact Information

[Contact] Center for Advanced Computing
College of Engineering
cac-support@umich.edu Link

Center for Advanced Computing  /  Resources  /  Software  /  R/SNOW

R/SNOW

SNOW is a module for R that allows R to do parallel operations. For more information on SNOW, there is a good introduction titled snow Simplified by Sigal Blay. There are also some other links provided below.

To use SNOW on the CAC clusters you need to load the LAM and R packages, to do this type:

                      module load snow

It is worth noting that running in parallel doesn't automatically make your R job faster, and it can, in fact, make it slower. At the bottom of the snow Simplified page is a simple timing test that demonstrates this. Often there is a "sweet spot" for how many nodes you need for the optimum performance. You should try this with your own problem to determine what will get you the best speed-up.

A sample interactive R/SNOW session looks like this:

 

nyx$ R
R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1  (2005-12-20 r36812)
ISBN 3-900051-07-0
> library(snow)
> cl <- makeMPIcluster(2)
Loading required package: Rmpi
LAM/MPI runtime environment is not operating.
Starting LAM/MPI runtime environment.
2 slaves are spawned successfully. 0 failed.
> A <- matrix(rnorm(1000000), 1000)
> system.time(A %*% A)
[1] 4.38 0.01 4.38 0.00 0.00
> system.time(parMM(cl, A, A))
[1] 2.27 1.62 5.82 0.00 0.00
> clusterCall(cl, function() Sys.info()[c("nodename","machine")])
[[1]]
nodename                  machine
"nyx341.engin.umich.edu"                 "x86_64"
[[2]]
nodename                  machine
"nyx341.engin.umich.edu"                 "x86_64"
> stopCluster(cl)
> q()
nyx$ lamhalt

 

Once you have an R script (called R.input below) for your problem, you can create a PBS script and submit that to the cluster. For example:

#PBS -N R-snow
#PBS -q route
#PBS -l nodes=1:ppn=2,mem=1gb,walltime=24:00:00
#PBS -M your-email-address
#PBS -m abe
#PBS -V
#
echo "I ran on:"
cat $PBS_NODEFILE
#
#cd to your execution directory first
cd /home/your-user-name
#
#
lamboot
R < R.input
lamhalt

If you save that script with, for example, the name rsnow.pbs (you should chose a name that has some meaning for you) you can then submit it with the command:

qsub rsnow.pbs

Other R/Snow Resources

http://www.stat.uiowa.edu/~luke/R/cluster/cluster.html
http://rweb.stat.umn.edu/R/library/snow/html/00Index.html
http://www.sfu.ca/~sblay/R/snow.html

XHTML 1.0 Valid
CSS 2.1 Valid
University of Michigan
  • Home
  • Contact Us
  • Site Map
  • Site Feedback
  • Accessibility
  • Emergency Procedures
  • Jump to top of the page
© 2009 College of Engineering, University of Michigan