/*! * \file * \brief Distributed bitonic implementation header * * \author * Christos Choutouridis AEM:8997 * */ #ifndef DISTBITONIC_H_ #define DISTBITONIC_H_ #if !defined DEBUG #define NDEBUG #endif #include #include #if !defined TESTING #include #endif using Data_t = std::vector; using AllData_t = std::vector; struct mpi_t { size_t world_size{}; size_t world_rank{}; std::string processor_name {}; }; extern mpi_t mpi; bool ascending(size_t node, size_t depth) noexcept; size_t partner(size_t node, size_t step) noexcept; bool keepsmall(size_t node, size_t partner, size_t depth) noexcept; void exchange(size_t node, size_t partner); void minmax(AllData_t& data, size_t node, size_t partner, bool keepsmall); void sort_network(AllData_t& data, size_t nodes, size_t depth); void distbitonic(size_t P, AllData_t& data); #endif //DISTBITONIC_H_