infomap_ecology_package icon indicating copy to clipboard operation
infomap_ecology_package copied to clipboard

Parallel execution issue with temporary files

Open matildabrown opened this issue 3 years ago • 0 comments

Hello!

I was using this package to run Infomap on a cluster, but I think the temporary files from the parallel runs were interfering with each other (some runs failed with an error message about being unable to delete the temporary files).

When I installed Infomap onto the node prior to each run, there were no failures and the results changed significantly.

I can reproduce a similar error ( task 1 failed - "'infomap.tree' does not exist in current working directory) locally with the following:

# Import data
library(bipartite)
library(infomapecology)
library(parallel)
library(foreach)
library(doParallel)

data(memmott1999)

registerDoParallel(8) 

network_object <- create_monolayer_object(memmott1999, bipartite = T, directed = F, group_names = c('A','P'))

res <- list()
foreach (i=1:8, .packages = c("infomapecology")) %dopar% {
  res[[i]] <- run_infomap_monolayer(network_object, infomap_executable='Infomap',
                                          flow_model = 'undirected',
                                          silent=T, trials=20, two_level=T, seed=123)
}

matildabrown avatar Nov 21 '22 11:11 matildabrown