Skip to content

Commit 2e37e99

Browse files
authored
Update Dockerqueue with improvements of master (#145)
* robustify doJobCollection * new backports * Update Travis (#111) * selectively import backports * fix travis * removed remotes from desc * Warn about factors in addExperiments (#112) * fix appveyor * relative path handling * improved docs for reduceResults * paths * added tibble to suggests to check xrefs * improve getLogFiles * fix logs * fixed visibility in shared object * Add support for `partition` in slurm template (#118) Agreed. Thanks for the PR. * fix testJob for win? * simplified path lookup * added some tests * use %chin% * added some comments * docs * docs * fixed a bug where time stamps where rounded to seconds * fixed printing of remaining runtimes * fixed error message * use withr * warn instead of stop on the master if not all depenencies are satisfied (fixes #122) * fix travis * removeExperiments returns ids invisibly * fix heuristic of getJobPars * improved message * always use winslash * file.path/winslash * vignettes * updated README [ci skip] * updated README [ci skip] * docs * depend on withr 2.0.0 * Job names (#124) * updated NEWS * increase version number for CRAN release * vignette and docs * vignette * docs * NEWS formating * docs * increase version number after CRAN release * improved docs of reduceResults (fixes #116) * fix for #135 * added test, fixes #135 * fix test * README * small fix in printer * read-only mode (#137) * ClusterFunctions rework: Do not swallow system errors (#138) * added update routine for job.name * NEWS * improved control over sleep duration; nodename in cfSlurm * Wait for jobs rework (#140) * wait for brewed file before submit * version, docs * increased version after release * updated travis * fix links in vignette (#142) * version 0.9.6 * added test for algo caching * test for PM
1 parent 17d4fda commit 2e37e99

File tree

206 files changed

+4553
-3143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+4553
-3143
lines changed

.Rbuildignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
\.swp$
55
^\.ignore$
66
^\.editorconfig$
7-
^.travis.yml$
7+
^\.travis\.yml$
88
^man-roxygen$
99
^appveyor\.yml$
1010
^.*\.Rproj$
1111
^\.Rproj\.user$
1212
^docs$
1313
^paper$
14-
^_pkgdown.yml$
14+
^_pkgdown\.yml$

.gitignore

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.DS_Store
2-
inst/doc
3-
src/*.so
4-
src/*.o
5-
vignettes/*.html
2+
/inst/doc
3+
/src/*.so
4+
/src/*.o
5+
/vignettes/*.html
6+
/vignettes/*.pdf
7+
/.Rproj.user
8+
/batchtools.Rproj

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@ sudo: false
33
language: r
44
cache: packages
55

6+
env:
7+
- _R_CHECK_LENGTH_1_CONDITION_=true
8+
9+
addons:
10+
apt:
11+
packages:
12+
- libopenmpi-dev
13+
- openmpi-bin
14+
615
r:
716
- oldrel
817
- release
918
- devel
1019

1120
r_packages:
1221
- covr
22+
- Rmpi
1323

1424
after_success:
1525
- if [[ "${TRAVIS_R_VERSION_STRING}" == "release" ]]; then Rscript -e 'covr::coveralls()'; fi

DESCRIPTION

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: batchtools
22
Title: Tools for Computation on Batch Systems
3-
Version: 0.9.3-9000
3+
Version: 0.9.6-9000
44
Authors@R: c(
55
person("Michel", "Lang", NULL, "[email protected]", role = c("cre", "aut")),
66
person("Bernd", "Bischl", NULL, "[email protected]", role = "aut"),
@@ -28,18 +28,19 @@ Depends:
2828
R (>= 3.0.0),
2929
data.table (>= 1.9.8)
3030
Imports:
31-
backports (>= 1.0.4),
31+
backports (>= 1.1.0),
3232
base64url (>= 1.1),
3333
brew,
34-
checkmate (>= 1.8.2),
34+
checkmate (>= 1.8.3),
3535
digest (>= 0.6.9),
3636
parallel,
3737
progress (>= 1.1.1),
3838
R6,
3939
rappdirs,
4040
stats,
4141
stringi,
42-
utils
42+
utils,
43+
withr (>= 2.0.0)
4344
Suggests:
4445
debugme,
4546
e1071,
@@ -51,6 +52,7 @@ Suggests:
5152
rmarkdown,
5253
rpart,
5354
snow,
54-
testthat
55+
testthat,
56+
tibble
5557
VignetteBuilder: knitr
5658
RoxygenNote: 6.0.1

NAMESPACE

+6-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export(findTagged)
6161
export(getAlgorithmIds)
6262
export(getDefaultRegistry)
6363
export(getErrorMessages)
64+
export(getJobNames)
6465
export(getJobPars)
6566
export(getJobResources)
6667
export(getJobStatus)
@@ -109,6 +110,7 @@ export(runHook)
109110
export(runOSCommand)
110111
export(saveRegistry)
111112
export(setDefaultRegistry)
113+
export(setJobNames)
112114
export(showLog)
113115
export(sjoin)
114116
export(submitJobs)
@@ -118,7 +120,6 @@ export(syncRegistry)
118120
export(testJob)
119121
export(ujoin)
120122
export(waitForJobs)
121-
import(backports)
122123
import(checkmate)
123124
import(data.table)
124125
import(stringi)
@@ -133,6 +134,10 @@ importFrom(rappdirs,user_config_dir)
133134
importFrom(stats,pexp)
134135
importFrom(stats,predict)
135136
importFrom(stats,runif)
137+
importFrom(withr,local_dir)
138+
importFrom(withr,local_options)
139+
importFrom(withr,with_dir)
140+
importFrom(withr,with_seed)
136141
useDynLib(batchtools,c_binpack)
137142
useDynLib(batchtools,c_lpt)
138143
useDynLib(batchtools,count_not_missing)

NEWS.md

+32-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,41 @@
1+
# batchtools 0.9.6
2+
3+
* Fixed a bug where the wrong problem was retrieved from the cache. This was only triggered for chunked jobs in
4+
combination with an `ExperimentRegistry`.
5+
6+
# batchtools 0.9.5
7+
8+
* Added a missing routine to upgrade registries created with batchtools prior to v0.9.3.
9+
* Fixed a bug where the registry could not be synced if jobs failed during initialization (#135).
10+
* The sleep duration for `waitForJobs()` and `submitJobs()` can now be set via the configuration file.
11+
* A new heuristic will try to detect if the registry has been altered by a simultaneously running R session.
12+
If this is detected, the registry in the current session will be set to a read-only state.
13+
* `waitForJobs()` has been reworked to allow control over the heuristic to detect expired jobs.
14+
Jobs are treated as expired if they have been submitted but are not detected on the system for `expire.after` iterations
15+
(default 3 iterations, before 1 iteration).
16+
* New argument `writeable` for `loadRegistry()` to allow loading registries explicitly as read-only.
17+
* Removed argument `update.paths` from `loadRegistry()`.
18+
Paths are always updated, but the registry on the file system remains unchanged unless loaded in read-write mode.
19+
* `ClusterFunctionsSlurm` now come with an experimental nodename argument. If set, all communication with the master is
20+
handled via SSH which effectively allows you to submit jobs from your local machine instead of the head node.
21+
Note that mounting the file system (e.g., via SSHFS) is mandatory.
22+
123
# batchtools 0.9.4
224

325
* Fixed handling of `file.dir` with special chars like whitespace.
26+
* All backward slashes will now be converted to forward slashes on windows.
427
* Fixed order of arguments in `findExperiments()` (argument `ids` is now first).
528
* Removed code to upgrade registries created with versions prior to v0.9.0 (first CRAN release).
29+
* `addExperiments()` now warns if a design is passed as `data.frame` with factor columns and `stringsAsFactors` is `TRUE`.
30+
* Added functions `setJobNames()` and `getJobNames()` to control the name of jobs on batch systems.
31+
Templates should be adapted to use `job.name` instead of `job.hash` for naming.
32+
* Argument `flatten` of `getJobResources()`, `getJobPars()` and `getJobTable()` is deprecated and will be removed.
33+
Future versions of the functions will behave like `flatten` is set to `FALSE` explicitly.
34+
Single resources/parameters must be extracted manually (or with `tidyr::unnest()`).
635

736
# batchtools 0.9.3
837

9-
* Running jobs now are also included while querying for status "started". This affects `findStarted()`, `findNotStarted` and `getStatus()`.
38+
* Running jobs now are also included while querying for status "started". This affects `findStarted()`, `findNotStarted()` and `getStatus()`.
1039
* `findExperiments()` now performs an exact string match (instead of matching substrings) for patterns specified via `prob.name` and `algo.name`.
1140
For substring matching, use `prob.pattern` or `algo.pattern`, respectively.
1241
* Changed arguments for `reduceResultsDataTable()`
@@ -37,11 +66,11 @@
3766
* Fixed handling of `NULL` results in `reduceResultsList()`
3867
* Fixed key lookup heuristic join functions.
3968
* Fixed a bug where `getJobTable()` returned `difftimes` with the wrong unit (e.g., in minutes instead of seconds).
40-
* Deactivated swap allocation for `clusterFunctionsDocker()`.
69+
* Deactivated swap allocation for `ClusterFunctionsDocker`.
4170
* The package is now more patient while communicating with the scheduler or file system by using a timeout-based approach.
4271
This should make the package more reliable and robust under heavy load.
4372

4473
# batchtools 0.9.0
4574

4675
Initial CRAN release.
47-
See this [vignette](https://mllg.github.io/batchtools/articles/v01_Migration) for a brief comparison with [BatchJobs](https://cran.r-project.org/package=BatchJobs)/[BatchExperiments](https://cran.r-project.org/package=BatchExperiments).
76+
See the vignette for a brief comparison with [BatchJobs](https://cran.r-project.org/package=BatchJobs)/[BatchExperiments](https://cran.r-project.org/package=BatchExperiments).

R/Algorithm.R

+2-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ addAlgorithm = function(name, fun = NULL, reg = getDefaultRegistry()) {
4545

4646
info("Adding algorithm '%s'", name)
4747
algo = setClasses(list(fun = fun, name = name), "Algorithm")
48-
writeRDS(algo, file = getAlgorithmURI(reg$file.dir, name))
48+
writeRDS(algo, file = getAlgorithmURI(reg, name))
4949
reg$defs$algorithm = addlevel(reg$defs$algorithm, name)
5050
saveRegistry(reg)
5151
invisible(algo)
@@ -64,7 +64,7 @@ removeAlgorithms = function(name, reg = getDefaultRegistry()) {
6464
job.ids = filter(def.ids, reg$status, "job.id")
6565

6666
info("Removing Algorithm '%s' and %i corresponding jobs ...", nn, nrow(job.ids))
67-
file.remove.safely(getAlgorithmURI(reg$file.dir, nn))
67+
file.remove.safely(getAlgorithmURI(reg, nn))
6868
reg$defs = reg$defs[!def.ids]
6969
reg$status = reg$status[!job.ids]
7070
reg$defs$algorithm = rmlevel(reg$defs$algorithm, nn)
@@ -80,7 +80,3 @@ getAlgorithmIds = function(reg = getDefaultRegistry()) {
8080
assertExperimentRegistry(reg)
8181
levels(reg$defs$algorithm)
8282
}
83-
84-
getAlgorithmURI = function(file.dir, name) {
85-
file.path(file.dir, "algorithms", mangle(name))
86-
}

R/ExperimentRegistry.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ makeExperimentRegistry = function(file.dir = "registry", work.dir = getwd(), con
5252
reg = makeRegistry(file.dir = file.dir, work.dir = work.dir, conf.file = conf.file,
5353
packages = packages, namespaces = namespaces, source = source, load = load, seed = seed, make.default = make.default)
5454

55-
dir.create(file.path(reg$file.dir, "problems"))
56-
dir.create(file.path(reg$file.dir, "algorithms"))
55+
dir.create(fp(reg$file.dir, "problems"))
56+
dir.create(fp(reg$file.dir, "algorithms"))
5757

5858
reg$status$repl = integer(0L)
5959
reg$defs$problem = factor(character(0L))
@@ -68,13 +68,14 @@ makeExperimentRegistry = function(file.dir = "registry", work.dir = getwd(), con
6868
#' @export
6969
print.ExperimentRegistry = function(x, ...) {
7070
cat("Experiment Registry\n")
71-
catf(" Name : %s", x$cluster.functions$name)
71+
catf(" Backend : %s", x$cluster.functions$name)
7272
catf(" File dir : %s", x$file.dir)
7373
catf(" Work dir : %s", x$work.dir)
7474
catf(" Jobs : %i", nrow(x$status))
7575
catf(" Problems : %i", nlevels(x$defs$problem))
7676
catf(" Algorithms: %i", nlevels(x$defs$algorithm))
7777
catf(" Seed : %i", x$seed)
78+
catf(" Writeable : %s", x$writeable)
7879
}
7980

8081
assertExperimentRegistry = function(reg, writeable = FALSE, sync = FALSE, running.ok = TRUE) {

R/Export.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ batchExport = function(export = list(), unexport = character(0L), reg = getDefau
3737
assertList(export, names = "named")
3838
assertCharacter(unexport, any.missing = FALSE, min.chars = 1L)
3939

40-
path = file.path(reg$file.dir, "exports")
40+
path = fp(reg$file.dir, "exports")
4141

4242
if (length(export) > 0L) {
4343
nn = names(export)
44-
fn = file.path(path, mangle(nn))
44+
fn = fp(path, mangle(nn))
4545
found = file.exists(fn)
4646
if (any(!found))
4747
info("Exporting new objects: '%s' ...", stri_flatten(nn[!found], "','"))
@@ -51,13 +51,13 @@ batchExport = function(export = list(), unexport = character(0L), reg = getDefau
5151
}
5252

5353
if (length(unexport) > 0L) {
54-
fn = file.path(path, mangle(unexport))
54+
fn = fp(path, mangle(unexport))
5555
found = file.exists(fn)
5656
if (any(found))
5757
info("Un-exporting exported objects: '%s' ...", stri_flatten(unexport[found], "','"))
5858
file.remove.safely(fn[found])
5959
}
6060

6161
fns = list.files(path, pattern = "\\.rds")
62-
invisible(data.table(name = unmangle(fns), uri = file.path(path, fns)))
62+
invisible(data.table(name = unmangle(fns), uri = fp(path, fns)))
6363
}

0 commit comments

Comments
 (0)