# Implementation Details

Several aspects of the Intel MKL PL interface are platform-specific and language-specific. To promote portability across platforms and ease of use across different languages, users are provided with the PL language-specific header files to include in their code. Currently, the following header files are available:

- mkl_poisson.h, to be used together with mkl_dfti.h, for C programs.
- mkl_poisson.f90, to be used toghether with mkl_dfti.f90, for Fortran 90 programs.

### Note

Use of the Intel MKL PL software without including one of the above header files is not supported.

The include files define function prototypes for appropriate languages.

## C-specific Header File

The C-specific header file defines the following function prototypes for the Cartesian solver:

void d_init_Helmholtz_2D(double*, double*, double*, double*, int*, int*, char*, double*, int*, double*, int*);

void d_commit_Helmholtz_2D(double*, double*, double*, double*, double*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void d_Helmholtz_2D(double*, double*, double*, double*, double*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void s_init_Helmholtz_2D(float*, float*, float*, float*, int*, int*, char*, float*, int*, float*, int*);

void s_commit_Helmholtz_2D(float*, float*, float*, float*, float*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void s_Helmholtz_2D(float*, float*, float*, float*, float*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void free_Helmholtz_2D(DFTI_DESCRIPTOR_HANDLE*, int*, int*);

void d_init_Helmholtz_3D(double*, double*, double*, double*, double*, double*, int*, int*, int*, char*, double*, int*, double*, int*);

void d_commit_Helmholtz_3D(double*, double*, double*, double*, double*, double*, double*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void d_Helmholtz_3D(double*, double*, double*, double*, double*, double*, double*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void s_init_Helmholtz_3D(float*, float*, float*, float*, float*, float*, int*, int*, int*, char*, float*, int*, float*, int*);

void s_commit_Helmholtz_3D(float*, float*, float*, float*, float*, float*, float*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void s_Helmholtz_3D(float*, float*, float*, float*, float*, float*, float*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void free_Helmholtz_3D(DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, int*);

The C-specific header file defines the following function prototypes for the spherical solver:

void d_init_sph_p(double*, double*, double*, double*, int*, int*, double*, int*, double*, int*);

void d_commit_sph_p(double*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void d_sph_p(double*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void s_init_sph_p(float*, float*, float*, float*, int*, int*, float*, int*, float*, int*);

void s_commit_sph_p(float*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void s_sph_p(float*, DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void free_sph_p(DFTI_DESCRIPTOR_HANDLE*, DFTI_DESCRIPTOR_HANDLE*, int*, int*);

void d_init_sph_np(double*, double*, double*, double*, int*, int*, double*, int*, double*, int*);

void d_commit_sph_np(double*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void d_sph_np(double*, DFTI_DESCRIPTOR_HANDLE*, int*, double*, int*);

void s_init_sph_np(float*, float*, float*, float*, int*, int*, float*, int*, float*, int*);

void s_commit_sph_np(float*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void s_sph_np(float*, DFTI_DESCRIPTOR_HANDLE*, int*, float*, int*);

void free_sph_np(DFTI_DESCRIPTOR_HANDLE*, int*, int*);

## Fortran-Specific Header File

The Fortran90-specific header file defines the following function prototypes for the Cartesian solver:

SUBROUTINE D_INIT_HELMHOLTZ_2D (AX, BX, AY, BY, NX, NY, BCTYPE, Q, IPAR, DPAR, STAT)

USE MKL_DFTI

INTEGER NX, NY, STAT

INTEGER IPAR(*)

DOUBLE PRECISION AX, BX, AY, BY, Q

DOUBLE PRECISION DPAR(*)

CHARACTER(4) BCTYPE

END SUBROUTINE

SUBROUTINE D_COMMIT_HELMHOLTZ_2D (F, BD_AX, BD_BX, BD_AY, BD_BY, XHANDLE, IPAR, DPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION BD_AX(*), BD_BX(*), BD_AY(*), BD_BY(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE

END SUBROUTINE

SUBROUTINE D_HELMHOLTZ_2D (F, BD_AX, BD_BX, BD_AY, BD_BY, XHANDLE, IPAR, DPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION BD_AX(*), BD_BX(*), BD_AY(*), BD_BY(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE

END SUBROUTINE

SUBROUTINE S_INIT_HELMHOLTZ_2D (AX, BX, AY, BY, NX, NY, BCTYPE, Q, IPAR, SPAR, STAT)

USE MKL_DFTI

INTEGER NX, NY, STAT

INTEGER IPAR(*)

REAL AX, BX, AY, BY, Q

REAL SPAR(*)

CHARACTER(4) BCTYPE

END SUBROUTINE

SUBROUTINE S_COMMIT_HELMHOLTZ_2D (F, BD_AX, BD_BX, BD_AY, BD_BY, XHANDLE, IPAR, SPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL F(IPAR(11)+1,*)

REAL SPAR(*)

REAL BD_AX(*), BD_BX(*), BD_AY(*), BD_BY(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE

END SUBROUTINE

SUBROUTINE S_HELMHOLTZ_2D (F, BD_AX, BD_BX, BD_AY, BD_BY, XHANDLE, IPAR, SPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL F(IPAR(11)+1,*)

REAL SPAR(*)

REAL BD_AX(*), BD_BX(*), BD_AY(*), BD_BY(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE

END SUBROUTINE

SUBROUTINE FREE_HELMHOLTZ_2D (XHANDLE, IPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE

END SUBROUTINE

SUBROUTINE D_INIT_HELMHOLTZ_3D (AX, BX, AY, BY, AZ, BZ, NX, NY, NZ, BCTYPE, Q, IPAR, DPAR, STAT)

USE MKL_DFTI

INTEGER NX, NY, NZ, STAT

INTEGER IPAR(*)

DOUBLE PRECISION AX, BX, AY, BY, AZ, BZ, Q

DOUBLE PRECISION DPAR(*)

CHARACTER(6) BCTYPE

END SUBROUTINE

SUBROUTINE D_COMMIT_HELMHOLTZ_3D (F, BD_AX, BD_BX, BD_AY, BD_BY, BD_AZ, BD_BZ, XHANDLE, YHANDLE, IPAR, DPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,IPAR(12)+1,*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION BD_AX(IPAR(12)+1,*), BD_BX(IPAR(12)+1,*), BD_AY(IPAR(11)+1,*)

DOUBLE PRECISION BD_BY(IPAR(11)+1,*), BD_AZ(IPAR(11)+1,*), BD_BZ(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE, YHANDLE

END SUBROUTINE

SUBROUTINE D_HELMHOLTZ_3D (F, BD_AX, BD_BX, BD_AY, BD_BY, BD_AZ, BD_BZ, XHANDLE, YHANDLE, IPAR, DPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,IPAR(12)+1,*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION BD_AX(IPAR(12)+1,*), BD_BX(IPAR(12)+1,*), BD_AY(IPAR(11)+1,*)

DOUBLE PRECISION BD_BY(IPAR(11)+1,*), BD_AZ(IPAR(11)+1,*), BD_BZ(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE, YHANDLE

END SUBROUTINE

SUBROUTINE S_INIT_HELMHOLTZ_3D (AX, BX, AY, BY, AZ, BZ, NX, NY, NZ, BCTYPE, Q, IPAR, SPAR, STAT)

USE MKL_DFTI

INTEGER NX, NY, NZ, STAT

INTEGER IPAR(*)

REAL AX, BX, AY, BY, AZ, BZ, Q

REAL SPAR(*)

CHARACTER(6) BCTYPE

END SUBROUTINE

SUBROUTINE S_COMMIT_HELMHOLTZ_3D (F, BD_AX, BD_BX, BD_AY, BD_BY, BD_AZ, BD_BZ, XHANDLE, YHANDLE, IPAR, SPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL F(IPAR(11)+1,IPAR(12)+1,*)

REAL SPAR(*)

REAL BD_AX(IPAR(12)+1,*), BD_BX(IPAR(12)+1,*), BD_AY(IPAR(11)+1,*)

REAL BD_BY(IPAR(11)+1,*), BD_AZ(IPAR(11)+1,*), BD_BZ(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE, YHANDLE

END SUBROUTINE

SUBROUTINE S_HELMHOLTZ_3D (F, BD_AX, BD_BX, BD_AY, BD_BY, BD_AZ, BD_BZ, XHANDLE, YHANDLE, IPAR, SPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL F(IPAR(11)+1,IPAR(12)+1,*)

REAL SPAR(*)

REAL BD_AX(IPAR(12)+1,*), BD_BX(IPAR(12)+1,*), BD_AY(IPAR(11)+1,*)

REAL BD_BY(IPAR(11)+1,*), BD_AZ(IPAR(11)+1,*), BD_BZ(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE, YHANDLE

END SUBROUTINE

SUBROUTINE FREE_HELMHOLTZ_3D (XHANDLE, YHANDLE, IPAR, STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: XHANDLE, YHANDLE

END SUBROUTINE

The Fortran90-specific header file defines the following function prototypes for the spherical solver:

SUBROUTINE D_INIT_SPH_P(AP,BP,AT,BT,NP,NT,Q,IPAR,DPAR,STAT)

USE MKL_DFTI

INTEGER NP, NT, STAT

INTEGER IPAR(*)

DOUBLE PRECISION AP,BP,AT,BT,Q

DOUBLE PRECISION DPAR(*)

END SUBROUTINE

SUBROUTINE D_COMMIT_SPH_P(F,HANDLE_S,HANDLE_C,IPAR,DPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE_C, HANDLE_S

END SUBROUTINE

SUBROUTINE D_SPH_P(F,HANDLE_S,HANDLE_C,IPAR,DPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE_C, HANDLE_S

END SUBROUTINE

SUBROUTINE S_INIT_SPH_P(AP,BP,AT,BT,NP,NT,Q,IPAR,SPAR,STAT)

USE MKL_DFTI

INTEGER NP, NT, STAT

INTEGER IPAR(*)

REAL AP,BP,AT,BT,Q

REAL SPAR(*)

END SUBROUTINE

SUBROUTINE S_COMMIT_SPH_P(F,HANDLE_S,HANDLE_C,IPAR,SPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL SPAR(*)

REAL F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE_C, HANDLE_S

END SUBROUTINE

SUBROUTINE S_SPH_P(F,HANDLE_S,HANDLE_C,IPAR,SPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL SPAR(*)

REAL F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE_C, HANDLE_S

END SUBROUTINE

SUBROUTINE FREE_SPH_P(HANDLE_S,HANDLE_C,IPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE_S, HANDLE_C

END SUBROUTINE

SUBROUTINE D_INIT_SPH_NP(AP,BP,AT,BT,NP,NT,Q,IPAR,DPAR,STAT)

USE MKL_DFTI

INTEGER NP, NT, STAT

INTEGER IPAR(*)

DOUBLE PRECISION AP,BP,AT,BT,Q

DOUBLE PRECISION DPAR(*)

END SUBROUTINE

SUBROUTINE D_COMMIT_SPH_NP(F,HANDLE,IPAR,DPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE

END SUBROUTINE

SUBROUTINE D_SPH_NP(F,HANDLE,IPAR,DPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

DOUBLE PRECISION DPAR(*)

DOUBLE PRECISION F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE

END SUBROUTINE

SUBROUTINE S_INIT_SPH_NP(AP,BP,AT,BT,NP,NT,Q,IPAR,SPAR,STAT)

USE MKL_DFTI

INTEGER NP, NT, STAT

INTEGER IPAR(*)

REAL AP,BP,AT,BT,Q

REAL SPAR(*)

END SUBROUTINE

SUBROUTINE S_COMMIT_SPH_NP(F,HANDLE,IPAR,SPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL SPAR(*)

REAL F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE

END SUBROUTINE

SUBROUTINE S_SPH_NP(F,HANDLE,IPAR,SPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

REAL SPAR(*)

REAL F(IPAR(11)+1,*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE

END SUBROUTINE

SUBROUTINE FREE_SPH_NP(HANDLE,IPAR,STAT)

USE MKL_DFTI

INTEGER STAT

INTEGER IPAR(*)

TYPE(DFTI_DESCRIPTOR), POINTER :: HANDLE

END SUBROUTINE

Fortran 90 specifics of the PL routines usage are similar for all Intel MKL PDE support tools and described in Calling PDE Support Routines from Fortran 90.

Parent topic: Poisson Library Routines