<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Kun,<br>
<br>
I'm the author of most of the AIJMKL stuff in PETSc. My apologies for having inadvertently omitted these function prototypes for these interfaces; I'm glad that Satish's patch has fixed this.<br>
<br>
I want to point out that -- though I can envision some scenarios in which one would want to use the MatCreateXXXAIJMKL interfaces -- most of the time I would recommend against using these directly. Instead, I would recommend simply creating AIJ matrices and
 then setting them to the AIJMKL sub-types via the PETSc options database. (Via the command line, this could be done by specifying something like "-mat_seqaij_type seqaijmkl" to indicate that all of the "sequential" AIJ matrices that make up an "MPI" AIJ matrix
 should be of type SEQAIJMKL.) Because this is how I usually do things, my testing had not uncovered the missing function prototypes.<br>
<br>
Best regards,<br>
Richard<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 3/26/19 2:37 PM, Kun Jiao via petsc-users wrote:<br>
</div>
<blockquote type="cite" cite="mid:AM0PR0402MB3524AB4EFB2DC6BEF82A2A70AE5F0@AM0PR0402MB3524.eurprd04.prod.outlook.com">
<pre class="moz-quote-pre" wrap="">And yes, by applying the patch in the petscmat.h, everything works.
Thanks for the help.

Regards,
Kun



Schlumberger-Private

-----Original Message-----
From: Balay, Satish <a class="moz-txt-link-rfc2396E" href="mailto:balay@mcs.anl.gov"><balay@mcs.anl.gov></a> 
Sent: Tuesday, March 26, 2019 3:42 PM
To: Kun Jiao <a class="moz-txt-link-rfc2396E" href="mailto:KJiao@slb.com"><KJiao@slb.com></a>
Cc: petsc-users <a class="moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov"><petsc-users@mcs.anl.gov></a>
Subject: Re: [petsc-users] [Ext] Re: error: identifier "MatCreateMPIAIJMKL" is undefined in 3.10.4

Please apply the patch I sent earlier and retry.

Satish

On Tue, 26 Mar 2019, Kun Jiao via petsc-users wrote:

</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Strange things, when I compile my code in the test dir in PETSC, it works. After I "make install" PETSC, and try to compile my code against the installed PETSC, it doesn't work any more.

I guess this is what you means. 

Is there any way to reenable MatCreateMPIAIJMKL public interface?

And, I am using intel MKL, here is my configure option:

Configure Options: --configModules=PETSc.Configure 
--optionsModule=config.compilerOptions PETSC_ARCH=linux-gnu-intel 
--with-precision=single --with-cc=mpiicc --with-cxx=mpiicc 
--with-fc=mpiifort 
--with-mpi-include=/wgdisk/hy3300/source_code_dev/imaging/kjiao/softwa
re/intel/compilers_and_libraries_2019.2.187/linux/mpi/intel64/include 
--with-mpi-lib="-L/wgdisk/hy3300/source_code_dev/imaging/kjiao/softwar
e/intel//compilers_and_libraries_2019.2.187/linux/mpi/intel64/lib 
-lmpifort -lmpi_ilp64" 
--with-blaslapack-lib="-L/wgdisk/hy3300/source_code_dev/imaging/kjiao/
software/intel/compilers_and_libraries_2019.2.187/linux/mkl/lib/intel6
4 -Wl, --no-as-needed -lmkl_intel_lp64 -lmkl_sequential -lmkl_core 
-lpthread -lm -ldl" 
--with-scalapack-lib="-L/wgdisk/hy3300/source_code_dev/imaging/kjiao/s
oftware/intel/compilers_and_libraries_2019.2.187/linux/mkl/lib/intel64 
-lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64" 
--with-scalapack-include=/wgdisk/hy3300/source_code_dev/imaging/kjiao/
software/intel/compilers_and_libraries_2019.2.187/linux/mkl/include 
--with-mkl_pardiso-dir=/wgdisk/hy3300/source_code_dev/imaging/kjiao/so
ftware/intel/compilers_and_libraries_2019.2.187/linux/mkl 
--with-mkl_sparse=1 
--with-mkl_sparse-dir=/wgdisk/hy3300/source_code_dev/imaging/kjiao/sof
tware/intel/compilers_and_libraries_2019.2.187/linux/mkl 
--with-mkl_cpardiso=1 
--with-mkl_cpardiso-dir=/wgdisk/hy3300/source_code_dev/imaging/kjiao/s
oftware/intel/compilers_and_libraries_2019.2.187/linux/mkl 
--with-mkl_sparse_optimize=1 
--with-mkl_sparse_optimize-dir=/wgdisk/hy3300/source_code_dev/imaging/
kjiao/software/intel/compilers_and_libraries_2019.2.187/linux/mkl 
--with-mkl_sparse_sp2m=1 
--with-mkl_sparse_sp2m-dir=/wgdisk/hy3300/source_code_dev/imaging/kjia
o/software/intel/compilers_and_libraries_2019.2.187/linux/mkl 
--with-cmake=1 
--prefix=/wgdisk/hy3300/source_code_dev/imaging/kjiao/software/petsc_3
.9.4 --known-endian=big --with-debugging=0 --COPTFLAGS=" -Ofast 
-xHost" --CXXOPTFLAGS=" -Ofast -xHost" --FOPTFLAGS=" -Ofast -xHost" 
--with-x=0 Working directory: 
/wgdisk/hy3300/source_code_dev/imaging/kjiao/petsc-3.10.4



