stan-dev / stan-dev/rstan

sampling temporary files not being cleaned up in Windows

Open
#925 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

My drive filled up quickly when running simulations using rstan!

Description:

I have written several R functions that call pre-compiled Stan models (using the rstan sampling function).
Recently I have been using some of these functions in a simulation study with computations being done on several different Windows computers. I discovered a problem when my computers warned me that my free drive space was seriously low. From what I can tell (after quite a bit of experimentation), four folders (because I am running four chains simultaneously) with names like RtmpIB8N2A are being created in the AppData\Local\Temp, for each call to sampling. But it appears that most of these are not being cleaned up after sampling completes. The folders each contain one or two dll files.

I wrote some R functions to allow me to clean up myself after each simulation iteration. Discussion on https://discourse.mc-stan.org/c/interfaces/rstan/29 indicates that others have seen this problem.

My co-authors, running the same code on Linux see that any such files are being cleaned up from /tmp.

RStan Version:

2.21.2.

R Version:

3.6.3

Operating System:

Windows 10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing repeated calls to the rstan sampling function with pre-compiled Stan models on Windows 10, using the reported RStan 2.21.2 and R 3.6.3 versions. Inspect the temporary folders and DLLs created under AppData\Local\Temp, compare the behavior with Linux cleanup, and consider the issue resolved when completed sampling no longer leaves unnecessary temporary folders behind.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.