Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7256 Discussions

the diagonal component of an inverse matrix have negative value

ddd1000
Beginner
611 Views

 I am calculating the diagonal components of the inverse matrix using the Intel MKL PARDISO function, and the diagonal components are coming out as negative values. I would like to ask if there is a solution for this. 

I tested this with Intel MKL versions 2025.2 and 2025.3. 

 

 attach file : demo.tar.xz

    ia file : demo.ia.bin

    ja file : demo.ja.bin

    a file : demo.a.bin

    test code : diag_of_inv.cpp

 

 

 

0 Kudos
4 Replies
Fengrui
Moderator
518 Views

Hi,

 

I tried the reproducer with both oneMKL 2025.2 and 2025.3 on an Intel Xeon (OS: Ubuntu 24.04 LTS), but failed to get any negative values.

 

Output:

...

#total size : 31495
#negative size : 0

 

Could you provide more info about the machine and OS?

 

Thanks,

Fengrui

0 Kudos
ddd1000
Beginner
482 Views

Hi, Fengrui

 

The OS and CPU used for the test are as follows: The first is an Intel Core i5-7500 3.40GHz with Debian Forky, and the second is an Intel Xeon Gold 6142 CPU 2.60GHz with RHEL 8.10.

When performing the test on my CPU and OS, some values (over 1000) in the diagonal of the inverse matrix are coming out as negative numbers.

0 Kudos
ddd1000
Beginner
478 Views

Hi, Fengrui

 

Could you share a your build scripts(Makefile etc)?

 

My build scripts (MKL 2025.3)

% g++ -o diag_of_inv.exe diag_of_inv.cpp -DMKL_ILP64 -m64 -I"${MKLROOT}/include" \
# -m64 -Wl,--start-group ${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_gnu_thread.a ${MKLROOT}/lib/libmkl_core.a -Wl,--end-group -lgomp -lpthread -lm -ldl

0 Kudos
Fengrui
Moderator
451 Views

I used Intel compiler: icpx -DMKL_ILP64 -qmkl-ilp64=parallel diag_of_inv.cpp

I also tried your build scripts but still didn't reproduce the results (all values are positive). I will try to find the same machine with the same OS to test. 

0 Kudos
Reply