message: testing: Avoid using MPI in TestManyVars without ADIOS2_HAVE_MPI
diff: #include <gtest/gtest.h>
  #include <adios2/common/ADIOSConfig.h>
  -#include <adios2/common/ADIOSMPI.h>
  +
  +#ifdef ADIOS2_HAVE_MPI
  +#include <mpi.h>
  +#endif
  #include "adios2_c.h"
  #include <errno.h>
  @@ -127,9 +130,11 @@ std::vector<RunParams> CreateRunParams()
  break; \
  }
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Comm comm = MPI_COMM_WORLD;
  -int rank;
  -int numprocs;
  +#endif
  +int rank = 0;
  +int numprocs = 1;
  class TestManyVars : public ::testing::TestWithParam<RunParams>
  {
  @@ -348,7 +353,9 @@ public:
  double(std::chrono::duration_cast<std::chrono::seconds>(te - tb)
  .count()));
  }
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Barrier(comm);
  +#endif
  return 0;
  }
  @@ -392,7 +399,9 @@ public:
  {
  CHECK_VARINFO(varnames[i], 2, NSTEPS)
  }
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Barrier(comm);
  +#endif
  te = std::chrono::high_resolution_clock::now();
  if (rank == 0)
  {
  @@ -441,7 +450,9 @@ public:
  }
  }
  adios2_end_step(engineR);
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Barrier(comm);
  +#endif
  te = std::chrono::high_resolution_clock::now();
  if (rank == 0)
  {
  @@ -454,7 +465,9 @@ public:
  endread:
  adios2_close(engineR);
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Barrier(comm);
  +#endif
  return err;
  }
  };
  @@ -475,15 +488,21 @@ INSTANTIATE_TEST_CASE_P(NxM, TestManyVars,
  int main(int argc, char **argv)
  {
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Init(&argc, &argv);
  +#endif
  ::testing::InitGoogleTest(&argc, argv);
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
  +#endif
  int result;
  result = RUN_ALL_TESTS();
  +#ifdef ADIOS2_HAVE_MPI
  MPI_Finalize();
  +#endif
  return result;
  }
  