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

ERROR:cache_util_win.cc(20), Unable to move the cache: Access is denied. #534

Open
Elfangor93 opened this issue Feb 29, 2024 · 1 comment

Comments

@Elfangor93
Copy link
Contributor

Elfangor93 commented Feb 29, 2024

First of all, thank you very much for this very great python library!!

But I am facing a problem when simulating a model with different parameter values. I am strictly following the guide at https://simulationresearch.lbl.gov/modelica/buildingspy/examples.html#simulating-a-model-with-two-different-parameter-values. If the list of cases contains more than one simulator object using the same model I get the following error:

*** Standard error stream from simulation:
b'[3584:8732:0229/082518.845:ERROR:cache_util_win.cc(20)] Unable to move the cache: Access is denied. (0x5)\r\n[3584:25392:0229/082518.868:ERROR:disk_cache.cc(205)] Unable to create cache\r\n[3584:25392:0229/082518.868:ERROR:gpu_disk_cache.cc(673)] Gpu Cache Creation failed: -2\r\n'

A quick google search tells me that this error is related to a file which is already in use by another progam and is therefore blocked.

If the outputDirectory is set to be different for each simulator the simulation seems to be successful even with the above error appearing. If I set the outputDirectory to be the same, but set different names for the result file only one of the simulations in the cases list seems to be simulated successfully. In this case I see only one .mat file beeing created.

s.setResultFile('different-file-names')

System information

OS: Microsoft Windows 10 Home
OS Version: 10.0.19045 N/A Build 19045
Python: v3.11.3
buildingspy: v5.0.0
Dymola: Version 2024x, 2023-10-06

@mwetter
Copy link
Member

mwetter commented Mar 1, 2024

@Elfangor93 : You will need to make sure that the outputDirectory is unique for each Simulator object. The reason is that a run creates these file (on Linux, and similar on Windows):

├── case1
│   ├── BuildingsPy.log
│   ├── buildlog.txt
│   ├── dsfinal.txt
│   ├── dsin.txt
│   ├── dslog.txt
│   ├── dsmodel.c
│   ├── dymosim
│   ├── FlatPlateWithTank.mat
│   ├── run.mos
│   └── simulator.log
├── case2
│   ├── BuildingsPy.log
│   ├── buildlog.txt
│   ├── dsfinal.txt
│   ├── dsin.txt
│   ├── dslog.txt
│   ├── dsmodel.c
│   ├── dymosim
│   ├── FlatPlateWithTank.mat
│   ├── run.mos
│   └── simulator.log

Hence, if the outputDirectory is not unique, then the two processes write to the same files. They also both write the same dsmodel.c file, and it is not predictable what actually gets compiled. Hence the directory need to be unique.

I cannot reproduce the Access is denied error on Linux; this may be related to Windows permission as each job in the pool runs in its own directory.

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