xgrid.run(f=function(iteration){}, niters=1, object.list=list(),
file.list=character(0), max.threads=100, arguments=as.list(1:niters),
Rversion="", packages=list(), artfun=function() writeLines("1"),
email=NA, profiling=TRUE, cpuarch=NA, minosversion=NA,
queueforserver=FALSE, hostnode=NA, forcehost=FALSE, ramrequired=10,
jobname=NA, cleanup=TRUE, showprofiles=FALSE, Rpath='/usr/bin/R',
Rbuild='64', max.filesize="1GB",
mgridpath=system.file("xgrid", "mgrid.sh", package="runjags"),
hostname=Sys.getenv("XGRID_CONTROLLER_HOSTNAME"),
password=Sys.getenv("XGRID_CONTROLLER_PASSWORD"), tempdir=FALSE,
keep.files=FALSE, show.output=TRUE, threads=min(niters, max.threads), ...)
xgrid.submit(f=function(iteration){}, niters=1, object.list=list(),
file.list=character(0), max.threads=100, arguments=as.list(1:niters),
Rversion="", packages=list(), artfun=function() writeLines("1"),
email=NA, profiling=TRUE, cpuarch=NA, minosversion=NA,
queueforserver=FALSE, hostnode=NA, forcehost=FALSE, ramrequired=10,
jobname=NA, Rpath='/usr/bin/R', Rbuild='64', max.filesize="1GB",
mgridpath=system.file("xgrid", "mgrid.sh", package="runjags"),
hostname=Sys.getenv("XGRID_CONTROLLER_HOSTNAME"),
password=Sys.getenv("XGRID_CONTROLLER_PASSWORD"), show.output=TRUE,
separate.jobs=FALSE, threads=min(niters, max.threads), ...)
xgrid.results(jobinfo, wait=TRUE, partial.retrieve=!wait,
cleanup=!partial.retrieve, show.output=TRUE)
xgrid.jobs(comment=FALSE, user=FALSE, jobs=10,
mgridpath=system.file("xgrid", "mgrid.sh", package="runjags"),
hostname=Sys.getenv("XGRID_CONTROLLER_HOSTNAME"),
password=Sys.getenv("XGRID_CONTROLLER_PASSWORD"))
xgrid.delete(jobinfo, keep.files=FALSE)
xapply(X, FUN, method.options=list(), ...)These functions allow JAGS models to be run on Xgrid distributed computing clusters from within R using the same syntax as required to run the models locally. All the functionality could be replicated by saving all necessary objects to files and using the Xgrid command line utility to submit and retrieve the job manually; these functions merely provide the convenience of not having to do this manually. Xgrid support is only available on Mac OS X machines running OS X 10.5-10.7 (Xgrid support was discontinued in Mac OS X 10.8).
The xgrid controller hostname and password can also be set as environmental variables. The command line version of R knows about environmental variables set in the .profile file, but unfortunately the GUI version does not and requires them to be set from within R using:
Sys.setenv(XGRID_CONTROLLER_HOSTNAME="
Sys.setenv(XGRID_CONTROLLER_PASSWORD="
(These lines could be copied into your .Rprofile file for a 'set and forget' solution)
Note that the runjags package also contains a utility shell script called 'mgrid' that enhances the capabilities of Xgrid substantially - to install this from the command line navigate to the folder given by system.file("xgrid", package="runjags") and from the terminal type 'sudo cp mgrid.sh /usr/local/bin/mgrid (or similar) to make the script visible in your search path. Help on the mgrid script can then be obtained by typing 'mgrid' (with no arguments) at the command line.
mclapply and parLapply
in the parallel package for parallel execution of code over multiple
local (or remote) cores.