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

## MKL POISSON LIBRARY ERROR

Beginner
923 Views

I am numerically solving Poisson equation using Poisson Solver Routines https://software.intel.com/en-us/node/471042 . The equation has both Neumann and periodic boundary conditions. These boundary condition will go into the parameter 'BCtype.'  In my code, the library seems to not allow me to solve Poisson equation with periodic boundary condition. After I run my code, I received this error message:

"MKL POISSON LIBRARY ERROR:

Parameter ipar[3]=-197 is out of admissible range {0,...,15} Probably, it was altered by mistake outside of the routine, or some characters in the parameter 'BCtype' were out of admissible range {D,N} during initialization stage. Computations has been stopped The result may be wrong. "

Is it possible to solve Poisson equation with the periodic boundary condition? According to the above webpage, it is legitimate. But it fails in practice.

11 Replies
Beginner
923 Views

I solve Poisson equation in 2D cartesian coordinates. First I call d_init_Helmholtz_2D(....,BCtype,...) where BCtype="PPNN"   The error message appears after I use d_commit_Helmholtz_2D(....)

Employee
923 Views

Hi,

This error can appeared in case of changing iparm array between init and commit stage. Could you print iparm array 2 times - after init and before commit and send it to me?

Thanks,

Alex

Beginner
923 Views

The value of ipar[] array does not change during this stage.

BEFORE d_init_Helmholtz_2D; ipar=0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
AFTER d_init_Helmholtz_2D; ipar=0, 1, 1, -197, -1, -1, 1, 1, 0, 0, 8, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
BEFORE d_commit_Helmholtz_2D; ipar=0, 1, 1, -197, -1, -1, 1, 1, 0, 0, 8, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-------------------------------------------------------------------------------
MKL POISSON LIBRARY ERROR:
Parameter ipar[3]=-197 is out of admissible range {0,...,15}.
Probably, it was altered by mistake outside of the routine, or some characters in
the parameter 'BCtype' were out of admissible range {D,N} during initialization
stage. Computations has been stopped. The result may be wrong.
AFTER d_commit_Helmholtz_2D; ipar=-100, 1, 1, -197, -1, -1, 1, 1, 0, 0, 8, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

The error shows up when I call commit routine. If I change the periodic boundary condition to other type (Neumann), this error message does not appear. Everything will work just fine. But I need to use the periodic boundary condition.

Honored Contributor III
923 Views

If you did not set the value -197 into ipar[3] on purpose, it is likely that there are some array sizes provided that are not correct, and the value -197, which was supposed to be used for some other variable, spilled into ipar. Can you provide the source code that gave you this error?

Employee
923 Views

Hi,

Looks like first 2 chars in Bctype word is not correct, not equal to "N" or "D" or "P". Could you provide BCtype?

Thanks,

Alex

Beginner
923 Views

This is a portion of my code:

==================================================================

long Nx = 10, Ny = 100;

double ax, bx, ay, by, q_helmholtz=0;
long long stat, nx=(Nx-1)-1, ny=Ny-1;
long long ipar[128];
double *dpar, *fHelmholtz, *bd_ax, *bd_bx, *bd_ay, *bd_by;
DFTI_DESCRIPTOR_HANDLE xhandle = 0;
char *BCtype;
ax = 0;
bx = (nx+1)*dx;
ay = 0;
by = (ny+1)*dy;
dpar = (double*)malloc((13*nx/2+7)*sizeof(double));
bd_ax = (double*)malloc((ny+1)*sizeof(double));
bd_bx = (double*)malloc((ny+1)*sizeof(double));
bd_ay = (double*)malloc((nx+1)*sizeof(double));
bd_by = (double*)malloc((nx+1)*sizeof(double));
fHelmholtz = (double*)malloc((nx+1)*(ny+1)*sizeof(double));

BCtype = "PPNN";
for(i=0;i<128;i++){ //reset ipar
ipar = 0;
}
printf("BEFORE d_init_Helmholtz_2D; ipar=");
for(i=0;i<128;i++){
printf("%ld, ",ipar);
}
printf("\n");
d_init_Helmholtz_2D(&ax, &bx, &ay, &by, &nx, &ny, BCtype, &q_helmholtz, ipar, dpar, &stat);
printf("AFTER d_init_Helmholtz_2D; ipar=");
for(i=0;i<128;i++){
printf("%ld, ",ipar);
}

==================================================================

I have never changed the element value of ipar anywhere else.

Employee
923 Views

HI,

And the last question - which version of MKL do you use? I ask because support of periodic boundary condition have been implemented a bit later after support of Dirichlet and Neumann boundary condition. The behavior of your example is similar to situation of old MKL release without "P" support.

Thanks,

Alex

Beginner
923 Views

That explains the problem. I am using MKL that came with intel composer xe 2011 sp1 on Linux machine. Which is the version of MKL that supports periodic boundary condition?

Thanks,

Apiwat

Employee
923 Views

Hi,

That's last release without supporting periodic boundary condition in Helmholtz_2D, this support have been implemented in Composer XE 2011 update 7

Thanks,

Alex

Beginner
923 Views

Thank you for your help, Alex. I will update the library soon.

Apiwat

Employee
923 Views

Apiwat,

No problem, feel free to ask me any questions according Poisson library and other MKL domains and sorry for so long period in understand problem.

Thanks,

Alex