[petsc-users] no profile printed by "PetscLogPrintSummary"

Debao Shao Debao.Shao at brion.com
Tue Nov 1 22:28:49 CDT 2011


Thanks Barry for the suggestion.

I reviewed code before, which show "-log_summary" option will trigger
1, "PetscLogBegin" in "PetscSetHelpVersionFunctions";
2, "PetscLogPrintSummary(PETSC_COMM_WORLD,0)" in "PetscFinalize".

So, I tried the following code:
    PetscInitialize(0, 0, 0, 0);
    PetscLogBegin();
    ...
    PetscLogPrintSummary(PETSC_COMM_WORLD, 0);
    PetscFinalize();

But, don't get the log summary, then I asked the question to see if I missed something.

Thanks,
Debao
-----Original Message-----
From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Barry Smith
Sent: Wednesday, November 02, 2011 11:09 AM
To: PETSc users list
Subject: Re: [petsc-users] no profile printed by "PetscLogPrintSummary"


On Nov 1, 2011, at 10:00 PM, Debao Shao wrote:

> Hi, Matt:
>
> My petsc version is 3.1-p8, I can't find "PetscLogView", is it similar behavior as "PetscLogDump"?

1) switch to petsc 3.2

2) be proactive. It may seem easier to send email with a question but in fact that takes time for people to respond and figure out what you are asking. Looking at the code will be faster.  See the instructions for searching through source code in
the users manual http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manual.pdf page 174 Then you can search the PETSc source for -log_summary and track what function it actually calls to print the summary information. The answer of "how" is always in the PETSc source code. (Sometimes "why" we did something a particular way cannot be found in the source).

>
> Thanks,
> Debao
>
> From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley
> Sent: Wednesday, November 02, 2011 10:51 AM
> To: PETSc users list
> Subject: Re: [petsc-users] no profile printed by "PetscLogPrintSummary"
>
> On Wed, Nov 2, 2011 at 2:30 AM, Debao Shao <Debao.Shao at brion.com> wrote:
> Hi, Matt:
>
> 1, I tried both "PetscLogAllBegin()" & "PetscLogBegin()", but both of them don't print log summary.

   These don't print the summary, they tell PETSc to start logging it.

Barry

