File: batchtools.sge.tmpl

package info (click to toggle)
r-cran-future.batchtools 0.12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 528 kB
  • sloc: sh: 82; makefile: 2
file content (58 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash

## Job name:
#$ -N fbt-<%= job.hash %>

## Merge standard error and output:
#$ -j y

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

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

## Tell the queue system to use the current directory
## as the working directory
## -cwd

## Mirror environment variables
#$ -V

## Resources needed:
<% if (exists("resources", mode = "list") && length(resources) > 0) {
  if (isTRUE(getOption("future.debug"))) {
    R.utils::mcat("resources:")
    R.utils::mstr(resources)
  }
  cat(sprintf("#$ %s\n", resources[["custom"]]))
} %>

## UCSF HPC Pilot specific
#$ -S /bin/bash         # Required
#$ -l mem_free=1G       # Memory usage, required.  Note that this is per slot
#$ -R yes               # SGE host reservation, highly recommended

## SPECIAL: For R CMD check package testing on HPC environments, which
## typically uses a temporary working directory that is local, we force
## it to use HPC-wide working directory
#$ -wd ~/tmp

## SPECIAL: Since we change working directory, the 'startup.Rs' file used
## by R CMD check is no longer found
export R_TESTS=

# For troubleshooting if there are errors
date
hostname
which Rscript
Rscript --version
Rscript -e ".libPaths()"

echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ..."
Rscript -e 'batchtools::doJobCollection("<%= uri %>")'
echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ... done"

## For troubleshooting if there are errors
## https://github.com/UCSF-HPC/pilot-testing/issues/1
qstat -j $JOB_ID