Difference between revisions of "LGI/Rlgi"
Jump to navigation
Jump to search
(initial version) |
|||
Line 10: | Line 10: | ||
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}) |
Revision as of 13:16, 25 August 2011
Rlgi is a package for the programming language R to seamlessly run on an LGI grid. In usage it is similar to the R package Rsge.
This package is being developed at github. More info will follow when it's ready.
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