- /* reset the outgoing transition */
- simgrid::mc::ProcessState* procstate = &state->actorStates[actor->pid];
- state->transition.pid = -1;
- state->transition.argument = -1;
- state->executed_req.call = SIMCALL_NONE;
-
- if (!procstate->isTodo())
- return nullptr; // Not considered by the checker algorithm
- if (!simgrid::mc::actor_is_enabled(actor))
- return nullptr; // Not executable in the application
-
- smx_simcall_t req = nullptr;
- switch (actor->simcall.call) {
- case SIMCALL_COMM_WAITANY:
- state->transition.argument = -1;
- while (procstate->times_considered <
- read_length(mc_model_checker->process(),
- remote(simcall_comm_waitany__get__comms(&actor->simcall)))) {
- if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall,
- procstate->times_considered++)) {
- state->transition.argument = procstate->times_considered - 1;
- break;
- }
- }
-
- if (procstate->times_considered >=
- simgrid::mc::read_length(mc_model_checker->process(),
- simgrid::mc::remote(simcall_comm_waitany__get__comms(&actor->simcall))))
- procstate->setDone();
- if (state->transition.argument != -1)
- req = &actor->simcall;
- break;
-
- case SIMCALL_COMM_TESTANY: {
- unsigned start_count = procstate->times_considered;
- state->transition.argument = -1;
- while (procstate->times_considered <
- simcall_comm_testany__get__count(&actor->simcall))
- if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall,
- procstate->times_considered++)) {
- state->transition.argument = procstate->times_considered - 1;
- break;
- }
-
- if (procstate->times_considered >=
- simcall_comm_testany__get__count(&actor->simcall))
- procstate->setDone();
-
- if (state->transition.argument != -1 || start_count == 0)
- req = &actor->simcall;
-
- break;
- }
-
- case SIMCALL_COMM_WAIT: {
- simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> remote_act = remote(
- static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(&actor->simcall)));
- simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_act;
- mc_model_checker->process().read(temp_act, remote_act);
- simgrid::kernel::activity::Comm* act = temp_act.getBuffer();
- if (act->src_proc && act->dst_proc)
- state->transition.argument = 0;
- else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY
- && act->detached == 1)
- state->transition.argument = 0;
- else
- state->transition.argument = -1;
- procstate->setDone();
- req = &actor->simcall;
- break;
- }
-
- case SIMCALL_MC_RANDOM: {
- int min_value = simcall_mc_random__get__min(&actor->simcall);
- state->transition.argument = procstate->times_considered + min_value;
- procstate->times_considered++;
- if (state->transition.argument == simcall_mc_random__get__max(&actor->simcall))
- procstate->setDone();
- req = &actor->simcall;
- break;
- }
-
- default:
- procstate->setDone();
- state->transition.argument = 0;
- req = &actor->simcall;
- break;