Pardiso solver fails... randomly?

I’m having a weird error when trying to solve an Allen-Cahn (time-dependent) problem.

If I run the code: “python” fresh, then it works. But if I run it immediately again, I get these kinds of errors:

“Setup and Factorization: PARDISO returned error -3!”


wrote matrix to file ‘pardiso.err’, please check
Newton iteration 3 energy = 3.4219400589865796e-08 Traceback (most recent call last):
File “”, line 100, in
File “C:\FILES\NGsolve_code\AllenCahn../Newton_Methods\”, line 18, in SolveNonlinearMinProblem
inv = a.mat.Inverse(FES.FreeDofs())
netgen.libngpy._meshing.NgException: PardisoInverse: Setup and Factorization failed.

sometimes if I delete the “pycache” sub-dir, it will run successfully again (but not always). Also, if I just keep trying to run “python” at the command prompt, eventually it will work.

This is on a windows machine.