statistikat / simPop

Simulation of Synthetic Populations for Survey Data Considering Auxiliary Information
30 stars 7 forks source link

Bug in simRelation() function causing Error in mcfork() : unable to create a pipe #11

Closed manab-prakash closed 3 years ago

manab-prakash commented 3 years ago

else if (!have_win) {# linux/mac values <- mclapply(levels(data_sample[[curStrata]]), function(x) { simulateValues( dataSample=data_sample[data_sample[[curStrata]]==x,], dataPop=data_pop[indStrata[[x]], c(predNames, simPopObj@pop@hhid, relation), with=FALSE], params ) }, mc.cores = max(nr_cores,length(levels(data_sample[[curStrata]])))) } In this piece of code from simRelation(), mc.cores = max(...) causes Error in mcfork() : unable to create a pipe while running in Linux. I believe this is because the function is trying to allocate far more cores (than possible) based on the number of stratas. @bernhard-da , I think fixing it will simply require replacing max() with min().

bernhard-da commented 3 years ago

hi @manab-prakash thx for reporting, fixed in https://github.com/statistikat/simPop/commit/7bfc28d0f6af9ccb2b7d80c328175cf1b0ffa0b8