Difference between revisions of "LGI/Rlgi"

From BiGGrid Wiki
Jump to navigation Jump to search
(initial version)
 
(→‎Getting started: Rlgi 0.0.10)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Rlgi is a package for the [http://www.r-project.org/ programming language R] to seamlessly run on an [[LGI]] grid. In usage it is similar to the R package [http://cran.r-project.org/web/packages/Rsge/index.html Rsge].
+
[[File:Rlogo.jpg|right]]
  
This package is being developed at [https://github.com/wvengen/Rlgi github]. More info will follow when it's ready.
+
Rlgi is a package for the [http://www.r-project.org/ programming language R] to seamlessly run on an [[LGI]] grid. Instead of using the family of <tt>apply</tt> functions on a heavy computation, you use one of the <tt>lgi.par?apply</tt> functions. This splits the data in chunks, and runs them on several nodes on the LGI grid. In usage it is similar to the R package [http://cran.r-project.org/web/packages/Rsge/index.html Rsge].
 +
 
 +
===Getting started===
 +
# Obtain your LGI credentials.
 +
#* These are supplied by your service provider (like [http://www.biggrid.nl/ BiG Grid]). They either give you
 +
#** A login for the LGI portal. You'll be able to download a credentials file from the ''Settings'' menu, or
 +
#** the <tt>LGI.cfg</tt> credentials file directly.
 +
#* Store this file as <tt>LGI.cfg</tt> in your home directory ''(Unix/Mac)'' or your profile directory ''(Windows)''.
 +
#* Please make sure that this file is secure. It contains your private key and should not be readable by others.
 +
# Install the Rlgi package (Linux & MacOS):
 +
#* [https://github.com/downloads/wvengen/Rlgi/Rlgi_0.0.10.tar.gz Download] the Rlgi package
 +
#* Install this package: <tt>R CMD INSTALL Rlgi_0.0.10.tar.gz</tt>
 +
# Install the Rlgi package (Windows):
 +
#* Follow these [[InstallRlgiOnWindows|instructions]]
  
 
===Example session===
 
===Example session===
Line 10: Line 23:
 
   Welcome to Rlgi
 
   Welcome to Rlgi
 
       Version: 0.0.7
 
       Version: 0.0.7
 +
 
 
   > # non-cluster-aware call, runs locally
 
   > # non-cluster-aware call, runs locally
 
   > sapply(c(10:20), function(x){x^3})
 
   > sapply(c(10:20), function(x){x^3})
 
   [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 
   [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 +
 
 
   > # use Rlgi's function to do sapply, but run locally for testing
 
   > # use Rlgi's function to do sapply, but run locally for testing
 
   > lgi.parSapply(c(10:20), function(x){x^3}, cluster=FALSE)
 
   > lgi.parSapply(c(10:20), function(x){x^3}, cluster=FALSE)
 
   [Rlgi] Running locally
 
   [Rlgi] Running locally
 
   [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 
   [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 +
 
 
   > # now run remotely, block until all computations are finished
 
   > # now run remotely, block until all computations are finished
 
   > lgi.parSapply(c(10:20), function(x){x^3})
 
   > lgi.parSapply(c(10:20), function(x){x^3})
Line 24: Line 40:
 
   [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 
   [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 
</code>
 
</code>
 +
 +
For more information, look in the [https://github.com/wvengen/Rlgi/wiki Rlgi wiki]
 +
 +
===Moving your credentials file===
 +
 +
If you find the location of <tt>LGI.cfg</tt> in your home directory disturbing, you can move it to another place. In that case, you'll have to load the configuration after loading Rlgi, like this:
 +
  library(Rlgi);
 +
  lgi.readConfig(path.expand("~/.config/LGI.cfg"));
 +
 +
Alternatively, you can use the <tt>~/.LGI</tt> configuration directory, as explained [https://github.com/wvengen/LGI/wiki/User-configuration here] and [https://github.com/wvengen/Rlgi/blob/master/QUICKSTART here]. All the information required is present in your <tt>LGI.cfg</tt> file.
 +
 +
===Further information===
 +
This package is being developed at [https://github.com/wvengen/Rlgi github].

Latest revision as of 12:40, 1 March 2012

Rlogo.jpg

Rlgi is a package for the programming language R to seamlessly run on an LGI grid. Instead of using the family of apply functions on a heavy computation, you use one of the lgi.par?apply functions. This splits the data in chunks, and runs them on several nodes on the LGI grid. In usage it is similar to the R package Rsge.

Getting started

  1. Obtain your LGI credentials.
    • These are supplied by your service provider (like BiG Grid). They either give you
      • A login for the LGI portal. You'll be able to download a credentials file from the Settings menu, or
      • the LGI.cfg credentials file directly.
    • Store this file as LGI.cfg in your home directory (Unix/Mac) or your profile directory (Windows).
    • Please make sure that this file is secure. It contains your private key and should not be readable by others.
  2. Install the Rlgi package (Linux & MacOS):
    • Download the Rlgi package
    • Install this package: R CMD INSTALL Rlgi_0.0.10.tar.gz
  3. Install the Rlgi package (Windows):

Example session

 > library(Rlgi)
 Loading required package: snow
 Loading required package: XML
 Welcome to Rlgi
     Version: 0.0.7
 
 > # non-cluster-aware call, runs locally
 > sapply(c(10:20), function(x){x^3})
  [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 
 > # use Rlgi's function to do sapply, but run locally for testing
 > lgi.parSapply(c(10:20), function(x){x^3}, cluster=FALSE)
 [Rlgi] Running locally
  [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000
 
 > # now run remotely, block until all computations are finished
 > lgi.parSapply(c(10:20), function(x){x^3})
 [Rlgi] Submitting 1 jobs...
 [Rlgi] All jobs submitted, waiting for completion.
 [Rlgi] Waiting for jobs:   0 queued;    0 running;   1 other      
  [1] 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000

For more information, look in the Rlgi wiki

Moving your credentials file

If you find the location of LGI.cfg in your home directory disturbing, you can move it to another place. In that case, you'll have to load the configuration after loading Rlgi, like this:

 library(Rlgi);
 lgi.readConfig(path.expand("~/.config/LGI.cfg"));

Alternatively, you can use the ~/.LGI configuration directory, as explained here and here. All the information required is present in your LGI.cfg file.

Further information

This package is being developed at github.