> 2, I disabled MPI(--with-mpi=0), will MPI_COMM_SELF have difference to PETSC_COMM_WORLD?
>
> Works for me:
>
> #include <petscsys.h>
>
> #undef __FUNCT__
> #define __FUNCT__ "main"
> int main(int argc, char **argv)
> {
>   PetscErrorCode ierr;
>
>   ierr = PetscInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL);CHKERRQ(ierr);
>   ierr = PetscLogBegin();CHKERRQ(ierr);
>   ierr = PetscLogView(PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
>   ierr = PetscFinalize();
>   return 0;
> }
>
> which gives
>
> Executing: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpiexec -n 1 /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib/tester-obj/tester
> sh: ************************************************************************************************************************
> ***             WIDEN YOUR WINDOW TO 120 CHARACTERS.  Use 'enscript -r -fCourier9' to print this document            ***
> ************************************************************************************************************************
> ---------------------------------------------- PETSc Performance Summary: ----------------------------------------------
> /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib/tester-obj/tester on a arch-siev named MATTHEW-KNEPLEYs-MacBook-Air-2.local with 1 processor, by knepley Tue Nov  1 21:50:08 2011
> Using Petsc Development HG revision: 56a54b25d97df6f01a55abded4076de34409738b  HG Date: Tue Nov 01 17:11:12 2011 -0500
>                          Max       Max/Min        Avg      Total
> Time (sec):           5.988e-03      1.00000   5.988e-03
> Objects:              1.000e+00      1.00000   1.000e+00
> Flops:                0.000e+00      0.00000   0.000e+00  0.000e+00
> Flops/sec:            0.000e+00      0.00000   0.000e+00  0.000e+00
> Memory:               8.486e+04      1.00000              8.486e+04
> MPI Messages:         0.000e+00      0.00000   0.000e+00  0.000e+00
> MPI Message Lengths:  0.000e+00      0.00000   0.000e+00  0.000e+00
> MPI Reductions:       1.000e+00      1.00000
> Flop counting convention: 1 flop = 1 real number operation of type (multiply/divide/add/subtract)
>                             e.g., VecAXPY() for real vectors of length N --> 2N flops
>                             and VecAXPY() for complex vectors of length N --> 8N flops
> Summary of Stages:   ----- Time ------  ----- Flops -----  --- Messages ---  -- Message Lengths --  -- Reductions --
>                         Avg     %Total     Avg     %Total   counts   %Total     Avg         %Total   counts   %Total
>  0:      Main Stage: 5.9600e-03  99.5%  0.0000e+00   0.0%  0.000e+00   0.0%  0.000e+00        0.0%  0.000e+00   0.0%
> ------------------------------------------------------------------------------------------------------------------------
> See the 'Profiling' chapter of the users' manual for details on interpreting output.
> Phase summary info:
>    Count: number of times phase was executed
>    Time and Flops: Max - maximum over all processors
>                    Ratio - ratio of maximum to minimum over all processors
>    Mess: number of messages sent
>    Avg. len: average message length
>    Reduct: number of global reductions
>    Global: entire computation
>    Stage: stages of a computation. Set stages with PetscLogStagePush() and PetscLogStagePop().
>       %T - percent time in this phase         %f - percent flops in this phase
>       %M - percent messages in this phase     %L - percent message lengths in this phase
>       %R - percent reductions in this phase
>    Total Mflop/s: 10e-6 * (sum of flops over all processors)/(max time over all processors)
> ------------------------------------------------------------------------------------------------------------------------
>       ##########################################################
>       #                                                        #
>       #                          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.              #
>       #                                                        #
>       ##########################################################
> Event                Count      Time (sec)     Flops                             --- Global ---  --- Stage ---   Total
>                    Max Ratio  Max     Ratio   Max  Ratio  Mess   Avg len Reduct  %T %f %M %L %R  %T %f %M %L %R Mflop/s
> ------------------------------------------------------------------------------------------------------------------------
> --- Event Stage 0: Main Stage
> ------------------------------------------------------------------------------------------------------------------------
> Memory usage is given in bytes:
> Object Type          Creations   Destructions     Memory  Descendants' Mem.
> Reports information only for process 0.
> --- Event Stage 0: Main Stage
>               Viewer     1              0            0     0
> ========================================================================================================================
> Average time to get PetscTime(): 4.05312e-07
> #No PETSc Option Table entries
> Compiled without FORTRAN kernels
> Compiled with full precision matrices (default)
> sizeof(short) 2 sizeof(int) 4 sizeof(long) 8 sizeof(void*) 8 sizeof(PetscScalar) 8
> Configure run at: Tue Nov  1 18:04:19 2011
> Configure options: --PETSC_ARCH=arch-sieve-fdatatypes-debug --download-boost --download-chaco --download-fiat --download-hdf5 --download-ml --download-mpich --download-netcdf --download-parmetis --download-scientificpython --download-tetgen --download-triangle --with-clanguage=C++ --with-dynamic-loading --with-exodusii-dir=/PETSc3/petsc/exodusii-4.98 --with-fc="gfortran -cpp" --with-fortran-datatypes --with-shared-libraries --with-sieve --with-sieve-memory-logging
> -----------------------------------------
> Libraries compiled on Tue Nov  1 18:04:19 2011 on MATTHEW-KNEPLEYs-MacBook-Air-2.local
> Machine characteristics: Darwin-10.8.0-i386-64bit
> Using PETSc directory: /PETSc3/petsc/petsc-dev-pylith
> Using PETSc arch: arch-sieve-fdatatypes-debug
> -----------------------------------------
> Using C compiler: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpicxx   -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g  -PIC   ${COPTFLAGS} ${CFLAGS}
> Using Fortran compiler: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpif90  -fPIC  -Wall -Wno-unused-variable -Wno-unused-dummy-argument -g  ${FOPTFLAGS} ${FFLAGS}
> -----------------------------------------
> Using include paths: -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include -I/PETSc3/petsc/petsc-dev-pylith/include -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include/sieve -I/PETSc3/petsc/exodusii-4.98/include -I/PETSc3/petsc/exodusii-4.98/cbind/include -I/PETSc3/petsc/exodusii-4.98/forbind/include
> -----------------------------------------
> Using C linker: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpicxx
> Using Fortran linker: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpif90
> Using libraries: -L/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib -L/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib -lpetsc -L/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib -ltriangle -L/usr/X11R6/lib -lX11 -lchaco -lml -lparmetis -lmetis -lpthread -ltet -llapack -lblas -L/PETSc3/petsc/exodusii-4.98/. -lexoIIv2for -lexodus -lnetcdf_c++ -lnetcdf -lhdf5_fortran -lhdf5 -lz -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -ldl -lpmpich -lmpich -lopa -lmpl -lpthread -lSystem -lmpichf90 -lgfortran -L/usr/local/lib/gcc/x86_64-apple-darwin10.4.0/4.6.0 -L/usr/local/lib -lgfortran -lgcc_ext.10.5 -lmpichcxx -lstdc++ -lmpichcxx -lstdc++ -ldl -lpmpich -lmpich -lopa -lmpl -lpthread -lSystem -ldl
> -----------------------------------------
>
>    Matt
>
>
> Thanks,
> Debao
> From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley
> Sent: Tuesday, November 01, 2011 7:03 PM
> To: PETSc users list
> Subject: Re: [petsc-users] no profile printed by "PetscLogPrintSummary"
>
> On Tue, Nov 1, 2011 at 9:31 AM, Debao Shao <Debao.Shao at brion.com> wrote:
> DA,
>
> I intend to use "PetscLogPrintSummary" to dump log summary, but don't get it.
> The usage is:
>     PetscInitialize(0, 0, 0, 0);
>     PetscLogAllBegin();
>     ...
>     PetscLogPrintSummary(MPI_COMM_SELF, PETSC_NULL);
> PetscFinalize();
>
> You only need PetscLogBegin(), and you should use PETSC_COMM_WORLD.
>
>    Matt
>
>
> My libpetsc.a is built by
> 1, ./config/configure.py --with-mpi=0 --with-debugging=1 -with-log=1 -with-info=1 --with-x=0;
> 2, make all
>
> Thanks,
> Debao
>
> -- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.
>
>
>
> --
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
>
> -- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.
>
>
>
> --
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
>
> -- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.


-- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.


More information about the petsc-users mailing list