LCOV - code coverage report
Current view: top level - src/Communicate - Communicator.cpp (source / functions) Coverage Total Hit
Test: report.info Lines: 20.0 % 25 5
Test Date: 2025-05-21 11:16:25 Functions: 16.7 % 6 1
Branches: 13.3 % 30 4

             Branch data     Line data    Source code
       1                 :             : 
       2                 :             : #include "Communicate/Communicator.h"
       3                 :             : 
       4                 :             : namespace ippl {
       5                 :             :     namespace mpi {
       6                 :             : 
       7                 :           0 :         Communicator::Communicator()
       8   [ #  #  #  #  :           0 :             : comm_m(new MPI_Comm(MPI_COMM_WORLD)) {
          #  #  #  #  #  
                      # ]
       9         [ #  # ]:           0 :             MPI_Comm_rank(*comm_m, &rank_m);
      10         [ #  # ]:           0 :             MPI_Comm_size(*comm_m, &size_m);
      11                 :           0 :         }
      12                 :             : 
      13         [ +  - ]:        1770 :         Communicator::Communicator(MPI_Comm comm) {
      14         [ +  - ]:        1770 :             comm_m = std::make_shared<MPI_Comm>(comm);
      15         [ +  - ]:        1770 :             MPI_Comm_rank(*comm_m, &rank_m);
      16         [ +  - ]:        1770 :             MPI_Comm_size(*comm_m, &size_m);
      17                 :        1770 :         }
      18                 :             : 
      19                 :           0 :         Communicator& Communicator::operator=(MPI_Comm comm) {
      20         [ #  # ]:           0 :             comm_m = std::make_shared<MPI_Comm>(comm);
      21                 :           0 :             MPI_Comm_rank(*comm_m, &rank_m);
      22                 :           0 :             MPI_Comm_size(*comm_m, &size_m);
      23                 :           0 :             return *this;
      24                 :             :         }
      25                 :             : 
      26                 :           0 :         Communicator Communicator::Communicator::split(int color, int key) const {
      27                 :             :             MPI_Comm newcomm;
      28         [ #  # ]:           0 :             MPI_Comm_split(*comm_m, color, key, &newcomm);
      29         [ #  # ]:           0 :             return Communicator(newcomm);
      30                 :             :         }
      31                 :             : 
      32                 :           0 :         void Communicator::probe(int source, int tag, Status& status) {
      33                 :           0 :             MPI_Probe(source, tag, *comm_m, status);
      34                 :           0 :         }
      35                 :             : 
      36                 :           0 :         bool Communicator::iprobe(int source, int tag, Status& status) {
      37                 :           0 :             int flag = 0;
      38         [ #  # ]:           0 :             MPI_Iprobe(source, tag, *comm_m, &flag, status);
      39                 :           0 :             return (flag != 0);
      40                 :             :         }
      41                 :             :     }  // namespace mpi
      42                 :             : }  // namespace ippl
        

Generated by: LCOV version 2.0-1