[petsc-users] profiling the total time

khalid ashraf khalid_eee at yahoo.com
Tue Jun 21 00:34:47 CDT 2011

Hi Jed,
In order to find where the extra time is consumed, I started from 
ksp/ksp/example/tutorials/ex22.c and changed it one line at a time. I found that 
the time is consumed in the call:  

 ierr = 
The same with the 
 ierr = 

(total time=1e1) (here row is same as col)

Now since 
 ierr = 
is very fast (total time=1e-2) (here row=(i,j,k))

I tried to call it 7 times 
          ierr = 

is again slow (total time=1e1) 

  This is because I expected the computation time to be 7*1e-2 by this 
repetitive call. However, I find that the execution time is ~1e-2 only for l=3. 
For any other value of l, it is ~1e0. I can see that the only speciality of l=3 
is that it corresponds to row=(i,j,k). Any other combination like (i+1,j,k) 
causes the call to

to be slower by 2 orders of magnitude. Could you please suggest why the 
performance goes down so drastically. 

The difference in performance becomes visible when the matrix size gets closer 
to 3000X3000 and becomes worse very fast. 

I want to assemble a matrix for FEM application. I started from the example 
This example shows the similar problem stated above when m>=120. 

Please let me know what could be done for any/both of the above two problems. 

Best regards.


On Thu, Jun 16, 2011 at 11:14, khalid ashraf <khalid_eee at yahoo.com> wrote:

> When I look at the breakdown of the stages time required, the total add up
> to ~7s however, the main stage time is ~350s.

Two possibilities:

1. The time is not in PETSc.

2. The matrix is not preallocated correctly.

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110620/fe94c79e/attachment.htm>

More information about the petsc-users mailing list