Skip to content

Commit 77739c7

Browse files
BUG FIX: The built-in HPC templates indented job scheduler declarations
1 parent ea8d3bd commit 77739c7

File tree

6 files changed

+101
-36
lines changed

6 files changed

+101
-36
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.12.2-9934
2+
Version: 0.12.2-9935
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

inst/templates/lsf.tmpl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,30 @@
1515
<% if (length(resources) > 0) {
1616
opts <- unlist(resources, use.names = TRUE)
1717
opts <- sprintf("-%s=%s", names(opts), opts)
18-
cat(sprintf("#BSUB %s\n", opts))
18+
writeLines(sprintf("#BSUB %s", opts))
1919
} %>
2020

21-
echo "Batchtools job name: '<%= job.name %>'"
21+
echo "Batchtools information:"
22+
echo "- job name: '<%= job.name %>'"
23+
echo "- job log file: '<%= log.file %>'"
24+
echo
2225

2326
echo "Session information:"
24-
date
25-
hostname
26-
which Rscript
27-
Rscript --version
28-
Rscript -e ".libPaths()"
27+
echo "- timestamp: $(date)"
28+
echo "- hostname: $(hostname)"
29+
echo "- Rscript path: $(which Rscript)"
30+
echo "- Rscript version: $(Rscript --version)"
31+
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"
32+
echo
33+
34+
echo "Job submission declarations:"
35+
<%
36+
writeLines(sprintf("echo '#BSUB %s'", opts))
37+
%>
38+
39+
echo "Job information:"
40+
bjobs -l "${LSB_JOBID}"
41+
echo
2942

3043
## Launch R and evaluate the batchtools R job
3144
echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ..."

inst/templates/openlava.tmpl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,30 @@
1515
<% if (length(resources) > 0) {
1616
opts <- unlist(resources, use.names = TRUE)
1717
opts <- sprintf("-%s=%s", names(opts), opts)
18-
cat(sprintf("#BSUB %s\n", opts))
18+
writeLines(sprintf("#BSUB %s", opts))
1919
} %>
2020

21-
echo "Batchtools job name: '<%= job.name %>'"
21+
echo "Batchtools information:"
22+
echo "- job name: '<%= job.name %>'"
23+
echo "- job log file: '<%= log.file %>'"
24+
echo
2225

2326
echo "Session information:"
24-
date
25-
hostname
26-
which Rscript
27-
Rscript --version
28-
Rscript -e ".libPaths()"
27+
echo "- timestamp: $(date)"
28+
echo "- hostname: $(hostname)"
29+
echo "- Rscript path: $(which Rscript)"
30+
echo "- Rscript version: $(Rscript --version)"
31+
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"
32+
echo
33+
34+
echo "Job submission declarations:"
35+
<%
36+
writeLines(sprintf("echo '#BSUB %s'", opts))
37+
%>
38+
39+
echo "Job information:"
40+
bjobs -l "${LSB_JOBID}"
41+
echo
2942

3043
## Launch R and evaluate the batchtools R job
3144
echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ..."

inst/templates/sge.tmpl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,30 @@
3737
## plan(batchtools_sge, resources = list(mem_free = "1G", h_rt="00:20:00"))
3838
opts <- unlist(resources, use.names = TRUE)
3939
opts <- sprintf("-l %s=%s", names(opts), opts)
40-
cat(sprintf("#$ %s\n", opts))
40+
writeLines(sprintf("#$ %s", opts))
4141
} %>
4242

43-
echo "Batchtools job name: '<%= job.name %>'"
43+
echo "Batchtools information:"
44+
echo "- job name: '<%= job.name %>'"
45+
echo "- job log file: '<%= log.file %>'"
46+
echo
4447

4548
echo "Session information:"
46-
date
47-
hostname
48-
which Rscript
49-
Rscript --version
50-
Rscript -e ".libPaths()"
49+
echo "- timestamp: $(date)"
50+
echo "- hostname: $(hostname)"
51+
echo "- Rscript path: $(which Rscript)"
52+
echo "- Rscript version: $(Rscript --version)"
53+
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"
54+
echo
55+
56+
echo "Job submission declarations:"
57+
<%
58+
writeLines(sprintf("echo '#$ %s'", opts))
59+
%>
60+
61+
echo "Job information:"
62+
qstat -j "${JOB_ID}"
63+
echo
5164

5265
## Launch R and evaluate the batchtools R job
5366
echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ..."

inst/templates/slurm.tmpl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,30 @@ defaults <- list(
1717
resources <- c(resources, defaults[setdiff(names(defaults), names(resources))])
1818
opts <- unlist(resources, use.names = TRUE)
1919
opts <- sprintf("--%s=%s", names(opts), opts)
20-
cat(sprintf("#SBATCH %s\n", opts))
20+
writeLines(sprintf("#SBATCH %s", opts))
2121
%>
2222

23-
echo "Batchtools job name: '<%= job.name %>'"
23+
echo "Batchtools information:"
24+
echo "- job name: '<%= job.name %>'"
25+
echo "- job log file: '<%= log.file %>'"
26+
echo
2427

2528
echo "Session information:"
26-
date
27-
hostname
28-
which Rscript
29-
Rscript --version
30-
Rscript -e ".libPaths()"
29+
echo "- timestamp: $(date)"
30+
echo "- hostname: $(hostname)"
31+
echo "- Rscript path: $(which Rscript)"
32+
echo "- Rscript version: $(Rscript --version)"
33+
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"
34+
echo
35+
36+
echo "Job submission declarations:"
37+
<%
38+
writeLines(sprintf("echo '#SBATCH %s'", opts))
39+
%>
40+
41+
echo "Slurm job information:"
42+
scontrol show job "${SLURM_JOB_ID}"
43+
echo
3144

3245
## Launch R and evaluate the batchtools R job
3346
echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ..."

inst/templates/torque.tmpl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,30 @@
2121
<% if (length(resources) > 0) {
2222
opts <- unlist(resources, use.names = TRUE)
2323
opts <- sprintf("%s=%s", names(opts), opts)
24-
cat(sprintf("#PBS -l %s\n", opts))
24+
writeLines(sprintf("#PBS -l %s", opts))
2525
} %>
2626

27-
echo "Batchtools job name: '<%= job.name %>'"
27+
echo "Batchtools information:"
28+
echo "- job name: '<%= job.name %>'"
29+
echo "- job log file: '<%= log.file %>'"
30+
echo
2831

2932
echo "Session information:"
30-
date
31-
hostname
32-
which Rscript
33-
Rscript --version
34-
Rscript -e ".libPaths()"
33+
echo "- timestamp: $(date)"
34+
echo "- hostname: $(hostname)"
35+
echo "- Rscript path: $(which Rscript)"
36+
echo "- Rscript version: $(Rscript --version)"
37+
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"
38+
echo
39+
40+
echo "Job submission declarations:"
41+
<%
42+
writeLines(sprintf("echo '#PBS -l %s'", opts))
43+
%>
44+
45+
echo "Job information:"
46+
qstat -f "${PBS_JOBID}"
47+
echo
3548

3649
## Launch R and evaluate the batchtools R job
3750
echo "Command: Rscript -e 'batchtools::doJobCollection("<%= uri %>")' ..."

0 commit comments

Comments
 (0)