Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

PARDISO Phases called in different routines,Mem leak?

$
0
0

Hi

I am calling pardiso  with c/c++. for that I packed all phases of pardiso  in a library  , but splitted into different soubroutines using *pt and *iparm as  global variables within that file/library (see the pseudo code below)

library.c:

void *pt[64]
MKL_INT  iparm[64]

phase_init( ... )
{
    for (i =0;i<64;i++)
     pt[i]=0;
     iparm[0]=1 ....
}

phase_11(a, ia, ja)
{
   MKL_INT phase=11;
   pardiso(pt.. a,ia....)
}

phase_22(a,ia,ja)
{
   MKL_INT phase=22;
   pardiso(pt,...a,ia....)
}

phase_33(a, ia,ja, double* x, double* b)
{
   MKL_INT phase=33;
   pardiso(pt,... a,ia....)
}

the Idea  is that I call  phase 11 and 22 (num-symb factorization) with an extternal c-code that just tells which phase to call pasing A and save that in the gobal pt .

After that with the client code call phase 33 passing x and b, as many times as I want (the problem is actually I can call only one RHS at once , since a RHS will be calculated with previous RHS's)

The code is working well , but  memory is increasing uncrontrolled , I read that  one should not  modify pt after the first phase since a severe memory leak might occur, which is my case. But I am not modifiying pt , I am  just passing it from function to function as global, and I dont see why pt have to be always local to the function that calls it.

I am using mkl 11.2 with gcc linking static w/o multi-threa.

Any Ideas how can achieve  to pass pt among differnt functions , compilations unists, etc  Thanks  !

PS:  I also try to dump  pt to a file and read it any time phase 33 was called( with pardiso_store and pardiso_restore ), it is still working  but  a 5 GB was generated and the time used for reading it was prohibitive .

 

 

 

 

 


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>