Message Boards Message Boards

0
|
7954 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to restrict WSMLink temp folder size?

I am running a large batch of SystemModeler simulations using Mathematica to build a table of data. However after the code has been running for a while and many simulations have been run, my computer says my hard drive is full. I am not (or at least do not want to) store all the variables and time series data, I am just extract one scalar number from each simulation run, and I can discard the rest.

Upon further investigation I found that the folder:

"C:\Users\NAME\AppData\Local\Temp\WolframSystemModeler\WSMLink "

is full of very large temp files (>50GB) during the batch run.

If I kill the kernal of Mathematica the folder cleans out, but I loose all my data.

How can I limit how WSMLink uses this temp folder?

POSTED BY: Wayne Weaver
3 Replies

Glad to hear it!

For future versions we are looking into ways to further reduce the amount of temporary data stored to file in cases like yours, where one is only interested in a small subset of the data.

POSTED BY: Malte Lenz

Malte - Thank you for your help. This is exactly what I needed.

POSTED BY: Wayne Weaver

You can remove result files from disk using the command below. Note these things however:

  • When you run it, it will delete all result files from all simulations you have run up to this point
  • You should read in the data you need before deleting files, for example like this:

    myVariables = mySimulationResult[{"var1", "var2", ...}]
    
  • Assume all WSMSimulationData result objects that were created before deleting, will be completely unusable after deleting

Here is the command to delete all temporary result files from WSMLink:

WSMLink`Library`ClearTemporaryFiles[-1]

This command is not documented, so may change or disappear in future versions.

As an alternative, if you have control over the models, you can try to move as many variables as possible into protected sections in the Modelica code. Protected variables are not saved to the result by default (version 4.2 and newer).

POSTED BY: Malte Lenz
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract