Matrix creation/destruction

Barry Smith bsmith at mcs.anl.gov
Tue Aug 25 16:44:09 CDT 2009


    Sequential scatters and purely local parallel scatters don't have  
an end that is logged because the begin does everything. They return  
immediately without
logging the end, hence the confusion.

    Barry

On Aug 25, 2009, at 4:33 PM, John Fettig wrote:

> Another similar question.  Running src/snes/examples/tutorials/ex1  
> on 2 processors with -log_summary shows
>
> VecScatterBegin       91 1.0 1.2181e-03 1.3 0.00e+00 0.0 3.8e+01 8.0e 
> +00 0.0e+00  4  0 49 40  0   4  0 49 40  0     0
> VecScatterEnd         19 1.0 3.5119e-04 3.5 0.00e+00 0.0 0.0e+00 0.0e 
> +00 0.0e+00  1  0  0  0  0   1  0  0  0  0     0
>
> There are 91 Begins but only 19 Ends.  The calls are matched in the  
> driver, so why aren't they matched when it runs?
>
> John
>
> On Tue, Aug 25, 2009 at 1:42 PM, John Fettig <john.fettig at gmail.com>  
> wrote:
> Barry,
>
> Thanks for the quick reply, that definitely clears it up.
>
> John
>
>
> On Tue, Aug 25, 2009 at 1:38 PM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>
>   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