52 #ifndef HAVOQGT_MPI_TERMINATION_DETECTION_HPP_INCLUDED
53 #define HAVOQGT_MPI_TERMINATION_DETECTION_HPP_INCLUDED
59 namespace havoqgt {
namespace mpi {
96 template<
typename SizeType>
106 int in_num_tree_children = 2,
107 int in_query_status_tag = 2,
108 int in_query_response_tag = 3,
109 int in_terminate_tag = 4) {
122 std::numeric_limits<size_type>::max());
149 const size_type& in_completed) {
164 const size_type& in_completed) {
190 const size_type& in_completed) {
204 const size_type& in_completed) {
212 status_response_type recv_buf;
215 CHK_MPI( MPI_Recv( (
void*) &recv_buf,
sizeof(status_response_type),
251 const size_type& in_completed) {
271 CHK_MPI( MPI_Test( &(in_req), &flag, MPI_STATUS_IGNORE) );
294 MPI_Request isend_request;
307 if (to_return < 0) to_return = 0;
343 #endif //HAVOQGT_MPI_TERMINATION_DETECTION_HPP_INCLUDED
void inc_queued(size_t _i=1)
termination_detection_state_type
std::pair< size_type, size_type > status_response_type
bool handle_waiting_recv_children(const size_type &in_queued, const size_type &in_completed)
void inc_completed(size_t _i=1)
status_response_type * m_ptr_buf_isend_parent
size_type m_count_completed
status_response_type m_previous_subtree_status_response
std::vector< MPI_Request > m_vec_req_isend_children
MPI_Comm m_mpi_comm
Configuration parameters.
bool handle_waiting_isend_children(const size_type &in_queued, const size_type &in_completed)
void send_terminate_to_children()
bool test_for_termination_internal(const size_type &in_queued, const size_type &in_completed)
termination_detection_state_type m_current_state
bool mpi_test(MPI_Request &in_req)
bool handle_waiting_init(const size_type &in_queued, const size_type &in_completed)
void send_query_status_to_children()
bool handle_waiting_isend_parent(const size_type &in_queued, const size_type &in_completed)
int m_num_waiting_recv_children
bool test_for_termination()
bool mpi_iprobe(int in_source, int in_tag)
MPI_Request m_req_isend_parent
termination_detection(MPI_Comm in_mpi_comm, int in_num_tree_children=2, int in_query_status_tag=2, int in_query_response_tag=3, int in_terminate_tag=4)
status_response_type m_subtree_status_response
void isend_status_response_to_parent()