Skip to content

Commit e7a94a9

Browse files
Built-in templates: Assert that 'Rscript' is available and give an informative error message with hints, if not
1 parent aa02b16 commit e7a94a9

File tree

12 files changed

+66
-1
lines changed

12 files changed

+66
-1
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.20.0-9017
2+
Version: 0.20.0-9018
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
from stdout, which prevents auxillary INFO messages from `sbatch`
1818
to corrupt the output to be parsed.
1919

20+
* The built-in job script templates assert that `Rscript` is found,
21+
and if not, they give an informative error message suggesting to
22+
declare environment modules, via the `resources` argument, that
23+
should be loaded by the job script.
24+
2025
## Bug Fixes
2126

2227
`batchtools_slurm()` would produce "Future of class

inst/templates/lsf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ fi
7878
echo "Session information:"
7979
echo "- timestamp: $(date +"%Y-%m-%d %H:%M:%S%z")"
8080
echo "- hostname: $(hostname)"
81+
82+
if command -v Rscript &> /dev/null; then
83+
>&2 echo "ERROR: 'Rscript' could not be found. Maybe you need to specify which environment modules to load in the 'resources' argument, e.g. 'plan(future.batchtools::batchtools_lsf, resources = list(modules = c(\"r\")))'. The search PATH for 'Rscript' was ${PATH}"
84+
exit 1
85+
fi
86+
8187
echo "- Rscript path: $(which Rscript)"
8288
echo "- Rscript version: $(Rscript --version)"
8389
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"

inst/templates/openlava.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ fi
7878
echo "Session information:"
7979
echo "- timestamp: $(date +"%Y-%m-%d %H:%M:%S%z")"
8080
echo "- hostname: $(hostname)"
81+
82+
if command -v Rscript &> /dev/null; then
83+
>&2 echo "ERROR: 'Rscript' could not be found. Maybe you need to specify which environment modules to load in the 'resources' argument, e.g. 'plan(future.batchtools::batchtools_openlava, resources = list(modules = c(\"r\")))'. The search PATH for 'Rscript' was ${PATH}"
84+
exit 1
85+
fi
86+
8187
echo "- Rscript path: $(which Rscript)"
8288
echo "- Rscript version: $(Rscript --version)"
8389
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"

inst/templates/sge.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ fi
8787
echo "Session information:"
8888
echo "- timestamp: $(date +"%Y-%m-%d %H:%M:%S%z")"
8989
echo "- hostname: $(hostname)"
90+
91+
if command -v Rscript &> /dev/null; then
92+
>&2 echo "ERROR: 'Rscript' could not be found. Maybe you need to specify which environment modules to load in the 'resources' argument, e.g. 'plan(future.batchtools::batchtools_sge, resources = list(modules = c(\"r\")))'. The search PATH for 'Rscript' was ${PATH}"
93+
exit 1
94+
fi
95+
9096
echo "- Rscript path: $(which Rscript)"
9197
echo "- Rscript version: $(Rscript --version)"
9298
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"

inst/templates/slurm.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ fi
7777
echo "Session information:"
7878
echo "- timestamp: $(date +"%Y-%m-%d %H:%M:%S%z")"
7979
echo "- hostname: $(hostname)"
80+
81+
if command -v Rscript &> /dev/null; then
82+
>&2 echo "ERROR: 'Rscript' could not be found. Maybe you need to specify which environment modules to load in the 'resources' argument, e.g. 'plan(future.batchtools::batchtools_slurm, resources = list(modules = c(\"r\")))'. The search PATH for 'Rscript' was ${PATH}"
83+
exit 1
84+
fi
85+
8086
echo "- Rscript path: $(which Rscript)"
8187
echo "- Rscript version: $(Rscript --version)"
8288
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"

inst/templates/torque.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ fi
8181
echo "Session information:"
8282
echo "- timestamp: $(date +"%Y-%m-%d %H:%M:%S%z")"
8383
echo "- hostname: $(hostname)"
84+
85+
if command -v Rscript &> /dev/null; then
86+
>&2 echo "ERROR: 'Rscript' could not be found. Maybe you need to specify which environment modules to load in the 'resources' argument, e.g. 'plan(future.batchtools::batchtools_torque, resources = list(modules = c(\"r\")))'. The search PATH for 'Rscript' was ${PATH}"
87+
exit 1
88+
fi
89+
8490
echo "- Rscript path: $(which Rscript)"
8591
echo "- Rscript version: $(Rscript --version)"
8692
echo "- Rscript library paths: $(Rscript -e "cat(shQuote(.libPaths()), sep = ' ')")"

man/batchtools_lsf.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/batchtools_openlava.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/batchtools_sge.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)