<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><br class=""></div>   We are having some major problems with your xml nested logging on a slightly more complicated example and I've been trying to debug it with no success. So I went back to my original commit bb1d7374b64f295b2ed5ff23b89435d65e905a54 and found something I was not expecting. When I run src/snes/examples/tutorials/ex19 with logging it generates the attached image. Which is wrong, note that SNESJacobianEvaluate, KSPSolve etc are embedded in the SNES solver but this is not properly displayed. Shouldn't they be in one level from the SNESSolve? Is this a bug, a feature? Or ...?<div class=""><br class=""></div><div class="">   Thanks for any information,</div><div class=""><br class=""></div><div class="">    Barry</div><div class=""><br class=""></div><div class="">The major problem we are seeing with the nested logging is in the branch mark/snes-ex56c when we run src/snes/examples/tutorials/ex56 with </div><div class=""><br class=""></div><div class="">petscmpiexec -n 1 ./ex56 -dm_refine 2 -ne 8 -alpha 1.e-3 -two_solves false  -petscspace_poly_tensor -petscspace_order 1 -ksp_type cg -ksp_monitor_short -ksp_rtol 1.e-8 -pc_type gamg -pc_gamg_type agg -pc_gamg_agg_nsmooths 1 -pc_gamg_coarse_eq_limit 100 -pc_gamg_reuse_interpolation true -pc_gamg_square_graph 1 -pc_gamg_threshold 0.0 -ksp_converged_reason -use_mat_nearnullspace true -mg_levels_ksp_max_it 2 -mg_levels_ksp_type chebyshev -mg_levels_esteig_ksp_type cg -mg_levels_esteig_ksp_max_it 10 -mg_levels_ksp_chebyshev_esteig 0,0.05,0,1.05 -mg_levels_pc_type sor -mat_block_size 3 -petscpartitioner_type chaco -log_view ascii:ex56-intel2016_knl_fast_64ranks_ne8_dmrefine3_log.xml:ascii_xml</div><div class=""><br class=""></div><div class="">it messes up the nesting and has total nonsense for the numerical values of time, for example in the different events, while the traditional -log_summary prints out reasonable results. It seems somehow either to be not gathering the data properly into the nested event data structures you have or not properly processing the data to generate the xml. I tried debugging but the logic is unclear to me.</div><div class=""><br class=""></div><div class="">Simple programs such as: </div><div class="">  ierr = PetscLogEventRegister("Event1",0,&event1);CHKERRQ(ierr);<br class=""><br class="">  ierr = PetscLogEventBegin(event1,0,0,0,0);CHKERRQ(ierr);<br class="">  ierr = PetscSleep(1.0);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventEnd(event1,0,0,0,0);CHKERRQ(ierr);</div><div class=""><br class=""></div><div class="">produce:</div><div class=""><br class=""></div><div class="">[0]PETSC ERROR: Petsc has generated inconsistent data<br class="">[0]PETSC ERROR: Depth 2 > maxdepth + 1 1<br class="">[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" class="">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Development GIT revision: v3.7.1-405-gbb23584  GIT Date: 2016-06-04 11:37:36 -0500<br class="">[0]PETSC ERROR: ./ex30 on a arch-xmllog named Barrys-MacBook-Pro.local by barrysmith Sat Jun  4 18:13:00 2016<br class="">[0]PETSC ERROR: Configure options --download-chaco --with-mpi-dir=/Users/barrysmith/libraries PETSC_ARCH=arch-xmllog<br class="">[0]PETSC ERROR: #1 PetscCreateLogTreeNested() line 719 in /Users/barrysmith/Src/petsc/src/sys/logging/xmllogevent.c</div><div class=""><br class=""></div><div class="">  ierr = PetscLogEventRegister("Event1",0,&event1);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventRegister("Event2",0,&event2);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventRegister("Event3",0,&event3);CHKERRQ(ierr);<br class=""><br class="">  ierr = PetscLogEventBegin(event1,0,0,0,0);CHKERRQ(ierr);<br class="">  ierr = PetscSleep(1.0);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventBegin(event2,0,0,0,0);CHKERRQ(ierr);<br class="">  ierr = PetscSleep(1.0);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventBegin(event3,0,0,0,0);CHKERRQ(ierr);<br class="">  ierr = PetscSleep(1.0);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventEnd(event3,0,0,0,0);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventEnd(event2,0,0,0,0);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventEnd(event1,0,0,0,0);CHKERRQ(ierr);</div><div class=""><br class=""></div><div class="">doesn't crash but doesn't nest event2 and 3 in one but does nest 3 into 2.</div><div class=""><br class=""></div><div class="">If seems that the ordering of the event values mater, if  I change the registration order to</div><div class=""><br class=""></div><div class="">  ierr = PetscLogEventRegister("Event2",0,&event2);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventRegister("Event1",0,&event1);CHKERRQ(ierr);<br class="">  ierr = PetscLogEventRegister("Event3",0,&event3);CHKERRQ(ierr);</div><div class=""><br class=""></div><div class="">then it crashes with </div><div class=""><br class=""></div><div class="">[0]PETSC ERROR: Petsc has generated inconsistent data<br class="">[0]PETSC ERROR: Depth 2 > maxdepth + 1 1<br class="">[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" class="">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Development GIT revision: v3.7.1-405-gbb23584  GIT Date: 2016-06-04 11:37:36 -0500<br class="">[0]PETSC ERROR: ./ex30 on a arch-xmllog named Barrys-MacBook-Pro.local by barrysmith Sat Jun  4 18:17:40 2016<br class="">[0]PETSC ERROR: Configure options --download-chaco --with-mpi-dir=/Users/barrysmith/libraries PETSC_ARCH=arch-xmllog<br class="">[0]PETSC ERROR: #1 PetscCreateLogTreeNested() line 719 in /Users/barrysmith/Src/petsc/src/sys/logging/xmllogevent.c<br class="">[0]PETSC ERROR: #2 PetscLogView_Nested() line 1399 in /Users/barrysmith/Src/petsc/src/sys/logging/xmllogevent.c</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Possibly related issue: If you run an example that has nothing that is actually logged but attempt to use the -log_view it crashes, there is some implicit assumption in your generation of the xml that some values will be non-empty.</div><div class=""><br class=""><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""><blockquote type="cite" class="">On Sep 18, 2<img apple-inline="yes" id="7161FB3B-B16D-4BEE-AA42-A31AA6E9B5D5" height="841" width="1392" apple-width="yes" apple-height="yes" src="cid:CE226316-0EF9-483A-903E-71754AA0F8B0@wowway.com" class="">015, at 10:09 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" class="">bsmith@mcs.anl.gov</a>> wrote:</blockquote><blockquote type="cite" class=""><br class=""><br class="">  Thank you for contributing the nested logging. I have incorporated into the PETSc branch barry/xml-nested-logging  if you look at  <a href="https://bitbucket.org/petsc/petsc/commits/bb1d7374b64f295b2ed5ff23b89435d65e905a54?at=master" class="">https://bitbucket.org/petsc/petsc/commits/bb1d7374b64f295b2ed5ff23b89435d65e905a54?at=master</a> you can see exactly what I have incorporated into PETSc.  I will merge it into next for portability testing in the next couple of days. I expect over time as I understand it better I will be able to improve its integration with PETSc.  Currently to generate the nested logging it is as simple to use as -log_view :filename.xml:ascii_xml<br class=""><br class=""> Thanks again,<br class=""><br class="">  Barry<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Sep 14, 2015, at 7:45 AM, Koos Huijssen <<a href="mailto:koos.huijssen@vortech.nl" class="">koos.huijssen@vortech.nl</a>> wrote:<br class=""><br class="">Dear PETSc development team,<br class=""><br class="">We have developed an extension of the PETSc event logging facilities that has the following advanced features:<br class=""><br class="">- It allows logging of events in the form of a nested tree. So if some function is called from multiple locations in the code, these instances are distinguished. This in contrast with the standard event logger, which only logs the amount of total call time.<br class="">- It allows the output report to be formatted in XML format. This output can then be viewed in a human-friendly form in a web browser<br class="">with the use of the XSL Transformation script performance_xml2html.xsl. The html features an nested timings tree that can be expanded and collapsed as desired.<br class=""><br class="">This tool has been very useful for us to analyze the code and pinpoint performance bottle necks. We think that it can be useful for others as well, and therefore we are providing the code here for integration in the open source distribution of PETSc.<br class=""><br class="">For more information I refer to the included manual. We have also provided a test program and a makefile for convenience. The test program can be run using MPI with for instance 3-6 processes.<br class=""><br class="">I apologize for not using the git repo to submit the developed code. I also apologize for not adhering to the PETSc coding standards (or at least not as far as I know), but I hope that it is not too far off.. Apart from the whole capital/underscore standardization stuff one issue may require special attention, namely the (ab)use of the format PETSc_VIEWER_ASCII_IMPL for signaling the XML format in XMLViewer.c. I couldn't find an already existing and better fitting format, but it could be necessary to add a new format here for this purpose.<br class=""><br class="">Can you take it up from here and realize the integration of the code in the PETSc distribution?<br class=""><br class="">With kind regards,<br class=""><br class="">Koos Huijssen<br class=""><br class="">-- <br class="">____________________________________________________________________<br class=""><br class="">VORtech BV - Scientific software engineers<br class="">____________________________________________________________________<br class=""><br class="">Dr.ir. Koos Huijssen<br class=""><br class="">P.O. Box 260<br class="">2600 AG Delft<br class="">The Netherlands<br class=""><br class="">phone  +31(0)15-285 0125<br class="">mobile +31(0)6-3333 0803<br class="">email <a href="mailto:koos.huijssen@vortech.nl" class="">koos.huijssen@vortech.nl</a><br class="">web   <a href="http://www.vortech.nl" class="">www.vortech.nl</a><br class="">____________________________________________________________________<br class=""><br class=""><timers.tar.gz><br class=""></blockquote><br class=""></blockquote><br class=""></div></div></div></div></body></html>