Occ and Pardiso error

Hi,

we have built netgen/ngsolve with occ on Linux from sources successfully and we can run most examples successfully. If we run “netgen navierstokes.py” we get error messages like:

Setup and Factorization: PARDISO returned error -3!
err = reordering problem
symmetric = 0
spd = 0
compressed = 1
inner = 0x7f81240660f0
cluster = 0
Traceback (most recent call last):
  File "<string>", line 43, in <module>
netgen.libngpy._meshing.NgException: PardisoInverse: Setup and Factorization failed.
Finished executing navierstokes.py

Setup and Factorization: PARDISO returned error -2!
err = not enough memory
symmetric = 0
spd = 0
compressed = 1
inner = 0x7f39ac0660f0
cluster = 0
Traceback (most recent call last):
  File "<string>", line 54, in <module>
netgen.libngpy._meshing.NgException: PardisoInverse: Setup and Factorization failed.

The error seems to be related to occ and Pardiso. For comparison:

  • If we switch in some other python script to the PARDISO solver we observe the same error.
  • If we run “python3 navierstokes.py” the same computation is completed successfully.
  • If we use a different solver we can run “netgen navierstokes.py” successfully.
  • If we build without occ, we can run both “netgen navierstokes.py” and “python3 navierstokes.py” successfully.

Some details of the installation in our cluster:

  • Debian 11 (bullseye)
  • mkl from non-free Debian packages “intel-mkl” etc
  • occ from Debian packages “libocct-data-exchange-dev libocct-draw-dev occt-misc libxi-dev libxi6”
  • my version: [color=#000000]NETGEN-6.2.2301-41-ga0b9dca2, [/color][color=#000000]but the colleagues may use more recent checkouts.[/color]
  • cmake call without occ:
cmake -DUSE_MPI=ON -DUSE_MKL=ON -DMKL_INCLUDE_DIR=/usr/include/mkl/ -DCMAKE_INSTALL_PREFIX=...[/code]
[*]cmake call with occ: 
[code]cmake -DUSE_OCC=ON -DUSE_MPI=ON -DUSE_MKL=ON -DMKL_INCLUDE_DIR=/usr/include/mkl/ -DCMAKE_INSTALL_PREFIX=...

I did not notice any obviously relevant differences in the two versions of the file: CMakeCache.txt.
I did not notice any obviously relevant differences comparing the linking commands in the output of make in some verbose mode (make VERBOSE=1) for the two versions.

Do you have some idea/any advice for us how to fix the problem?

Best regards,
Guenther

Hi Günther,

Thanks for the detailed bug report. I managed to reproduce your issue exactly as you stated ( happens only with OCC ). FYI: I used this docker build to trigger the bug (not using debian myself):

I will let you know, when I have an update/workaround/idea whats wrong here.

Best,
Matthias

First workaround is to set the environment variable MKL_THREADING_LAYER to gnu:
export MKL_THREADING_LAYER=gnu

Best,
Matthias

Hi Matthias,

I can confirm that the suggested setting fixes the problem.
Thanks a lot for the quick solution and the great support.

Best regards,
Guenther

I was also getting this error. I tried the “fix”:
export MKL_THREADING_LAYER=gnu

but it still gives me the error. Do I need to recompile/rebuild ngsolve with that environment variable set?

I also note that I do not have any error when I run the code in a Jupyter Notebook. I can use pardiso no problem in Jupyter Notebook. But I still get the error if I try to run the navierstokes.py example with netgen.