+void SIMIX_pre_comm_testany(smx_req_t req, int idx)
+{
+ unsigned int cursor;
+ smx_action_t action;
+ xbt_dynar_t actions = req->comm_testany.comms;
+ req->comm_testany.result = -1;
+
+ if (MC_IS_ENABLED){
+ if(idx == -1){
+ SIMIX_request_answer(req);
+ }else{
+ action = xbt_dynar_get_as(actions, idx, smx_action_t);
+ req->comm_testany.result = idx;
+ xbt_fifo_push(action->request_list, req);
+ action->state = SIMIX_DONE;
+ SIMIX_comm_finish(action);
+ }
+ return;
+ }
+
+ xbt_dynar_foreach(req->comm_testany.comms,cursor,action) {
+ if (action->state != SIMIX_WAITING && action->state != SIMIX_RUNNING) {
+ req->comm_testany.result = cursor;
+ xbt_fifo_push(action->request_list, req);
+ SIMIX_comm_finish(action);
+ return;
+ }
+ }
+ SIMIX_request_answer(req);
+}
+
+void SIMIX_pre_comm_waitany(smx_req_t req, int idx)