*comdeck,statTableCom                                                     dc

c *** Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.

c     --- define the max number of code sections monitored and
c     --- the max number of nested levels
c     --- (NOTE: STATLVLMAX must also be changed in ansysdef.h)
      integer    NUMSTATSECTIONS,STATLVLMAX
      parameter (NUMSTATSECTIONS=30,STATLVLMAX=10)

c     --- define the number of DPs and INTs in the common
      integer    NUMSTATDPS,NUMSTATINTS,NUMSTATLONGS
      parameter (NUMSTATDPS  =15*NUMSTATSECTIONS + 15*STATLVLMAX +  3)
      parameter (NUMSTATINTS =   NUMSTATSECTIONS                 + 27)
      parameter (NUMSTATLONGS=10*NUMSTATSECTIONS +  6*STATLVLMAX +  3)

      integer  statNumTrips, statLvl, statKey,
     x statNumElems, statNumNodes, statNumSharedNodes, 
     x statMinSharedNodes, statMaxSharedNodes,
     x statNumDOFs, statNumCPCE,
     x statNumGlbElems, statNumGlbNodes, statNumGlbDOFs,
     x statSolverUsed, statLoadSteps, statSubSteps, statIterations,
     x statLineSearches, statBisections,
     x statMsavePerCent, statPCGitersSum, statPCGitersMax,
     x statSPmemOpt, statTotalColsInPC, statMinColsInPC,
     x statMaxColsInPC, statPCGLevDifficulty, statSparMethUsed
  
      LONGINT statMPIMaxMsgLengthSent, statMPIMaxMsgLengthRecv,
     x LvlMPIMaxMsgLengthSent, LvlMPIMaxMsgLengthRecv, statTotalNZ,
     x statMinNZ, statMaxNZ, statMPICalls, statMPISendCalls,
     x statMPIRecvCalls, statMPIBarrierCalls, statMPIReduceCalls,
     x statMPIProbeCalls, LvlMPICalls, LvlMPISendCalls,
     x LvlMPIRecvCalls, LvlMPIBarrierCalls, LvlMPIReduceCalls,
     x LvlMPIProbeCalls


      double precision statCPTime, statWallTime, statIOTransfer,
     x statMPIDataSent, statMPIDataRecv, LvlCPTime, LvlWallTime, 
     x LvlIOTransfer, LvlMPIDataSent, LvlMPIDataRecv,
     x statMPISendCP, statMPISendWall,
     x statMPIRecvCP, statMPIRecvWall, statMPIBarrierCP,
     x statMPIBarrierWall, statMPIReduceCP, statMPIReduceWall,
     x statMPIProbeCP, statMPIProbeWall,
     x LvlMPISendCP, LvlMPISendWall,
     x LvlMPIRecvCP, LvlMPIRecvWall, LvlMPIBarrierCP,
     x LvlMPIBarrierWall, LvlMPIReduceCP, LvlMPIReduceWall,
     x LvlMPIProbeCP, LvlMPIProbeWall, statPCGToler, statCompSpeed,
     x statSPioSpeed

      common /statTableCom/ 
c    --- double precision data
     x statCPTime(NUMSTATSECTIONS),
     x statWallTime(NUMSTATSECTIONS), statIOTransfer(NUMSTATSECTIONS),
     x statMPIDataSent(NUMSTATSECTIONS),
     x statMPIDataRecv(NUMSTATSECTIONS),
     x LvlCPTime(STATLVLMAX), LvlWallTime(STATLVLMAX),
     x LvlIOTransfer(STATLVLMAX), LvlMPIDataSent(STATLVLMAX), 
     x LvlMPIDataRecv(STATLVLMAX),
     x statMPISendCP(NUMSTATSECTIONS),
     x statMPISendWall(NUMSTATSECTIONS),
     x statMPIRecvCP(NUMSTATSECTIONS),
     x statMPIRecvWall(NUMSTATSECTIONS),
     x statMPIBarrierCP(NUMSTATSECTIONS),
     x statMPIBarrierWall(NUMSTATSECTIONS),
     x statMPIReduceCP(NUMSTATSECTIONS),
     x statMPIReduceWall(NUMSTATSECTIONS),
     x statMPIProbeCP(NUMSTATSECTIONS),
     x statMPIProbeWall(NUMSTATSECTIONS),
     x LvlMPISendCP(STATLVLMAX), LvlMPISendWall(STATLVLMAX),
     x LvlMPIRecvCP(STATLVLMAX), LvlMPIRecvWall(STATLVLMAX),
     x LvlMPIBarrierCP(STATLVLMAX), LvlMPIBarrierWall(STATLVLMAX),
     x LvlMPIReduceCP(STATLVLMAX), LvlMPIReduceWall(STATLVLMAX),
     x LvlMPIProbeCP(STATLVLMAX), LvlMPIProbeWall(STATLVLMAX),
     x statPCGToler, statCompSpeed, statSPioSpeed,

