[petsc-users] Missing Function MatSeqAIJGetArray_C

Zhang, Hong hzhang at mcs.anl.gov
Wed Mar 2 17:04:37 CST 2022


Ferrand,
We do not have support for PtAP with P in aij format and A in dense format yet.
MatProductReplaceMats() is used only when a new matrix has the SAME non-zero pattern as the one to be replace, which is not your case.

You may do:
B = A*P  (MatMatMult)
C = Pt*B (MatTransposeMatMult)
in which, you simply set P as aij format and A as dense. These option should work.

Let me know if this works or not. If it works, I can add this support to petsc.
Hong

________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Ferrand, Jesus A. <FERRANJ2 at my.erau.edu>
Sent: Wednesday, March 2, 2022 2:10 PM
To: petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: [petsc-users] Missing Function MatSeqAIJGetArray_C

Greetings:

I need to carry out a matrix product of the form P^tAP, where matrix P is always sparse, but matrix A can either be sparse or dense. To handle both cases, I define two (2) separate matrix products using the sequence.

MatProductCreate()
MatProductSetType()
MatProductSetAlgorithm()
MatProductSetFill()
MatProductSetFromOptions()
MatProductSymbolic()

And then when I need to carry out the multiplication I call.

MatProductReplaceMats()
MatProductNumeric()

When matrix A is sparse, the code runs flawlessly. When matrix A is dense, however, I get this error that says that there is a missing function "MatSeqAIJGetArray_C."
I have no clue as to why there could be a dependency on the type of my matrix A. I also tried MatPtAP() which essentially does the same as the "MatProduct" callouts I mentioned and the error is the same.

[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: No support for this operation for this object type
[0]PETSC ERROR: Cannot locate function MatSeqAIJGetArray_C in object
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.16.0, unknown
[0]PETSC ERROR: ./par on a linux-c-dbg named F86 by jesus Wed Mar  2 14:55:05 2022
[0]PETSC ERROR: Configure options --with-32bits-pci-domain=1 --with-debugging =1 --download-ptscotch --download-metis --download-parmetis --download-chaco --download-hdf5
[0]PETSC ERROR: #1 MatSeqAIJGetArray() at /home/jesus/SAND/PETSc_install/petsc/src/mat/impls/aij/seq/aij.c:4550
[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[1]PETSC ERROR: No support for this operation for this object type
[1]PETSC ERROR: Cannot locate function MatSeqAIJGetArray_C in object
[1]PETSC ERROR: [0]PETSC ERROR: #2 KAFormKE2D() at /home/jesus/SAND/FEA/3D/PARALLEL.c:1845
[0]PETSC ERROR: #3 MESHTraverseDepth() at /home/jesus/SAND/FEA/3D/PARALLEL.c:411
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[1]PETSC ERROR: Petsc Release Version 3.16.0, unknown
[1]PETSC ERROR: #4 KAFormK() at /home/jesus/SAND/FEA/3D/PARALLEL.c:1881
[0]PETSC ERROR: #5 main() at /home/jesus/SAND/FEA/3D/PARALLEL.c:2394
./par on a linux-c-dbg named F86 by jesus Wed Mar  2 14:55:05 2022
[1]PETSC ERROR: [0]PETSC ERROR: PETSc Option Table entries:
[0]PETSC ERROR: -benchmark_iter 2
Configure options --with-32bits-pci-domain=1 --with-debugging =1 --download-ptscotch --download-metis --download-parmetis --download-chaco --download-hdf5
[1]PETSC ERROR: #1 MatSeqAIJGetArray() at /home/jesus/SAND/PETSc_install/petsc/src/mat/impls/aij/seq/aij.c:4550
[0]PETSC ERROR: -mesh_filename L.msh
[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint at mcs.anl.gov----------
[1]PETSC ERROR: #2 KAFormKE2D() at /home/jesus/SAND/FEA/3D/PARALLEL.c:1845
[1]PETSC ERROR: #3 MESHTraverseDepth() at /home/jesus/SAND/FEA/3D/PARALLEL.c:411
application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
[1]PETSC ERROR: #4 KAFormK() at /home/jesus/SAND/FEA/3D/PARALLEL.c:1881
[1]PETSC ERROR: #5 main() at /home/jesus/SAND/FEA/3D/PARALLEL.c:2394
[1]PETSC ERROR: PETSc Option Table entries:
[1]PETSC ERROR: -benchmark_iter 2
[1]PETSC ERROR: -mesh_filename L.msh
[1]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint at mcs.anl.gov----------
application called MPI_Abort(MPI_COMM_WORLD, 56) - process 1



Sincerely:

J.A. Ferrand

Embry-Riddle Aeronautical University - Daytona Beach FL

M.Sc. Aerospace Engineering | May 2022

B.Sc. Aerospace Engineering

B.Sc. Computational Mathematics



Sigma Gamma Tau

Tau Beta Pi

Honors Program



Phone: (386)-843-1829

Email(s): ferranj2 at my.erau.edu

    jesus.ferrand at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220302/52a1de92/attachment-0001.html>


More information about the petsc-users mailing list