PhysicsofFluids/AFiD

SEGFAULT on Cartesius

jdonners opened this issue · 1 comments

The code segfaults on Cartesius, while it does not on HERMIT or local machines.
It happens in SolvePressureCorrection.F90 (old: phcalc.F) at this call:

call dfftw_execute_dft_r2c(fwd_guruplan_y,ry1,cy1)

which is line 106 in version 49.

It has something to do with the guru interface as this call without guru in older versions of the code works.

the problem is that the MKL library is linked in before the FFTW3 library. Although the MKL library provides an FFTW3 interface, it does not support the use of transforms of multidimensional vectors, see ​https://software.intel.com/sites/products/documentation/hpc/mkl/mklman/GUID-D17B3AB4-BD4E-4652-94A7-BAD4130CCB4A.htm.

The solution is to use the -lfftw3 compiler flag before the -mkl flag in the Makefile. I have added a check for the guru plan to SolvePressureCorrection.F90 (revision 51).