while ((index = MSG_comm_testany(node.comms)) != -1) {
comm_send = xbt_dynar_get_as(node.comms, index, msg_comm_t);
MSG_error_t status = MSG_comm_get_status(comm_send);
xbt_dynar_remove_at(node.comms, index, &comm_send);
DEBUG3("Communication %p is finished with status %d, dynar size is now %lu",
comm_send, status, xbt_dynar_length(node.comms));
while ((index = MSG_comm_testany(node.comms)) != -1) {
comm_send = xbt_dynar_get_as(node.comms, index, msg_comm_t);
MSG_error_t status = MSG_comm_get_status(comm_send);
xbt_dynar_remove_at(node.comms, index, &comm_send);
DEBUG3("Communication %p is finished with status %d, dynar size is now %lu",
comm_send, status, xbt_dynar_length(node.comms));