Function t8_forest_ghost_parse_received_message

Function Documentation

static void t8_forest_ghost_parse_received_message(t8_forest_t forest, t8_forest_ghost_t ghost, t8_locidx_t *current_element_offset, int recv_rank, char *recv_buffer, int recv_bytes)

Parse a message from a remote process and correctly include the received elements in the ghost structure. The message looks like: num_trees | pad | treeid 0 | pad | eclass 0 | pad | num_elems 0 | pad | elements | pad | treeid 1 | … size_t | |t8_gloidx | |t8_eclass | | size_t | | t8_element_t |

pad is paddind, see T8_ADD_PADDING

current_element_offset is updated in each step to store the element offset of the next ghost tree to be inserted. When called with the first message, current_element_offset must be set to 0.

Currently we expect that the messages arrive in order of the sender’s rank.

Parameters:
  • forest[in] The forest.

  • ghost[in] The forest’s ghost.

  • current_element_offset[inout] The current element offset. Has to be zero on input and is updated in each step.

  • recv_rank[in] The receiving rank.

  • recv_buffer[in] The receive buffer.

  • recv_bytes[in] The number of bytes received.