File: MatGetInfo.html

package info (click to toggle)
petsc 3.14.5%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 266,472 kB
  • sloc: ansic: 680,898; python: 33,303; cpp: 16,324; makefile: 14,022; f90: 13,731; javascript: 10,713; fortran: 9,581; sh: 1,373; xml: 619; objc: 445; csh: 192; pascal: 148; java: 13
file content (111 lines) | stat: -rw-r--r-- 7,642 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetInfo.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>MatGetInfo</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>petsc-3.14.5 2021-03-03</b></div>
   <div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.14.5 v3.14.5 docs/manualpages/Mat/MatGetInfo.html "><small>Report Typos and Errors</small></a></div>
<A NAME="MatGetInfo"><H1>MatGetInfo</H1></A>
Returns information about matrix storage (number of nonzeros, memory, etc.). 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscmat.h" 
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../Mat/MatGetInfo.html#MatGetInfo">MatGetInfo</A>(<A HREF="../Mat/Mat.html#Mat">Mat</A> mat,<A HREF="../Mat/MatInfoType.html#MatInfoType">MatInfoType</A> flag,<A HREF="../Mat/MatInfo.html#MatInfo">MatInfo</A> *info)
</PRE>
Collective on <A HREF="../Mat/Mat.html#Mat">Mat</A> if <A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_GLOBAL_MAX</A> or <A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_GLOBAL_SUM</A> is used as the flag
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>mat </B></TD><TD>- the matrix
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>flag </B></TD><TD>- flag indicating the type of parameters to be returned
(<A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_LOCAL</A> - local matrix, <A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_GLOBAL_MAX</A> - maximum over all processors,
<A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_GLOBAL_SUM</A> - sum over all processors)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>info </B></TD><TD>- matrix information context
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The <A HREF="../Mat/MatInfo.html#MatInfo">MatInfo</A> context contains a variety of matrix data, including
number of nonzeros allocated and used, number of mallocs during
matrix assembly, etc.  Additional information for factored matrices
is provided (such as the fill ratio, number of mallocs during
factorization, etc.).  Much of this info is printed to PETSC_STDOUT
when using the runtime options
<pre>
      -info -mat_view ::ascii_info
</pre>
<P>
<H3><FONT COLOR="#CC3333">Example for C/C++ Users</FONT></H3>
See the file ${PETSC_DIR}/include/petscmat.h for a complete list of
data within the <A HREF="../Mat/MatInfo.html#MatInfo">MatInfo</A> context.  For example,
<PRE>
      <A HREF="../Mat/MatInfo.html#MatInfo">MatInfo</A> info;
      <A HREF="../Mat/Mat.html#Mat">Mat</A>     A;
      double  mal, nz_a, nz_u;

      <A HREF="../Mat/MatGetInfo.html#MatGetInfo">MatGetInfo</A>(A,<A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_LOCAL</A>,&amp;info);
      mal  = info.mallocs;
      nz_a = info.nz_allocated;
</PRE>

<P>
<H3><FONT COLOR="#CC3333">Example for Fortran Users</FONT></H3>
Fortran users should declare info as a double precision
array of dimension MAT_INFO_SIZE, and then extract the parameters
of interest.  See the file ${PETSC_DIR}/include/petsc/finclude/petscmat.h
a complete list of parameter names.
<PRE>
      double  precision info(MAT_INFO_SIZE)
      double  precision mal, nz_a
      <A HREF="../Mat/Mat.html#Mat">Mat</A>     A
      integer ierr

      call <A HREF="../Mat/MatGetInfo.html#MatGetInfo">MatGetInfo</A>(A,<A HREF="../Mat/MatInfoType.html#MatInfoType">MAT_LOCAL</A>,info,ierr)
      mal = info(MAT_INFO_MALLOCS)
      nz_a = info(MAT_INFO_NZ_ALLOCATED)
</PRE>

<P>

