[petsc-users] Performance problem about output mesh in vtk format

Gong Yujie yc17470 at connect.um.edu.mo
Sun Nov 5 20:54:30 CST 2023


Dear PETSc developers,

I'm trying to output a result data in vtk format and find that it is quite slow. Then I try to check this issue by a simple test code:

      PetscCall(PetscInitialize(&argc,&argv,(char*)0,NULL));
      DM                      dm,dmParallel,dmAux;
      PetscBool         interpolate=PETSC_TRUE;
      PetscCall(DMPlexCreateExodusFromFile(PETSC_COMM_WORLD,"artery_plaque.exo",interpolate,&dm));
      PetscCall(DMViewFromOptions(dm,NULL,"-dm_view"));
      PetscCall(PetscFinalize());
and run with ./dm_test -dm_view vtk:./ksp_data/abc.vtk -log_view

It took about 600s to output the mesh. I'm not sure if there is something wrong in my code or my configuration of PETSc. Could you please give me some advice on this?

Best Regards,
Yujie

P.S. The result for log_view
****************************************************************************************************************************************************************
***                                WIDEN YOUR WINDOW TO 160 CHARACTERS.  Use 'enscript -r -fCourier9' to print this document                                 ***
****************************************************************************************************************************************************************

------------------------------------------------------------------ PETSc Performance Summary: ------------------------------------------------------------------

./dm_test on a arch-linux-c-opt named DESKTOP-0H8HCOD with 1 processor, by qingfeng Mon Nov  6 10:43:31 2023
Using Petsc Release Version 3.19.5, unknown

                         Max       Max/Min     Avg       Total
Time (sec):           6.286e+02     1.000   6.286e+02
Objects:              1.400e+02     1.000   1.400e+02
Flops:                0.000e+00     0.000   0.000e+00  0.000e+00
Flops/sec:            0.000e+00     0.000   0.000e+00  0.000e+00
MPI Msg Count:        0.000e+00     0.000   0.000e+00  0.000e+00
MPI Msg Len (bytes):  0.000e+00     0.000   0.000e+00  0.000e+00
MPI Reductions:       0.000e+00     0.000

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 ------  ----- Flop ------  --- Messages ---  -- Message Lengths --  -- Reductions --
                        Avg     %Total     Avg     %Total    Count   %Total     Avg         %Total    Count   %Total
 0:      Main Stage: 6.2859e+02 100.0%  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 Flop: Max - maximum over all processors
                  Ratio - ratio of maximum to minimum over all processors
   Mess: number of messages sent
   AvgLen: average message length (bytes)
   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 flop 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 flop over all processors)/(max time over all processors)
------------------------------------------------------------------------------------------------------------------------
Event                Count      Time (sec)     Flop                              --- Global ---  --- Stage ----  Total
                   Max Ratio  Max     Ratio   Max  Ratio  Mess   AvgLen  Reduct  %T %F %M %L %R  %T %F %M %L %R Mflop/s
------------------------------------------------------------------------------------------------------------------------

--- Event Stage 0: Main Stage

DMPlexInterp           1 1.0 3.1186e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   0  0  0  0  0     0
DMPlexStratify         3 1.0 4.2802e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   0  0  0  0  0     0
DMPlexSymmetrize       3 1.0 1.0806e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   0  0  0  0  0     0
------------------------------------------------------------------------------------------------------------------------

Object Type          Creations   Destructions. Reports information only for process 0.

--- Event Stage 0: Main Stage

           Container     2              1
    Distributed Mesh     5              3
            DM Label    20              8
           Index Set    64             52
             Section    17             12
   Star Forest Graph    10              7
     Discrete System     7              5
           Weak Form     7              5
    GraphPartitioner     3              2
              Matrix     2              1
              Vector     1              0
              Viewer     2              1
========================================================================================================================
Average time to get PetscTime(): 1.8e-08
#PETSc Option Table entries:
-dm_view vtk:./ksp_data/abc.vtk # (source: command line)
-log_view # (source: command line)
#End of 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 sizeof(PetscInt) 4
Configure options: --with-debugging=0 --with-strict-petscerrorcode --download-openmpi --download-metis --download-exodusii --download-parmetis --download-netcdf --download-pnetcdf --download-hdf5 --download-zlib --download-superlu --download-superlu_dist --download-triangle --download-cmake --download-fblaslapack --download-slepc
-----------------------------------------
Libraries compiled on 2023-09-15 02:34:25 on DESKTOP-0H8HCOD
Machine characteristics: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29
Using PETSc directory: /home/qingfeng/petsc/optpetsc3-19-5/petsc
Using PETSc arch: arch-linux-c-opt
-----------------------------------------

Using C compiler: /home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/bin/mpicc  -fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -Wno-lto-type-mismatch -fstack-protector -fvisibility=hidden -g -O
Using Fortran compiler: /home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/bin/mpif90  -fPIC -Wall -ffree-line-length-none -ffree-line-length-0 -Wno-lto-type-mismatch -Wno-unused-dummy-argument -g -O

-----------------------------------------

Using include paths: -I/home/qingfeng/petsc/optpetsc3-19-5/petsc/include -I/home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/include
-----------------------------------------

Using C linker: /home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/bin/mpicc
Using Fortran linker: /home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/bin/mpif90
Using libraries: -Wl,-rpath,/home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/lib -L/home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/lib -lpetsc -Wl,-rpath,/home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/lib -L/home/qingfeng/petsc/optpetsc3-19-5/petsc/arch-linux-c-opt/lib -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9 -lsuperlu -lsuperlu_dist -lflapack -lfblas -lexoIIv2for32 -lexodus -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -lparmetis -lmetis -ltriangle -lm -lz -ldl -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lpthread -lstdc++ -ldl
-----------------------------------------

The mesh information:
DM Object: Created by ICEMCFD - EXODUS II Interface 1 MPI process
  type: plex
Created by ICEMCFD - EXODUS II Interface in 3 dimensions:
  Number of 0-cells per rank: 134549
  Number of 1-cells per rank: 841756
  Number of 2-cells per rank: 1366008
  Number of 3-cells per rank: 658801
Labels:
  celltype: 4 strata with value/size (0 (134549), 6 (658801), 3 (1366008), 1 (841756))
  depth: 4 strata with value/size (0 (134549), 1 (841756), 2 (1366008), 3 (658801))
  Cell Sets: 2 strata with value/size (1 (604426), 2 (54375))
  Vertex Sets: 5 strata with value/size (3 (481), 4 (27248), 5 (20560), 6 (653), 7 (2370))
  Face Sets: 5 strata with value/size (8 (740), 9 (54206), 10 (40857), 11 (999), 12 (4534))
  SMALLER: 1 strata with value/size (8 (740))
  OUTER: 1 strata with value/size (9 (54206))
  INNER: 1 strata with value/size (10 (40857))
  BIGGER: 1 strata with value/size (11 (999))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231106/39cf5135/attachment-0001.html>


More information about the petsc-users mailing list