Commit 554a756f authored by Brad King's avatar Brad King
Browse files

utils: Port adios_reorganize to Comm encapsulation

parent c3991a25
......@@ -29,6 +29,8 @@
#include "adios2/core/ADIOS.h"
#include "adios2/core/Engine.h"
#include "adios2/core/IO.h"
#include "adios2/helper/adiosComm.h"
#include "adios2/helper/adiosCommMPI.h"
#include "adios2/helper/adiosFunctions.h"
#include "adios2/helper/adiosString.h"
......@@ -44,9 +46,12 @@ namespace utils
Reorganize::Reorganize(int argc, char *argv[])
: Utils("adios_reorganize", argc, argv)
{
MPI_Comm_split(MPI_COMM_WORLD, m_MPISplitColor, 0, &m_Comm);
MPI_Comm_rank(m_Comm, &m_Rank);
MPI_Comm_size(m_Comm, &m_Size);
{
auto commWorld = helper::CommFromMPI(MPI_COMM_WORLD);
m_Comm = commWorld.Split(m_CommSplitColor, 0);
}
m_Rank = m_Comm.Rank();
m_Size = m_Comm.Size();
if (argc < 5)
{
......@@ -118,11 +123,7 @@ void Reorganize::Run()
print0("Write method = ", wmethodname);
print0("Write method parameters = ", wmethodparam_str);
#ifdef ADIOS2_HAVE_MPI
core::ADIOS adios(m_Comm, true, "C++");
#else
core::ADIOS adios(true, "C++");
#endif
core::ADIOS adios(CommAsMPI(m_Comm), true, "C++");
core::IO &io = adios.DeclareIO("group");
print0("Waiting to open stream ", infilename, "...");
......
......@@ -13,6 +13,7 @@
#include "adios2.h"
#include "adios2/core/IO.h" // DataMap
#include "adios2/helper/adiosComm.h"
#include "utils/Utils.h"
namespace adios2
......@@ -40,7 +41,7 @@ public:
void Run() final;
private:
static const int m_MPISplitColor = 23731; // color in MPI_Split_comm() call
static const int m_CommSplitColor = 23731; // color in Comm::Split() call
static const std::string m_HelpMessage;
static const Params m_Options;
......@@ -84,7 +85,7 @@ private:
// Global variables
int m_Rank = 0;
int m_Size = 1;
MPI_Comm m_Comm;
helper::Comm m_Comm;
// Read/write method parameters
Params rmethodparams;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment