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

Error in calling pzgemm function.

GPU_AI
Novice
1,405 Views

Hello. 

 

I got a  "free(): invalid pointer" error message running my program. 

With mpigdb and entering "where" command, I have following results.

 

[0-3] (mpigdb) where

[0] #0  0x0000150b546ae37f in raise () from /lib64/libc.so.6

[1] #0  0x0000153a4bd7137f in raise () from /lib64/libc.so.6

[2] #0  0x0000148bb605f37f in raise () from /lib64/libc.so.6

[3] #0  0x0000147046f6837f in raise () from /lib64/libc.so.6

[0] #1  0x0000150b54698db5 in abort () from /lib64/libc.so.6

[1] #1  0x0000153a4bd5bdb5 in abort () from /lib64/libc.so.6

[2] #1  0x0000148bb6049db5 in abort () from /lib64/libc.so.6

[3] #1  0x0000147046f52db5 in abort () from /lib64/libc.so.6

[0] #2  0x0000150b546f14e7 in __libc_message () from /lib64/libc.so.6

[1] #2  0x0000153a4bdb44e7 in __libc_message () from /lib64/libc.so.6

[2] #2  0x0000148bb60a24e7 in __libc_message () from /lib64/libc.so.6

[3] #2  0x0000147046fab4e7 in __libc_message () from /lib64/libc.so.6

[0] #3  0x0000150b546f85ec in malloc_printerr () from /lib64/libc.so.6

[1] #3  0x0000153a4bdbb5ec in malloc_printerr () from /lib64/libc.so.6

[2] #3  0x0000148bb60a95ec in malloc_printerr () from /lib64/libc.so.6

[3] #3  0x0000147046fb25ec in malloc_printerr () from /lib64/libc.so.6

[0] #4  0x0000150b546f9eec in _int_free () from /lib64/libc.so.6

[1] #4  0x0000153a4bdbceec in _int_free () from /lib64/libc.so.6

[2] #4  0x0000148bb60aaeec in _int_free () from /lib64/libc.so.6

[3] #4  0x0000147046fb3eec in _int_free () from /lib64/libc.so.6

[0] #5  0x0000150b5e093217 in PB_CpgemmMPI ()

[1] #5  0x0000153a55756217 in PB_CpgemmMPI ()

[2] #5  0x0000148bbfa44217 in PB_CpgemmMPI ()

[3] #5  0x000014705094d217 in PB_CpgemmMPI ()

[0-3]   from /opt/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_scalapack_ilp64.so.2

[0] #6  0x0000150b5e103812 in pzgemm_ ()

[1] #6  0x0000153a557c6812 in pzgemm_ ()

[2] #6  0x0000148bbfab4812 in pzgemm_ ()

[3] #6  0x00001470509bd812 in pzgemm_ ()

[0-3]   from /opt/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_scalapack_ilp64.so.2

[0-3] #7  0x000000000040e1d9 in scl_hamiltonian_real_transition_prob_calculating (

[0]     ptr_scl_hamiltonian_real_listi=0x1ce5dc0, 

[1]     ptr_scl_hamiltonian_real_listi=0x18bbdc0, 

[2]     ptr_scl_hamiltonian_real_listi=0x1deadc0, 

[3]     ptr_scl_hamiltonian_real_listi=0x2113dc0, 

[0]     ptr_scl_hamiltonian_real_listf=0x2421140, volume_ham=0) at main.c:2478

[1]     ptr_scl_hamiltonian_real_listf=0x221e800, volume_ham=0) at main.c:2478

[2]     ptr_scl_hamiltonian_real_listf=0x1fb5080, volume_ham=0) at main.c:2478

[3]     ptr_scl_hamiltonian_real_listf=0x3103080, volume_ham=0) at main.c:2478

[0-3] #8  0x000000000041f9db in runMainLocalPerturbation () at main.c:5763

[0] #9  0x00000000004030f5 in main (argc=1, argv=0x7fff9017e078) at main.c:324

[1] #9  0x00000000004030f5 in main (argc=1, argv=0x7ffc84e57fb8) at main.c:324

[2] #9  0x00000000004030f5 in main (argc=1, argv=0x7ffff76de9b8) at main.c:324

[3] #9  0x00000000004030f5 in main (argc=1, argv=0x7fff8282fa88) at main.c:324

 

The 2478th line of main.c is the part calling pzgemm function :

 

pzgemm_("N", "N", &isize, &isize, &isize, &Cblacsone, cmatI, &Iblacsone, &Iblacsone, desc_cmatI, cmatU, &Iblacsone, &Iblacsone, desc_cmatU, &Cblacszero, cmatIU, &Iblacsone, &Iblacsone, desc_cmatIU);  

 

where, "Cblacsone" and "Cblacszero" are the MKL_COMPLEX16 type variable indicating 1 and 0, respectively, and "Iblacseone" is the MKL_INT type variable also indicating 1.

The "desc_cmatI", "desc_cmatU" and desc_cmatIU are the descriptor of each matrices.

 

1) I use ILP64 environment.

2) This error only happens when the matrices participating pzgemm (e.g, cmatI, cmatU in my case) have the large dimension. I check that for relatively small sizes of matrices, no error occurs. 

3) The matrices cmatI, cmatU, cmatIU are square matrix with the dimension of isize. 

 

I'm newbie of gdb and ScaLAPACK, so it is hard to understand why I get this error.

Especially I want to understand why free(): invalid pointer error message is produced while I call the pzgemm function.

Please let me know is there any information you want to know.

 

Thanks. 

 

 

 

 

0 Kudos
5 Replies
ShanmukhS_Intel
Moderator
1,370 Views

Hi Mingeon,

 

Thanks for posting on Intel Communities.

 

Could you please get back to us with the MKL version, reproducer, and steps to reproduce (if any)? It helps us reproduce the issue in our environment and help you accordingly.

 

Based on the error message shared, it seems you are trying to free  a memory that was not allocated using malloc() or related family functions. It seems there is some meomory management issue in your code. Hence, to investigate further we requested above details.

 

Best Regards,

Shanmukh.SS

 

 

 

0 Kudos
ShanmukhS_Intel
Moderator
1,368 Views

Hi Mingeon,

 

Thanks for posting in Intel Communities.

 

Could you please get back to us with the sample reproducer,  steps to reproduce (if any) and the MKL version? It helps us reproduce the issue in our environment and help you accordingly.

 

Best Regards,

Shanmukh.SS

 

 



0 Kudos
GPU_AI
Novice
1,354 Views

Hello ShanmukhS!  Thanks for your reply.

 

I'm sorry but I don't understand what the "reproducer" is. Also, what kind of "stpes to reproduce" you meant by?

You mean how I compile and execute the programme?

 

Thanks. 

 

 

 

0 Kudos
ShanmukhS_Intel
Moderator
1,297 Views

Hi Mngeon,


You mean how I compile and execute the program?

>> Yes, We would like to reproduce the behavior in our environment. Hence we would like a minimal working sample reproducer(a sample source code that can be used in reproducing the error faced by you) so that we could try reproducing the issue and help you accordingly.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
1,224 Views

Hi Mingeo,


A gentle reminder:

Could you please get back to us with the earlier shared details? It helps us in assisting you further.


Best Regards,

Shanmukh.SS


0 Kudos
Reply