c    --- LONGINT data
     x statMPIMaxMsgLengthSent(NUMSTATSECTIONS),
     x statMPIMaxMsgLengthRecv(NUMSTATSECTIONS),
     x LvlMPIMaxMsgLengthSent(NUMSTATSECTIONS),
     x LvlMPIMaxMsgLengthRecv(NUMSTATSECTIONS),
     x statTotalNZ, statMinNZ, statMaxNZ,
     x statMPICalls(NUMSTATSECTIONS),
     x statMPISendCalls(NUMSTATSECTIONS),
     x statMPIRecvCalls(NUMSTATSECTIONS),
     x statMPIBarrierCalls(NUMSTATSECTIONS),
     x statMPIReduceCalls(NUMSTATSECTIONS),
     x statMPIProbeCalls(NUMSTATSECTIONS),
     x LvlMPICalls(STATLVLMAX),
     x LvlMPISendCalls(STATLVLMAX), LvlMPIRecvCalls(STATLVLMAX),
     x LvlMPIBarrierCalls(STATLVLMAX), LvlMPIReduceCalls(STATLVLMAX),
     x LvlMPIProbeCalls(STATLVLMAX),

c    --- integer data
     x statNumTrips(NUMSTATSECTIONS),
     x statLvl, statKey,
     x statNumElems, statNumNodes, statNumSharedNodes,
     x statMinSharedNodes, statMaxSharedNodes,
     x statNumDOFs, statNumCPCE, 
     x statNumGlbElems, statNumGlbNodes, statNumGlbDOFs,
     x statSolverUsed, statLoadSteps,
     x statSubSteps, statIterations, statLineSearches, statBisections,
     x statMsavePerCent, statPCGitersSum, statPCGitersMax, 
     x statSPmemOpt, statTotalColsInPC, statMinColsInPC, 
     x statMaxColsInPC, statPCGLevDifficulty, statSparMethUsed

      character*(LENFNM) statInFile
      character*(LENDIR)  statCWD
      common /statTableComc/ statInFile,statCWD

c --- statistics for each code section
co statCPTime              - CPU time
co statWallTime            - wall time
co statIOTransfer          - I/O data transferred (read and written), bytes
co statNumTrips            - number of trips through this code section
co statMPICalls            - number of calls to MPI functions
co statMPIDataSent         - data sent via MPI, bytes
co statMPIMaxMsgLengthSent - maximum message length sent, bytes
co statMPIDataRecv         - data received via MPI, bytes
co statMPIMaxMsgLengthRecv - maximum message length received, bytes
co statMPISendCalls        - number of calls to MPI_Send functions
co statMPISendCP           - CPU time spent sending messages
co statMPISendWall         - wall time spent sending messages
co statMPIRecvCalls        - number of calls to MPI_Recv functions
co statMPIRecvCP           - CPU time spent receiving messages
co statMPIRecvWall         - wall time spent receiving messages
co statMPIBarrierCalls     - number of calls to MPI_Barrier functions
co statMPIBarrierCP        - CPU time spent at MPI sync points
co statMPIBarrierWall      - wall time spent at MPI sync points
co statMPIReduceCalls      - number of calls to MPI_Reduce functions
co statMPIReduceCP         - CPU time spent at MPI reduce points (Min,Max,Sum,etc.)
co statMPIReduceWall       - wall time spent at MPI reduce points (Min,Max,Sum,etc.)
co statMPIProbeCalls       - number of calls to MPI_Probe functions
co statMPIProbeCP          - CPU time spent at MPI probe points
co statMPIProbeWall        - wall time spent at MPI probe points

c --- statistics kept per level
co statLvl                - current level
co LvlCPTime              - CPU time
co LvlWallTime            - wall time
co LvlIOTransfer          - I/O data transferred (read and written), bytes
co LvlMPICalls            - number of calls to MPI functions
co LvlMPIDataSent         - data sent via MPI, bytes
co LvlMPIMaxMsgLengthSent - maximum message length sent, bytes
co LvlMPIDataRecv         - data received via MPI, bytes
co LvlMPIMaxMsgLengthRecv - maximum message length received, bytes
co LvlMPISendCalls        - number of calls to MPI_Send functions
co LvlMPISendCP           - CPU time spent sending messages
co LvlMPISendWall         - wall time spent sending messages
co LvlMPIRecvCalls        - number of calls to MPI_Recv functions
co LvlMPIRecvCP           - CPU time spent receiving messages
co LvlMPIRecvWall         - wall time spent receiving messages
co LvlMPIBarrierCalls     - number of calls to MPI_Barrier functions
co LvlMPIBarrierCP        - CPU time spent at MPI sync points
co LvlMPIBarrierWall      - wall time spent at MPI sync points
co LvlMPIReduceCalls      - number of calls to MPI_Reduce functions
co LvlMPIReduceCP         - CPU time spent at MPI reduce points (Min,Max,Sum,etc.)
co LvlMPIReduceWall       - wall time spent at MPI reduce points (Min,Max,Sum,etc.)
co LvlMPIProbeCalls       - number of calls to MPI_Probe functions
co LvlMPIProbeCP          - CPU time spent at MPI probe points
co LvlMPIProbeWall        - wall time spent at MPI probe points

