Usage
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(), ...)
Arguments
f
the function to be iterated over on Xgrid. This must take at
least 1 argument, the first of which represents the value of the
'arguments' list to be passed to the function for that iteration, which
is the iteration number unless 'arguments' (or 'X' for x
niters
the total number of iterations over which to evaluate the
function f. This can be less than the number of threads, in which case
multiple iterations are evaluated serially as part of the same task. No
default.
object.list
a named list of objects that will be copied to the
global environment on Xgrid and so will be visible inside the function.
Alternatively, this can be a character vector of objects, that will be
looked for in the global environment, rather than a named lis
file.list
a vector of filenames representing files in the current
working directory that will be copied to the working directory of the
executed function. This allows R code to be source()d, datasets to be
loaded, and compiled code to be dynamically linked within
max.threads
the maximum number of tasks (or jobs) to split into.
arguments
a list of values to be passed as the first argument to
the function, with each element of the list specifying the value at that
iteration. Default is as.list(1:niters) which passes only the iteration
number to the function.
Rversion
the required R version for worker nodes to be given
tasks - may include '=' or '>=' to signify exact or minimum version
requirements.
packages
a list of R packages that must be installed on host
nodes for them to be used.
artfun
an optional user-specified R function to determine the
suitability of nodes in an ART script - must either cat() 1 (indicating
suitable) or 0 (indicating unsuitable) to stdout.
email
an email address to be used to notify of job status.
profiling
option to use ART ranking to select the most suitable
host nodes preferentially.
cpuarch
option to restrict the job to 'ppc' or 'intel' nodes.
minosversion
option to restrict the job to nodes running a
minimum Mac OS version.
queueforserver
option to restrict the job to nodes considered to
be Server machines.
hostnode
option to prefer (or restrict to if forcehost==TRUE)
running the job on the specified nodes - must be provided as a single
character string with the colon character (:) separating node names.
forcehost
option to restrict the job to only nodes specified by
'hostnode'.
ramrequired
the minimum amount of free RAM (obtained using an
approximation) for each node to be assigned a task.
jobname
the name to give the job on Xgrid (optional).
cleanup
option to remove the job from Xgrid after completion.
showprofiles
option to show the node scores based on the ART
ranking used.
Rpath
the path to the R executable on the xgrid machines. If not
all machines on the xgrid cluster have R (or a required package)
installed then it is possible to use an ART script to ensure the job is
sent to only machines that do - see the examples section fo
Rbuild
the preferred binary of R to invoke. '64' results in
'{Rpath}64' (if it exists), '32' in '{Rpath}32' (if it exists) and ''
(or either of '32' or '64' if they are not found) results in {Rpath}.
Notice that this indicates a preference, not a certainty - if
max.filesize
the maximum total size of the objects produced by
the function for each thread if xgrid.method=separatejobs, or for the
entire job if xgrid.method=separatetasks. This is a failsafe designed
to prevent attempted transfer of huge files bringing the xgrid
c
mgridpath
the path to the local mgrid script - default uses the
version installed with the runjags package.
hostname
the hostname of the Xgrid server to connect to.
password
the password for the Xgrid server given by hostname.
tempdir
for xgrid.run, option to use the temporary directory as
specified by the system rather than creating files in the working
directory. Any files created in the temporary directory are removed when
the function exits. A temporary directory cannot be used for
keep.files
option to keep the folder with files needed to run the
job rather than deleting it when the job is deleted from Xgrid. This
may be useful for attempting to bug fix failing jobs. Default FALSE.
show.output
option to print the output of the function (obtained
using cat, writeLine or print for example) at each iteration after
retrieving the job(s) from xgrid. If FALSE, the output is suppressed.
Default TRUE.
separate.jobs
option to submit multiple jobs to Xgrid, to help
with file size constraints (see the entry for 'threads' below).
threads
the number of threads (either jobs if separate.jobs==TRUE
or tasks otherwise) to generate for the job. Each thread is sent to a
separate node for execution, so the more threads there are the faster
the job will finish (unless the number of threads exceeds
...
additional arguments to be passed to the function provided by
f.
jobinfo
the output of a call to xgrid.submit.
wait
option to wait for the Xgrid job to complete if it has not
done so already.
partial.retrieve
for xgrid.results, option to retrieve results of
partially completed jobs. By default makes cleanup FALSE. Default
TRUE.
comment
option to display any comments relevant to the Xgrid jobs
running.
user
option to display information on the user that submitted
each Xgrid job.
jobs
the number of (most recent) jobs to display information
for.
X
for xapply, a vector (atomic or list) over which to apply the
function provided. Equivalent to 'arguments' for xgrid.run, with niters
= length(X).
FUN
for xapply, the function to be passed to xgrid.run as 'f'.
method.options
for xapply, any arguments (with the exception of
'f', 'niters' and 'arguments' which are ignored) to be passed to
xgrid.run.