Schlumberger-Private

-----Original Message-----
From: Balay, Satish <a class="moz-txt-link-rfc2396E" href="mailto:balay@mcs.anl.gov"><balay@mcs.anl.gov></a>
Sent: Tuesday, March 26, 2019 10:19 AM
To: Kun Jiao <a class="moz-txt-link-rfc2396E" href="mailto:KJiao@slb.com"><KJiao@slb.com></a>
Cc: Mark Adams <a class="moz-txt-link-rfc2396E" href="mailto:mfadams@lbl.gov"><mfadams@lbl.gov></a>; <a class="moz-txt-link-abbreviated" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>
Subject: Re: [petsc-users] [Ext] Re: error: identifier 
"MatCreateMPIAIJMKL" is undefined in 3.10.4

</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">balay@sb /home/balay/petsc (maint=)
$ git grep MatCreateMPIAIJMKL maint-3.8
maint-3.8:src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c:   MatCreateMPIAIJMKL - Creates a sparse parallel matrix whose local
maint-3.8:src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c:PetscErrorCode  
MatCreateMPIAIJMKL(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt 
M,PetscInt N,PetscInt d_nz,const PetscInt d_nnz[],PetscInt o_nz,const 
PetscInt o_nnz[],Mat *A)
maint-3.8:src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c:.seealso: 
MatCreateMPIAIJMKL(), MATSEQAIJMKL, MATMPIAIJMKL
maint-3.8:src/mat/impls/aij/seq/aijmkl/aijmkl.c:.seealso: MatCreate(), MatCreateMPIAIJMKL(), MatSetValues() balay@sb /home/balay/petsc (maint=) $ git grep MatCreateMPIAIJMKL maint
maint:src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c:   MatCreateMPIAIJMKL - Creates a sparse parallel matrix whose local
maint:src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c:PetscErrorCode  
MatCreateMPIAIJMKL(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt 
M,PetscInt N,PetscInt d_nz,const PetscInt d_nnz[],PetscInt o_nz,const 
PetscInt o_nnz[],Mat *A)
maint:src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c:.seealso: 
MatCreateMPIAIJMKL(), MATSEQAIJMKL, MATMPIAIJMKL
maint:src/mat/impls/aij/seq/aijmkl/aijmkl.c:.seealso: MatCreate(), 
MatCreateMPIAIJMKL(), MatSetValues() balay@sb /home/balay/petsc 
(maint=) $ <<<<<<<<<<<

MatCreateMPIAIJMKL() exists in both petsc-3.8 and petsc-3.10. However 
the public interface is missing from both of these versions. So I'm 
surprised you don't get the same error with petsc-3.8

Can you try the following change?

