Closed ImNotaGit closed 2 years ago
OK, so it seems that it's literally a file permission issue, as the job script does not have execution permission, and thus on my system it fails to run. Obviously this didn't happen for other people, this I don't know why. But to solve my issue, I dig into the source code a bit and fixed this by adding a Sys.chmod
line to the cfBrewTemplate
function in clusterFunctions.R
:
cfBrewTemplate = function(reg, text, jc) {
assertString(text)
outfile = fs::path(dir(reg, "jobs"), sprintf("%s.job", jc$job.hash))
parent.env(jc) = asNamespace("batchtools")
on.exit(parent.env(jc) <- emptyenv())
"!DEBUG [cfBrewTemplate]: Brewing template to file '`outfile`'"
z = try(brew(text = text, output = outfile, envir = jc), silent = TRUE)
if (is.error(z))
stopf("Error brewing template: %s", as.character(z))
waitForFile(outfile, reg$cluster.functions$fs.latency)
Sys.chmod(outfile, "774") ### This is the added line.
return(outfile)
}
This is probably nothing this package should be handling, this opens a can of worms. Please see man umask
.
I am trying to set up batchtools with SGE, and tested using the "approximation of pi" example in the tutorial. I followed all lines of code in the tutorial section exactly, except for a customized
submitJobs()
which looks likesubmitJobs(resources=list(project="short", memory=1))
. When checking job status withgetStatus()
immediately after job submission, I saw that all jobs have expired. When checking the temp dir for the log file (e.g.<tmp_dir>/registry298c1c9cc70b/logs/job2099fc469453267ec8b7e988acc17a58.log
), I see the error message:The corresponding .job script exists and looks fine, its file permission is
-rw-rw-rw-
.My
~/.batchtools.conf.R
looks like this:My
~/.batchtools.sge.tmpl
looks like this:Any idea how to solve this issue? Thanks in advance.
sessionInfo():