mikajoh / stmprinter

Print multiple stm model dashboards to a pdf file for inspection
Other
39 stars 3 forks source link

Error when running many_models() #1

Open pmp55 opened 6 years ago

pmp55 commented 6 years ago

Error occurred when I run the following code: stm_models <- many_models( K = 3:12, documents = out$documents, vocab= out$vocab, prevalence = ~ treatment + s(pid_rep), data = out$meta, N = 4, runs = 100 )

Running multiple STM models [------------------------------------------] 0 of 10 ( 0%) finished Error in mclapply(K, selectModel2, args, verbose, pb, mc.cores = cores, : 'mc.cores' > 1 is not supported on Windows

Any idea to fix it on Windows laptop? Thanks in advance.

mikajoh commented 6 years ago

Thank you for bringing this to my attention and sorry the late reply. I did not know that mclapply did not work on windows. I'll rewrite the function with an other parallel backend that also works for windows this week.

janlampe commented 4 years ago

It has been a while, so this probably fell off the radar, but is there any update on this one?

mikajoh commented 4 years ago

Thank you for following up. I haven't decided how to tackle this yet. The function is based on parallel::mcapply()--the same as the stm packages uses for parallelization---which does not support windows. Parallelization on windows is more cumbersome. Any ideas? For now it works, of course, if you just set cores = 1.

janlampe commented 4 years ago

hm... I feared it wasn't as easy as inserting a if( Sys.info()[['sysname']] == 'Windows') into the function... There is an old post (hack doesn't work for me) here . Other than that, this goes beyond my high-level programming skills... if you find a solution let me know. In the meantime, I think I'll just run this on the linux subsystem for windows.