diff --git a/include/petscmat.h b/include/petscmat.h index 
1b8ac69377..c66f727994 100644
--- a/include/petscmat.h
+++ b/include/petscmat.h
@@ -223,7 +223,8 @@ typedef enum 
{DIFFERENT_NONZERO_PATTERN,SUBSET_NONZERO_PATTERN,SAME_NONZERO_PATT
 
 #if defined PETSC_HAVE_MKL_SPARSE
 PETSC_EXTERN PetscErrorCode 
MatCreateBAIJMKL(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt
,PetscInt,const PetscInt[],PetscInt,const PetscInt[],Mat*); 
-PETSC_EXTERN PetscErrorCode MatCreateSeqBAIJMKL(MPI_Comm 
comm,PetscInt bs,PetscInt m,PetscInt n,PetscInt nz,const PetscInt 
nnz[],Mat *A);
+PETSC_EXTERN PetscErrorCode
+MatCreateSeqBAIJMKL(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,cons
+t PetscInt[],Mat*); PETSC_EXTERN PetscErrorCode 
+MatCreateMPIAIJMKL(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,Petsc
+In t,const PetscInt[],PetscInt,const PetscInt[],Mat*);
 #endif
 
 PETSC_EXTERN PetscErrorCode 
MatCreateSeqSELL(MPI_Comm,PetscInt,PetscInt,PetscInt,const 
PetscInt[],Mat*);


Also note: - this routine is available only when PETSc is built with 
Intel MKL

Satish

On Tue, 26 Mar 2019, Kun Jiao via petsc-users wrote:

</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">[kjiao@hyi0016 src/lsqr]% make
[ 50%] Building CXX object lsqr/CMakeFiles/p_lsqr.dir/lsqr.cc.o
/wgdisk/hy3300/source_code_dev/imaging/kjiao/src/git/src/lsqr/lsqr.cc(318): error: identifier "MatCreateMPIAIJMKL" is undefined
    ierr = MatCreateMPIAIJMKL(comm,m,n,M,N,maxnz,dialens,maxnz,offlens,&A);CHKERRQ(ierr);
           ^

/wgdisk/hy3300/source_code_dev/imaging/kjiao/src/git/src/lsqr/lsqr.cc(578): error: identifier "MatCreateMPIAIJMKL" is undefined
    ierr = MatCreateMPIAIJMKL(comm,m,n,M,N,maxnz,dialens,maxnz,offlens,&A);CHKERRQ(ierr);
           ^

compilation aborted for
/wgdisk/hy3300/source_code_dev/imaging/kjiao/src/git/src/lsqr/lsqr.c
c
(code 2)

Thanks.


From: Mark Adams <a class="moz-txt-link-rfc2396E" href="mailto:mfadams@lbl.gov"><mfadams@lbl.gov></a>
Sent: Tuesday, March 26, 2019 9:22 AM
To: Kun Jiao <a class="moz-txt-link-rfc2396E" href="mailto:KJiao@slb.com"><KJiao@slb.com></a>
Cc: <a class="moz-txt-link-abbreviated" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>
Subject: Re: [Ext] Re: [petsc-users] error: identifier 
"MatCreateMPIAIJMKL" is undefined in 3.10.4

I assume the whole error message will have the line of code. Please send the whole error message and line of offending code if not included.

On Tue, Mar 26, 2019 at 10:08 AM Kun Jiao <<a class="moz-txt-link-abbreviated" href="mailto:KJiao@slb.com">KJiao@slb.com</a><a class="moz-txt-link-rfc2396E" href="mailto:KJiao@slb.com"><mailto:KJiao@slb.com></a>> wrote:
It is compiling error, error message is:

error: identifier "MatCreateMPIAIJMKL" is undefined.





From: Mark Adams <<a class="moz-txt-link-abbreviated" href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a><a class="moz-txt-link-rfc2396E" href="mailto:mfadams@lbl.gov"><mailto:mfadams@lbl.gov></a>>
Sent: Tuesday, March 26, 2019 6:48 AM
To: Kun Jiao <<a class="moz-txt-link-abbreviated" href="mailto:KJiao@slb.com">KJiao@slb.com</a><a class="moz-txt-link-rfc2396E" href="mailto:KJiao@slb.com"><mailto:KJiao@slb.com></a>>
Cc: <a class="moz-txt-link-abbreviated" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><a class="moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov"><mailto:petsc-users@mcs.anl.gov></a>
Subject: [Ext] Re: [petsc-users] error: identifier 
"MatCreateMPIAIJMKL" is undefined in 3.10.4

Please send the output of the error (runtime, compile time, link
time?)

On Mon, Mar 25, 2019 at 10:50 PM Kun Jiao via petsc-users <<a class="moz-txt-link-abbreviated" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><a class="moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov"><mailto:petsc-users@mcs.anl.gov></a>> wrote:
Hi Petsc Experts,

Is MatCreateMPIAIJMKL retired in 3.10.4?

I got this error with my code which works fine in 3.8.3 version.

Regards,
Kun



Schlumberger-Private


Schlumberger-Private


Schlumberger-Private

</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</blockquote>
<br>
</body>
</html>