+ if (simcall->issuer->exception &&
+ (simcall->call == SIMCALL_COMM_WAITANY || simcall->call == SIMCALL_COMM_TESTANY)) {
+ // First retrieve the rank of our failing synchro
+ int rank = -1;
+ if (simcall->call == SIMCALL_COMM_WAITANY) {
+ rank = xbt_dynar_search(simcall_comm_waitany__get__comms(simcall), &synchro);
+ } else if (simcall->call == SIMCALL_COMM_TESTANY) {
+ rank = -1;
+ auto* comms = simcall_comm_testany__get__comms(simcall);
+ auto count = simcall_comm_testany__get__count(simcall);
+ auto element = std::find(comms, comms + count, synchro);
+ if (element == comms + count)
+ rank = -1;
+ else
+ rank = element - comms;
+ }
+