Closed wanlinrong closed 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)
@wanlinrong can you make this example more reproducible, so that I can cut-and-paste into my. own session and see the problem?
using pbmcapply()
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.
I have the error Error in manager$availability[[as.character(result$node)]] <- TRUE : wrong args for environment subassignment is this like yours?
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