[petsc-users] EPSSolve in a loop

Jed Brown jedbrown at mcs.anl.gov
Sat May 4 09:54:57 CDT 2013


Dharmendar Reddy <dharmareddy84 at gmail.com> writes:

>>    You are right, The time per solve increases in both case, see the
> attached plot.
>
>   I have attached the stage wise log_summary .

Thanks.

      ##########################################################
      #                                                        #
      #                          WARNING!!!                    #
      #                                                        #
      #   This code was compiled with a debugging option,      #
      #   To get timing results run ./configure                #
      #   using --with-debugging=no, the performance will      #
      #   be generally two or three times faster.              #
      #                                                        #
      ##########################################################


Here are some relevant events:


--- Event Stage 1: Solve Step : 1

IPOrthogonalize       90 1.0 7.7698e-02 1.0 3.04e+06 1.0 0.0e+00 0.0e+00 5.4e+02  0  1  0  0  0  18 67  0  0 32    39
IPInnerProduct       896 1.0 5.1215e-02 1.0 1.60e+06 1.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0  12 35  0  0  0    31
VecMAXPBY            179 1.0 2.0418e-02 1.0 1.44e+06 1.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   5 32  0  0  0    71
VecScale              89 1.0 9.6772e-03 1.0 7.92e+03 1.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   2  0  0  0  0     1
VecReduceArith       448 1.0 3.6906e-02 1.0 1.48e+06 1.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   9 32  0  0  0    40


--- Event Stage 111: Solve Step : 111

IPOrthogonalize       90 1.0 1.5872e+01 1.0 3.04e+06 1.0 0.0e+00 0.0e+00 5.4e+02  1  1  0  0  0  83 67  0  0 32     0
IPInnerProduct       896 1.0 9.5349e+00 1.0 1.60e+06 1.0 0.0e+00 0.0e+00 0.0e+00  1  0  0  0  0  50 35  0  0  0     0
VecMAXPBY            179 1.0 6.3249e+00 1.0 1.44e+06 1.0 0.0e+00 0.0e+00 0.0e+00  1  0  0  0  0  33 32  0  0  0     0
VecScale              89 1.0 3.1402e+00 1.0 7.92e+03 1.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0  16  0  0  0  0     0
VecReduceArith       448 1.0 9.5169e+00 1.0 1.48e+06 1.0 0.0e+00 0.0e+00 0.0e+00  1  0  0  0  0  49 32  0  0  0     0


VecScale is simple and does exactly the same amount of work in both
cases, so I think the problem is in memory management.  It doesn't look
like you are using enough memory to be swapping and I don't think there
are any CHKMEMQ statements in here.  You could try running with '-malloc
0', and/or in optimized mode.

It looks like you create one EPS per loop iteration, but don't destroy
any of them until the end.  If you don't need all the EPS at once, you
should either reuse one throughout the loop or destroy the new one each
step after using it.


More information about the petsc-users mailing list