Matrix creation/destruction

Barry Smith bsmith at mcs.anl.gov
Tue Aug 25 13:38:46 CDT 2009


    The ILU factorization requires a matrix that is created inside the  
KSP operations. Plus it counts sequential matrices that are contained  
inside the parallel matrices so the matrix numbers will often be hard  
to understand.

    The VecScatter is created in the MatAssembly and used in the  
matrix vector products and then destroyed when the matrix is destroy  
that is why its creation and destruction are in different states.

    The index sets in the assembly are used to create the vecscatter.  
The index sets in the main stage a probably related to the  
preconditioner building.

   Barry

On Aug 25, 2009, at 1:25 PM, John Fettig wrote:

> I'm trying to understand where matrices get created and destroyed,  
> because I have a mismatch in the -log_summary of my code but I can't  
> figure out where.  Running ksp/ksp/examples/tutorials/ex2 with 4  
> processors, the log summary looks like:
>
>
>
> Object Type          Creations   Destructions   Memory  Descendants'  
> Mem.
>
> --- Event Stage 0: Main Stage
>
>               Matrix     4              4      11408     0
>                  Vec    20             21      29264     0
>          Vec Scatter     0              1        868     0
>            Index Set     3              3       1704     0
>        Krylov Solver     2              2      18880     0
>       Preconditioner     2              2       1408     0
>
> --- Event Stage 1: Assembly
>
>                  Vec     2              1       1304     0
>          Vec Scatter     1              0          0     0
>            Index Set     2              2       1052     0
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>
>
> Why are there 4 matrices created/destroyed?  Where does this  
> happen?  I only see one matrix being created/destroyed in the  
> source, so it must be happening someplace in the KSP/PC.  Also,  
> there is a mismatch in the Vec and Vec Scatter counts in each of the  
> stages, even though it would seem that (e.g.) all the Vec Scatters  
> should be contained to the assembly stage.
>
> John
>



More information about the petsc-users mailing list