Commit 2baef904 authored by Samuel Debionne's avatar Samuel Debionne
Browse files

Add process topology and roles

parent 02672787
Pipeline #25270 failed with stages
in 106 minutes and 45 seconds
// Copyright (C) 2018 Samuel Debionne, ESRF.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#if !defined(LIMA_TOPOLOGY_HPP)
#define LIMA_TOPOLOGY_HPP
#include <boost/mpi.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/utility.hpp>
namespace lima {
/// Each process needs to register with the topology object and declare its role
struct topology
{
///
enum class role
{
master,
control,
daq,
processing
};
topology(role r)
{
// Gather rank and role from all particpating processes
boost::mpi::all_gather(m_world, std::make_pair(m_world.rank(), r), m_roles);
}
boost::mpi::communicator m_world;
std::vector<std::pair<int, role>> m_roles;
};
} //namespace lima
#endif //!defined(LIMA_TOPOLOGY_HPP)
Supports Markdown
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