I am running a model using rstan in RStudio on a remote Windows laptop that is connected to my university’s server. I access it from my local computer using Windows Remote Desktop Connection (RDP) over my university’s VPN.
The model runs fine while I have the Remote Desktop window open. However, when I close the RDP window (which should simply disconnect the session) and turn off my local computer, the rstan process appears to stop running. When I reconnect the next day, it resumes.
I suspect the issue may not be an rstan issue per se but I still wanted to post this here in case somebody else dealt with something similar. Is there a reliable way to keep a long-running rstan process going on a remote Windows machine, independently of the RDP session?
Sounds to me that the remote Windows laptop goes into sleep mode when it is disconnected, and wakes up when you reconnect using the Remote Desktop Connection. I have done it before where I put my laptop to sleep in the middle of a Stan run, and when I wake up the computer it continues on, so it’s definitely capable of pausing MCMC sampling when asleep.
Are you able to check the power settings on that laptop to ensure that it does not go to sleep after x minutes of inactivity?
Thank you! I was using a third-party app that disables the sleep mode, and tried running my model with that on but what you recommend is way more straightforward. I’m giving it a go now, thanks a lot!
Unfortunately, the issue remains even after changing the sleep setting to ‘never’ through the remote windows power & battery settings. I would appreciate any other suggestions.
I am wondering if there is a way to install tmux on a Windows machine? I suspect the issue would be the same, but just as a suggestion you could run your code in tmux, detach the session, and see when you come back to the Windows machine if the model has ran? But it definitely seems something related to sleep mode
You should ask check the IT policy at your university / contact university IT support. The server may simply have a policy about not letting remote logins run processes indefinitely, or to some time limit that you are hitting overnight.