LCOV - code coverage report
Current view: top level - src/Communicate - Environment.cpp (source / functions) Coverage Total Hit
Test: final_report.info Lines: 100.0 % 17 17
Test Date: 2025-09-02 15:59:32 Functions: 100.0 % 4 4

            Line data    Source code
       1              : //
       2              : // Class Environment
       3              : //
       4              : #include "Ippl.h"
       5              : 
       6              : #include "Environment.h"
       7              : 
       8              : namespace ippl {
       9              :     namespace mpi {
      10              : 
      11           60 :         Environment::Environment(int& argc, char**& argv, const MPI_Comm& comm)
      12           60 :             : comm_m(comm) {
      13           60 :             if (!initialized()) {
      14           60 :                 MPI_Init(&argc, &argv);
      15              :             }
      16           60 :         }
      17              : 
      18           60 :         Environment::~Environment() {
      19           60 :             if (!finalized()) {
      20           60 :                 MPI_Finalize();
      21              :             }
      22           60 :         }
      23              : 
      24           60 :         bool Environment::initialized() {
      25           60 :             int flag = 0;
      26           60 :             MPI_Initialized(&flag);
      27           60 :             return (flag != 0);
      28              :         }
      29              : 
      30           60 :         bool Environment::finalized() {
      31           60 :             int flag = 0;
      32           60 :             MPI_Finalized(&flag);
      33           60 :             return (flag != 0);
      34              :         }
      35              :     }  // namespace mpi
      36              : }  // namespace ippl
        

Generated by: LCOV version 2.0-1