Xyst test code coverage report
Current view: top level - LinearSolver - conjugategradients.ci (source / functions) Hit Total Coverage
Commit: d790e211db0f2cf155e72db869cf1a5a372c10f5 Lines: 5 5 100.0 %
Date: 2025-02-17 15:57:47 Functions: 0 0 -
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/LinearSolver/conjugategradients.ci
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.,
       7                 :            :              2022-2025 J. Bakosi
       8                 :            :              All rights reserved. See the LICENSE file for details.
       9                 :            :   \brief     Charm++ module interface for distributed conjugate gradients
      10                 :            :   \details   Charm++ module interface file for asynchronous distributed
      11                 :            :              conjugate gradients linear solver.
      12                 :            : */
      13                 :            : // *****************************************************************************
      14                 :            : 
      15                 :            : module conjugategradients {
      16                 :            : 
      17                 :            :   include "CSR.hpp";
      18                 :            : 
      19                 :            :   namespace tk {
      20                 :            : 
      21                 :            :     array [1D] ConjugateGradients {
      22                 :            :       entry ConjugateGradients(
      23                 :            :          const CSR& A,
      24                 :            :          const std::vector< tk::real >& x,
      25                 :            :          const std::vector< tk::real >& b,
      26                 :            :          const std::vector< std::size_t >& gid,
      27                 :            :          const std::unordered_map< std::size_t, std::size_t >& lid,
      28                 :            :          const std::unordered_map< int,
      29                 :            :                  std::unordered_set< std::size_t > >& nodecommmap );
      30                 :            :       entry ConjugateGradients(
      31                 :            :          std::tuple< tk::CSR,
      32                 :            :                      std::vector< tk::real >,
      33                 :            :                      std::vector< tk::real > >&& system,
      34                 :            :          const std::vector< std::size_t >& gid,
      35                 :            :          const std::unordered_map< std::size_t, std::size_t >& lid,
      36                 :            :          const std::unordered_map< int,
      37                 :            :                  std::unordered_set< std::size_t > >& nodecommmap );
      38                 :            :       entry void init( const std::vector< tk::real >& x,
      39                 :            :                        const std::vector< tk::real >& b,
      40                 :            :                        const std::vector< tk::real >& neubc,
      41                 :            :                        const std::unordered_map< std::size_t,
      42                 :            :                          std::vector< std::pair< int, tk::real > > >& dirbc,
      43                 :            :                        bool apply,
      44                 :            :                        const std::string& pc,
      45                 :            :                        CkCallback cb );
      46                 :            :       entry void setup( CkCallback cb );
      47                 :            :       entry void solve( std::size_t maxit,
      48                 :            :                         tk::real tol,
      49                 :            :                         int pe,
      50                 :            :                         uint64_t verbose,
      51                 :            :                         CkCallback c );
      52                 :            :       entry [reductiontarget] void normb( tk::real n );
      53                 :            :       entry [reductiontarget] void rho( tk::real r );
      54                 :            :       entry [reductiontarget] void pq( tk::real n );
      55                 :            :       entry [reductiontarget] void normres( tk::real r );
      56                 :            :       entry [reductiontarget] void rz( tk::real rz );
      57                 :       6244 :       entry void comres( const std::vector< std::size_t >& gid,
      58                 :            :                          const std::vector< std::vector< tk::real > >& rc );
      59                 :            :       entry void combc( const std::map< std::size_t,
      60                 :            :                           std::vector< std::pair< int, tk::real > > >& dbc,
      61         [ +  - ]:       6238 :                         const std::vector< std::size_t >& gid,
      62                 :            :                           const std::vector< std::vector< tk::real > >& qc );
      63                 :            :       entry void comq( const std::vector< std::size_t >& gid,
      64                 :            :                        const std::vector< std::vector< tk::real > >& qc );
      65         [ +  - ]:       6238 :       entry void comr( const std::vector< std::size_t >& gid,
      66                 :            :                        const std::vector< std::vector< tk::real > >& rc );
      67                 :            :       entry void comd( const std::vector< std::size_t >& gid,
      68                 :            :                        const std::vector< std::vector< tk::real > >& qc );
      69                 :     232777 :       entry void comx( const std::vector< std::size_t >& gid,
      70                 :            :                        const std::vector< std::vector< tk::real > >& xc );
      71                 :            : 
      72                 :            :       entry void wait4res() {
      73                 :     232777 :         when ownres_complete(), comres_complete(), normb_complete(),
      74                 :            :              ownd_complete(), comd_complete() serial
      75                 :            :         { initres(); }
      76                 :            :       }
      77                 :            : 
      78                 :            :       entry void wait4bc() {
      79                 :            :         when ownbc_complete( CkCallback cb ), combc_complete() serial
      80                 :            :         { apply( cb ); }
      81                 :            :       }
      82                 :            : 
      83                 :            :       entry void wait4r() {
      84                 :            :         when ownr_complete( CkCallback cb ), comr_complete() serial
      85                 :            :         { r( cb ); }
      86                 :            :       }
      87                 :            : 
      88                 :            :       entry void wait4q() {
      89                 :            :         when ownq_complete(), comq_complete() serial
      90                 :            :         { q(); }
      91                 :            :       }
      92                 :            : 
      93                 :            :       entry void wait4x() {
      94                 :            :         when ownx_complete(), comx_complete(), normr_complete() serial
      95                 :            :         { x(); }
      96                 :            :       }
      97                 :            : 
      98                 :            :       entry void ownres_complete();
      99                 :            :       entry void comres_complete();
     100                 :            :       entry void normb_complete();
     101                 :            :       entry void ownbc_complete( CkCallback cb );
     102                 :            :       entry void combc_complete();
     103                 :            :       entry void ownd_complete();
     104                 :            :       entry void comd_complete();
     105                 :            :       entry void ownq_complete();
     106                 :            :       entry void comq_complete();
     107                 :            :       entry void ownr_complete( CkCallback cb );
     108                 :            :       entry void comr_complete();
     109                 :            :       entry void ownx_complete();
     110                 :            :       entry void comx_complete();
     111                 :            :       entry void normr_complete();
     112                 :            :     };
     113                 :            : 
     114                 :            :   } // tk::
     115                 :            : 
     116                 :            : }

Generated by: LCOV version 1.16