c --- global quantities
co statKey             - -1,do not accumulate stats;  0 or 1,accumulate stats
co statInFile          - input file (-i only)
co statCWD             - current working directory at startup
co statNumElems        - number of elements that the solver sees
co statNumNodes        - number of nodes that the solver sees
co statNumSharedNodes  - number of shared nodes between domains
co statMinSharedNodes  - minimum number of shared nodes between domains
co statMaxSharedNodes  - minimum number of shared nodes between domains
co statNumDOFs         - number of DOFs that the solver sees
co statNumCPCE         - number of CEs/Cps that the solver sees (global)
co statNumGlbElems     - global number of elements
co statNumGlbNodes     - global number of nodes
co statNumGlbDOFs      - global number of dofs
co statSolverUsed      - solver used (SolveMethod)
co statSparMethUsed    - Sparse solver method used (SparseSolveMethod)
co statLoadSteps       - total number of load steps
co statSubSteps        - total number of substeps
co statIterations      - total number of iterations
co statLineSearches    - total number of line searches
co statBisections      - total number of bisections

c --- PCG quantities
co statMsavePerCent    - percentage of elements in MSAVE mode
co statPCGitersSum     - sum of all PCG iterations done
co statPCGitersMax     - maximum number of iterations in one solve
co statTotalNZ         - total number of matrix nonzeroes
co statMinNZ           - minimum number of matrix nonzeroes on any machine
co statMaxNZ           - maximum number of matrix nonzeroes on any machine
co statTotalColsInPC   - total number of columns in preconditioner
co statMinColsInPC     - minimum number of columns in preconditioner
co statMaxColsInPC     - maximum number of columns in preconditioner
co statPCGLevDifficulty- PCG solver level of difficulty value
co statPCGToler        - tolerance used by the PCG iterative loop
co statCompSpeed       - computational speed (in MFLOPS) of solver 

c --- Boeing Sparse quantities
co statSPmemOpt        - sparse solver memory option (0=part, 1=min, 2=fully in-core)
co statSPioSpeed       - sparse solver effective I/O rate

c --- code sections (see ansysdef.inc):
c STAT_TOTAL       - all of ANSYS (begin to ender)
c STAT_PREP7       - [prep7]
c STAT_SOLUTION    - [solvcl]
c STAT_POST1       - [post1]
c STAT_POST26      - [post26]
c STAT_CHECK       - solvcl CHECK [pr7ver]
c STAT_OBJECTS     - solution object creation/deletion [lsstr/lsend]
c STAT_FORM        - element formation and assembly [sfform/eqprep]
c STAT_SOLVER      - equation solver [fastSolve/SolveFULL]
c STAT_OUTPUT      - element output pass [OutputResult/modstr]
c STAT_COMBINE     - local file combining [Combine****File.F] -> D-ANSYS only!
c STAT_LINESEARCH  - line search [LineSearch]
c STAT_CONTACT     - contact database [ContactForm/GContactCreate]
c STAT_CONVERGENCE - convergence checking [CheckConv/DispUpd/NonlinElConv]
c STAT_GATHER      - PCG solver data gathering [casiInitialize]
c STAT_ASSEMBLE    - for PCG/JCGNEW solvers includes some matrix assembly [PcgEmatBegin/End]
c                  - for Sparse solvers includes some matrix assembly and FULL file writing [fastSolve]
c STAT_PRECOND     - PCG solver preconditioner setup [PcgGraph/PcgPrecond]
c STAT_AMULTX      - PCG solver A*x operations [multiplyWithA]
c STAT_PCSOLVE     - PCG solver solve-with-preconditioner operations [solveWithPrecond]
c STAT_INPUTK      - Sparse solver matrix input (structure/values)
c STAT_ORDERK      - Sparse solver re-ordering
c STAT_FACTORK     - Sparse solver factorization
c STAT_SOLVEK      - Sparse solver solving (back substitution)
c STAT_DOMORDER    - element ordering/domain decomposition [DomainOrder]
c STAT_TOTSOLVE    - time spent computing solution [slvrun]

c --- usage summary:

c /DEBUG,STATS (statKey) triggers the tracking and writing of the statistics
c   statKey is automatically set if it is the development version (sysdta 
c   "ldesc" = 'BETA' or 'TEST'
c Note: use /DEBUG,STATS,-1 to turn off tracking in the development version

c --- to track statistics
c     call StatBegin (STAT_NAME)
c        ANSYS code to be tracked...
c     call StatEnd (STAT_NAME)

c     (up to STATLVLMAX nested tracking calls are allowed)

c     see statTableUtils.h for corresponding c functions

