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
|
<!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.4.2 2013-07-02</b></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"
PetscErrorCode MatGetInfo(Mat mat,MatInfoType flag,MatInfo *info)
</PRE>
Collective on <A HREF="../Mat/Mat.html#Mat">Mat</A> if MAT_GLOBAL_MAX or MAT_GLOBAL_SUM is used as the flag
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<DT><B>mat </B> -the matrix
<br>
<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
(MAT_LOCAL - local matrix, MAT_GLOBAL_MAX - maximum over all processors,
MAT_GLOBAL_SUM - 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,MAT_LOCAL,&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/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,MAT_LOCAL,info,ierr)
mal = info(MAT_INFO_MALLOCS)
nz_a = info(MAT_INFO_NZ_ALLOCATED)
</PRE>
<P>
<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><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/mat/interface/matrix.c.html#MatGetInfo">src/mat/interface/matrix.c</A>
<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>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/mat/examples/tutorials/ex16.c.html">src/mat/examples/tutorials/ex16.c.html</A><BR>
</BODY></HTML>
|