-static void SIMIX_comm_copy_data(smx_activity_t comm);
-static void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr synchro);
-
-/**
- * @brief Checks if there is a communication activity queued in a deque matching our needs
- * @param deque where to search into
- * @param type The type of communication we are looking for (comm_send, comm_recv)
- * @param match_fun the function to apply
- * @param this_user_data additional parameter to the match_fun
- * @param my_synchro what to compare against
- * @param remove_matching whether or not to clean the found object from the queue
- * @return The communication activity if found, nullptr otherwise
- */
-static simgrid::kernel::activity::CommImplPtr
-_find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* deque, e_smx_comm_type_t type,
- int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void* this_user_data,
- simgrid::kernel::activity::CommImplPtr my_synchro, bool remove_matching)
-{
- void* other_user_data = nullptr;
-
- for(auto it = deque->begin(); it != deque->end(); it++){
- simgrid::kernel::activity::CommImplPtr comm =
- boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(std::move(*it));
-
- if (comm->type == SIMIX_COMM_SEND) {
- other_user_data = comm->src_data;
- } else if (comm->type == SIMIX_COMM_RECEIVE) {
- other_user_data = comm->dst_data;
- }
- if (comm->type == type && (match_fun == nullptr || match_fun(this_user_data, other_user_data, comm.get())) &&
- (not comm->match_fun || comm->match_fun(other_user_data, this_user_data, my_synchro.get()))) {
- XBT_DEBUG("Found a matching communication synchro %p", comm.get());
- if (remove_matching)
- deque->erase(it);
-#if SIMGRID_HAVE_MC
- comm->mbox_cpy = comm->mbox;
-#endif
- comm->mbox = nullptr;
- return comm;
- }
- XBT_DEBUG("Sorry, communication synchro %p does not match our needs:"
- " its type is %d but we are looking for a comm of type %d (or maybe the filtering didn't match)",
- comm.get(), (int)comm->type, (int)type);
- }
- XBT_DEBUG("No matching communication synchro found");
- return nullptr;
-}