inst/conf/torque.R

cluster.functions <- makeClusterFunctionsTorque(R.utils::tmpfile('
## Job name:
#PBS -N <%= job.name %>

## Merge standard error and output:
#PBS -j oe

## Direct streams to logfile:
#PBS -o <%= log.file %>

## Email on abort (a) and termination (e), but not when starting (b)
#PBS -m ae

## Resources needed:
<% if (length(resources) > 0) {
  opts <- unlist(resources, use.names=TRUE)
  opts <- sprintf("%s=%s", names(opts), opts)
  opts <- paste("-l", opts, sep=" ")
  R.utils::mcat("opts:")
  R.utils::mstr(opts)
  if (isTRUE(getOption("future.debug"))) {
    R.utils::mprint(opts)
  }

  cat(sprintf("#PBS %s\n", opts))
} %>

## Run R:
## we merge R output with stdout from PBS, which gets then logged via the PBS -o option
echo "Command: Rscript --verbose \"<%= rscript %>\""
Rscript --verbose "<%= rscript %>"
echo "Command: Rscript --verbose \"<%= rscript %>\" ... DONE"
'))

Try the future.BatchJobs package in your browser

Any scripts or data that you put into this service are public.

future.BatchJobs documentation built on Jan. 5, 2021, 1:07 a.m.