<P>
Developer Note: fortran interface is not autogenerated as the f90
interface defintion cannot be generated correctly [due to <A HREF="../Mat/MatInfo.html#MatInfo">MatInfo</A>]
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../Mat/MatStashGetInfo.html#MatStashGetInfo">MatStashGetInfo</A>()
<BR>
<P>
<P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>intermediate<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/mat/interface/matrix.c.html#MatGetInfo">src/mat/interface/matrix.c</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/mat/tutorials/ex16.c.html">src/mat/tutorials/ex16.c.html</A><BR>
<P><H3><FONT COLOR="CC3333">Implementations</FONT></H3><A HREF="../../../src/mat/impls/aij/mpi/mkl_cpardiso/mkl_cpardiso.c.html#MatGetInfo_MKL_CPARDISO">MatGetInfo_MKL_CPARDISO in src/mat/impls/aij/mpi/mkl_cpardiso/mkl_cpardiso.c</A><BR>
<A HREF="../../../src/mat/impls/aij/mpi/mpiaij.c.html#MatGetInfo_MPIAIJ">MatGetInfo_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="../../../src/mat/impls/aij/mpi/mumps/mumps.c.html#MatGetInfo_MUMPS">MatGetInfo_MUMPS in src/mat/impls/aij/mpi/mumps/mumps.c</A><BR>
<A HREF="../../../src/mat/impls/aij/mpi/pastix/pastix.c.html#MatGetInfo_PaStiX">MatGetInfo_PaStiX in src/mat/impls/aij/mpi/pastix/pastix.c</A><BR>
<A HREF="../../../src/mat/impls/aij/seq/aij.c.html#MatGetInfo_SeqAIJ">MatGetInfo_SeqAIJ in src/mat/impls/aij/seq/aij.c</A><BR>
<A HREF="../../../src/mat/impls/aij/seq/mkl_pardiso/mkl_pardiso.c.html#MatGetInfo_MKL_PARDISO">MatGetInfo_MKL_PARDISO in src/mat/impls/aij/seq/mkl_pardiso/mkl_pardiso.c</A><BR>
<A HREF="../../../src/mat/impls/baij/mpi/mpibaij.c.html#MatGetInfo_MPIBAIJ">MatGetInfo_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c</A><BR>
<A HREF="../../../src/mat/impls/baij/seq/baij2.c.html#MatGetInfo_SeqBAIJ">MatGetInfo_SeqBAIJ in src/mat/impls/baij/seq/baij2.c</A><BR>
<A HREF="../../../src/mat/impls/cdiagonal/cdiagonal.c.html#MatGetInfo_ConstantDiagonal">MatGetInfo_ConstantDiagonal in src/mat/impls/cdiagonal/cdiagonal.c</A><BR>
<A HREF="../../../src/mat/impls/dense/mpi/mpidense.c.html#MatGetInfo_MPIDense">MatGetInfo_MPIDense in src/mat/impls/dense/mpi/mpidense.c</A><BR>
<A HREF="../../../src/mat/impls/dense/seq/dense.c.html#MatGetInfo_SeqDense">MatGetInfo_SeqDense in src/mat/impls/dense/seq/dense.c</A><BR>
<A HREF="../../../src/mat/impls/elemental/matelem.cxx.html#MatGetInfo_Elemental">MatGetInfo_Elemental in src/mat/impls/elemental/matelem.cxx</A><BR>
<A HREF="../../../src/mat/impls/is/matis.c.html#MatGetInfo_IS">MatGetInfo_IS in src/mat/impls/is/matis.c</A><BR>
<A HREF="../../../src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatGetInfo_MPISBAIJ">MatGetInfo_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c</A><BR>
<A HREF="../../../src/mat/impls/sbaij/seq/cholmod/sbaijcholmod.c.html#MatGetInfo_CHOLMOD">MatGetInfo_CHOLMOD in src/mat/impls/sbaij/seq/cholmod/sbaijcholmod.c</A><BR>
<A HREF="../../../src/mat/impls/sbaij/seq/sbaij2.c.html#MatGetInfo_SeqSBAIJ">MatGetInfo_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij2.c</A><BR>
<A HREF="../../../src/mat/impls/scalapack/matscalapack.c.html#MatGetInfo_ScaLAPACK">MatGetInfo_ScaLAPACK in src/mat/impls/scalapack/matscalapack.c</A><BR>
<A HREF="../../../src/mat/impls/sell/mpi/mpisell.c.html#MatGetInfo_MPISELL">MatGetInfo_MPISELL in src/mat/impls/sell/mpi/mpisell.c</A><BR>
<A HREF="../../../src/mat/impls/sell/seq/sell.c.html#MatGetInfo_SeqSELL">MatGetInfo_SeqSELL in src/mat/impls/sell/seq/sell.c</A><BR>
<BR><A HREF="./index.html">Index of all Mat routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>