Walker test code coverage report
Current view: top level - IO - ParticleWriter.cpp (source / functions) Hit Total Coverage
Commit: test_coverage.info Lines: 0 17 0.0 %
Date: 2022-09-21 18:57:21 Functions: 0 2 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 18 0.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/IO/ParticleWriter.cpp
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.
       7                 :            :              All rights reserved. See the LICENSE file for details.
       8                 :            :   \brief     Charm++ group for outputing particle data to file via H5Part
       9                 :            :   \details   Charm++ group for outputing particle data to file via H5Part in
      10                 :            :      parallel using MPI-IO.
      11                 :            : */
      12                 :            : // *****************************************************************************
      13                 :            : 
      14                 :            : #include "ParticleWriter.hpp"
      15                 :            : #include "Exception.hpp"
      16                 :            : 
      17                 :            : using tk::ParticleWriter;
      18                 :            : 
      19                 :            : void
      20                 :          0 : ParticleWriter::npar( std::size_t n, CkCallback c )
      21                 :            : // *****************************************************************************
      22                 :            : //  Chares contribute their number of particles they will output on my node
      23                 :            : //! \param[in] n Number of particles will be contributed
      24                 :            : //! \param[in] c Function to continue with
      25                 :            : // *****************************************************************************
      26                 :            : {
      27                 :          0 :   m_npar += n;
      28                 :          0 :   c.send();
      29                 :          0 : }
      30                 :            : 
      31                 :            : void
      32                 :          0 : ParticleWriter::writeCoords( uint64_t it,
      33                 :            :                              const std::vector< tk::real >& x,
      34                 :            :                              const std::vector< tk::real >& y,
      35                 :            :                              const std::vector< tk::real >& z,
      36                 :            :                              CkCallback c )
      37                 :            : // *****************************************************************************
      38                 :            : //  Write particle coordinates to file
      39                 :            : //! \param[in] it Output iteration count
      40                 :            : //! \param[in] x X coordinates of particles
      41                 :            : //! \param[in] y Y coordinates of particles
      42                 :            : //! \param[in] z Z coordinates of particles
      43                 :            : //! \param[in] c Function to continue with after the write is complete
      44                 :            : // *****************************************************************************
      45                 :            : {
      46 [ -  - ][ -  - ]:          0 :   Assert( x.size() == y.size() && y.size() == z.size(),
         [ -  - ][ -  - ]
                 [ -  - ]
      47                 :            :           "Particle coordinates array sizes mismatch" );
      48                 :            : 
      49                 :            :   // buffer up coordinates
      50         [ -  - ]:          0 :   m_x.insert( end(m_x), begin(x), end(x) );
      51         [ -  - ]:          0 :   m_y.insert( end(m_y), begin(y), end(y) );
      52         [ -  - ]:          0 :   m_z.insert( end(m_z), begin(z), end(z) );
      53                 :            : 
      54                 :            :   // if received from all chares on my PE, write to file
      55         [ -  - ]:          0 :   if (m_x.size() == m_npar) {
      56                 :          0 :     m_writer.writeCoords( it, m_x, m_y, m_z );
      57                 :          0 :     m_npar = 0;
      58                 :          0 :     m_x.clear();
      59                 :          0 :     m_y.clear();
      60                 :          0 :     m_z.clear();
      61                 :            :   }
      62                 :            : 
      63                 :          0 :   c.send();
      64                 :          0 : }
      65                 :            : 
      66                 :            : #include "NoWarning/particlewriter.def.h"

Generated by: LCOV version 1.14