Met RuntimeError: Failed just-in-time compilation of form: JIT compilation timed out, probably due to a failed previous compile... when submitted a large number of cases on HPC.
Say I have code in main.py. I submitted n cases with command line argument in order by
$ mpirun -n 12 python main.py -case 1
$ mpirun -n 12 python main.py -case 2
...
$ mpirun -n 12 python main.py -case n-1
$ mpirun -n 12 python main.py -case n
Each above execution command generates a running folder and all output data are stored over there (case1, case2,… casen). However, just case1 has normal output, while others get the runtime error as mentioned above.
I tried to modified the cache_dir of jit.DOLFINX_DEFAULT_JIT_OPTIONS, but the following code returns RuntimeError: Failed just-in-time compilation of form: Compilation failed on root node. Any suggestion?
MWE:
from mpi4py import MPI
import ufl
from dolfinx import jit, fem, mesh
# Get case ID from CLI and mkdir, say "case3" for example.
# ...
jit.DOLFINX_DEFAULT_JIT_OPTIONS.update({"cache_dir": "case3"})
msh = mesh.create_unit_square(MPI.COMM_WORLD, 4, 4)
V = fem.functionspace(msh, ("Lagrange", 1, (msh.topology.dim, )))
u = fem.Function(V)
L = fem.form(ufl.div(u) * ufl.dx)