mlr-org / mlr-org/batchtools

Error in (function () : unused argument (x = 3)

Open
#290 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
184
Forks
53
Avg merge
7d 2h
Merged PRs (30d)
1

Description

Hi,

I am having an issue with getting batchtools to work. I am following this tutorial and have edited the function to work with my phyloseq function. When I just the function on it on and get the results it works. However, when I submit it with batchtools it always fails. Can you please help.

Here is my complete code and errors:
#Create function

myFct<- function() {
Fun <- tax_glom(physeq, "Function")
Fun1<-psmelt(Fun)
FunTrt <- merge_samples(Fun, "Treatment") 
FunTrt1<-psmelt(FunTrt)
names(FunTrt1)[2]<-"Trt" 
return(FunTrt1)
}

#Run function to make sure it actually works
myFctNam()

**#Submit slurm job **

reg <- makeRegistry(file.dir="myregdir", conf.file=".batchtools.conf.R")
Njobs <- 1:4 # Define number of jobs (here 4)
ids <- batchMap(fun=myFct, x=Njobs) 
done <- submitJobs(ids, reg=reg, resources=list(partition="short", walltime=60, ntasks=10, ncpus=1, memory=1024))
waitForJobs()
``` # Wait until jobs are completed


**#Results**
**waitForJobs() # Wait until jobs are completed                               
[1] FALSE **

**getStatus()** 
Status for 4 jobs at 2023-01-13 21:27:41:
  Submitted    : 4 (100.0%)
  -- Queued    : 0 (  0.0%)
  -- Started   : 4 (100.0%)
  ---- Running : 0 (  0.0%)
  ---- Done    : 0 (  0.0%)
  ---- Error   : 4 (100.0%)
  ---- Expired : 0 (  0.0%)


**> getErrorMessages(ids, reg = getDefaultRegistry())**
   job.id terminated error                                          message
1:      1       TRUE  TRUE Error in (function ()  : unused argument (x = 1)
2:      2       TRUE  TRUE Error in (function ()  : unused argument (x = 2)
3:      3       TRUE  TRUE Error in (function ()  : unused argument (x = 3)
4:      4       TRUE  TRUE Error in (function ()  : unused argument (x = 4)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the batchMap(fun=myFct, x=Njobs) call and compare it with the tutorial, then inspect the recorded failures using getErrorMessages(ids, reg = getDefaultRegistry()). Check the .batchtools.conf.R and Slurm submission settings as well. Done means identifying whether the error comes from the submitted function arguments or batchtools and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.