Sorry to take so long to get back to you. I now have a reproducible example of the problem. It took me quite a bit of time to track the problem down. It turns out that the loo() multitasking breaks down in Windows 10 when the .rprofile file contains the line:
options(mc.cores = parallel::detectCores())
Oddly, adding this line at the start of a script doesn’t cause loo to fail with multitasking. That’s one reason that it took me so long to isolate the problem. Odd.
Try running the following in a clean RStudio session on a Windows 10 machine:
library(rstanarm)
sleepstudy <- lme4::sleepstudy
fm1 <- stan_lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)
options('mc.cores' = NULL)
system.time(loo(fm1))
options('mc.cores' = 2)
system.time(loo(fm1))
On my Windows 10 machine, if there is no options(mc.cores) line in the .rprofile file, the above runs successfully, though the second call with mc.cores set to 2 runs very slowly. (Once you have run lines 2:3 once and “sleepstudy” and “fm1” are in your environment, you can comment them out to speed things up.) But when the options(mc.cores) line is in .rprofile, the second loo() run never returns. If you look what is happening using the Task Manager, you will see that the cpu never stops churning. If you halt the command by pressing Esc, R returns you to the > prompt. But Task Manager shows that the churning has continued and continues until you completely exit R. I have now confirmed this on two Windows 10 machines – my home laptop and my UIowa 12 cpu virtual desktop. I have also confirmed your finding that this does not happen when I run the above in my VBox virtual Ubuntu machine. I have no idea why this is happening. I thought that it might be that the search() order was different, but they were exactly the same when I had the options(mc.cores) line in .rprofile or added to the beginning of the above script.
I have noticed a batch of other issues with rstanarm::loo. But I’ll put these in different notes to help keep the various issues separate. I hope that this reproducible example will help you find the bug. I’ll review how to submit an “issue” as you have suggested. But it may take me a day or so to learn how to do that. Let me know how the above works for you.
Larry Hunsicker