Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up scratch space after solving #52

Open
davidschlegel opened this issue Nov 11, 2021 · 3 comments
Open

Clean up scratch space after solving #52

davidschlegel opened this issue Nov 11, 2021 · 3 comments

Comments

@davidschlegel
Copy link

Currently, I need to run many instances of the solver, each with slightly different parameters.
This causes the scratchspace to become large very quickly, creating files for the initial problem, the output, and configuration parameters. Is there a way to automatically clean up the scratch space where these files are stored to prevent them from becoming too large?

@ericphanson
Copy link
Owner

I think they should get automatically cleaned up when the Julia session ends. That doesn’t help if you’re solving many problems with a session though.

For that, one option is to manually clean it up; you can get the directory from a JuMP model with path = MOI.get(model, SDPAFamily.TemporaryDirectory()), and with Convex, the same thing except problem.model (only valid once the problem has been solved). Then you could delete it with rm(path; recursive=true).

Let me know if you have any issues.

@ericphanson
Copy link
Owner

ericphanson commented Nov 11, 2021

We could also add an option to do this automatically as you said, but I’m not sure the best interface. If you’re interested, I think one way to do that would be to add a boolean immediate_ cleanup option to the Optimizer object, and then if that option is true, remove the tempdir here:

. I’d be happy to review pull requests adding this feature.

@davidschlegel
Copy link
Author

Thanks for the feedback, let's see if this is a good workaround. It should be very easy to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants