-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.R
63 lines (53 loc) · 1.74 KB
/
run_tests.R
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
59
60
61
62
63
# ##############################################################################
#
## Run all tests for a single simulation
#
# ##############################################################################
library("tidyverse")
library("batchtools")
library("rhdf5")
library("here")
library("yaml")
# load SIMBA
devtools::load_all(simba.loc)
# get sim & paramaters
args <- commandArgs(trailingOnly = TRUE)
simulation <- args[1]
test <- args[2]
message(simulation)
message(test)
if (!is.na(test)){
message("Submitting jobs for the test: ", test)
} else {
message("Submitting all different tests!")
}
# make experiment registry - might need to load pkgs here
# load source registry for simulation
job.registry <- paste0(temp.loc, 'test_results_registries/',
paste0(simulation, '_test'))
message(job.registry)
if (!dir.exists(job.registry)){
stop("Simulation hasn't been tested yet! Simulations which have include ",
paste(setdiff(list.files(paste0(temp.loc, 'test_results_registries')),
c('README.md')), collapse = ', '))
} else {
test.reg <- loadRegistry(file.dir = job.registry,
conf.file = here('cluster_config',
'batchtools_test_conf.R'),
writeable = TRUE)
}
print(getStatus())
errs <- findErrors()
if (nrow(errs) > 0){
resetJobs(errs)
print(getStatus())
}
if (is.na(test)){
not.submitted <- findNotDone()
print(nrow(not.submitted))
submitJobs(not.submitted$job.id, resources=list(max.concurrent.jobs=2000))
} else {
not.submitted <- getJobPars(findNotSubmitted()) %>% filter(algorithm == test)
print(nrow(not.submitted))
submitJobs(not.submitted$job.id, resources=list(max.concurrent.jobs=2000))
}