/*! \file policy.hpp \author Ha NGUYEN \since 06 Oct 2015 \date 06 Oct 2015 \brief Some useful policies for templated classes */ #ifndef __XIOS_POLICY_HPP__ #define __XIOS_POLICY_HPP__ #include #include "mpi.hpp" namespace xios { class DivideAdaptiveComm { protected: DivideAdaptiveComm(const ep_lib::MPI_Comm& mpiComm); void computeMPICommLevel(); const std::vector& getGroupBegin() { return groupBegin_; } const std::vector& getNbInGroup() { return nbInGroup_; } const std::vector >& getGroupParentsBegin() { return groupParentsBegin_; } const std::vector >& getNbInGroupParents() { return nbInGroupParents_; } int getNbLevel() { return level_; } protected: const ep_lib::MPI_Comm& internalComm_; std::vector > groupParentsBegin_; std::vector > nbInGroupParents_; int level_; std::vector groupBegin_; //! Rank beginning of a group std::vector nbInGroup_; //! Number of process in each group bool computed_; }; } #endif // __XIOS_POLICY_HPP__