Bioconductor / BiocParallel

Bioconductor facilities for parallel evaluation
https://bioconductor.org/packages/BiocParallel
67 stars 29 forks source link

wrong args for environment subassignment #206

Closed wanlinrong closed 2 years ago

wanlinrong commented 2 years ago

Error in env[[as.character(i)]] <- value : wrong args for environment subassignment Calls: ... bploop -> bploop.iterate -> -> add_inorder In addition: Warning message: In parallel::mccollect(wait = FALSE, timeout = 1) : 1 parallel job did not deliver a result

wanlinrong commented 2 years ago

start_rowid <- seq.int(0,count,by = yeild_size)

bp.mutiple.pra <- BiocParallel::MulticoreParam(workers = 5, progressbar = T) memory_lock <- BiocParallel::ipcid() in_file_lock <- BiocParallel::ipcid()

BiocParallel::bplapply(start_rowid, BPPARAM = bp.mutiple.pra,FUN = function(rowid){

statement <- paste('select rowid,',paste0("",SAMPLE,"",collapse = ','),' from all.data where rowid >',rowid,'limit ',yeild_size)

BiocParallel::ipclock(in_file_lock) temp <- dbGetQuery(dbfile,statement = statement) BiocParallel::ipcunlock(in_file_lock)

mtmorgan commented 2 years ago

@wanlinrong can you make this example more reproducible, so that I can cut-and-paste into my. own session and see the problem?

wanlinrong commented 2 years ago

using pbmcapply()

mtmorgan commented 2 years ago

Without a reproducible example I cannot help. I would guess that you need to open the database connection on the worker (inside FUN of bplapply()) rather than assuming that it is valid in the forked process.

But it sounds like you've found an alternative solution so I will close the issue.

fadedmeliodas commented 1 year ago

I have the error Error in manager$availability[[as.character(result$node)]] <- TRUE : wrong args for environment subassignment is this like yours?