This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

instant cache error

0 votes

I need to solve the same problem on finer and finer mesh sizes and compare the results. Therefore, I have constructed my code as a function and am calling the function with the mesh sizes as input. The problem is solved on the first mesh size input with no problems. But, when the code moves onto the next mesh size, I get the following error

In instant.build_module: Cache directory '/U1/accounts/adiegel/.instant/cache/ffc_form_6521db4140648849bfb344c812903380188afb57' shouldn't exist at this point!

Is there a python command which I could write into my code which would clear the cache between different mesh sizes (not from a command line in the terminal)?

Any help is much appreciated! Please let me know if I need to clarify the statement of my issue.

asked Dec 8, 2015 by adiegel FEniCS Novice (290 points)

Do you consistently get the error after you run instant-clean from the terminal, because the one time I encountered this message that solved it. (btw you can always execute commands like this from python - check the subprocess module for example)

Yes, so I am aware of the 'instant-clean' solution from terminal. However, I need this code to run continuously between the separate mesh sizes. So, my question is, is there a way to program 'instant-clean' inside the python script?

Thanks for your help!

As in the comment above:

import subprocess

<your code>
subprocess.call("instant-clean")
<resize mesh>
<more code>

...might work as a workaround. I suspect something more profound is wrong if you keep getting that error message though.

Thank you. Initially, this does seem to work as a workaround. What is interesting is that when I run my code on my laptop, I do not encounter this error. But, when I try to run it on a server, I do encounter the error. I'm not sure what the difference is. My laptop is not strong enough to run the most fine mesh size, so I do need this to run the code on a server.

Thanks again.

To my knowledge, instant-clean removes all precompiled forms form the ~/.instant folder (in your home directory). Depending on how the server is configured, it is possible that the instant-clean command empties your local .instant-folder, while you actually want to empty the one on the server. If you find such folder on the server you can just delete it (or at least I did and nothing exploded) and try again.

Have you tried using flufl.lock (see README).

...