X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9d6559234bf990ba2ae178296aa9a9bccc7cb366..2b2e3809f008957baa46633b02fc067bb054ca6d:/src/mc/api.cpp diff --git a/src/mc/api.cpp b/src/mc/api.cpp index 797ebd8a3e..286f3e473c 100644 --- a/src/mc/api.cpp +++ b/src/mc/api.cpp @@ -142,43 +142,44 @@ static inline smx_simcall_t MC_state_choose_request_for_process(simgrid::mc::Sta state->executed_req_ = *req; // Fetch the data of the request and translate it: state->internal_req_ = *req; + simgrid::kernel::activity::CommImpl* chosen_comm; simgrid::mc::Remote remote_comm; /* The waitany and testany request are transformed into a wait or test request over the corresponding communication * action so it can be treated later by the dependence function. */ switch (req->call_) { - case Simcall::COMM_WAITANY: { + case Simcall::COMM_WAITANY: state->internal_req_.call_ = Simcall::COMM_WAIT; - simgrid::kernel::activity::CommImpl* chosen_comm = mc_model_checker->get_remote_simulation().read( + chosen_comm = mc_model_checker->get_remote_simulation().read( remote(simcall_comm_waitany__get__comms(req) + state->transition_.times_considered_)); mc_model_checker->get_remote_simulation().read(remote_comm, remote(chosen_comm)); simcall_comm_wait__set__comm(&state->internal_req_, remote_comm.get_buffer()); simcall_comm_wait__set__timeout(&state->internal_req_, 0); break; - } - case Simcall::COMM_TESTANY: { + case Simcall::COMM_TESTANY: state->internal_req_.call_ = Simcall::COMM_TEST; - simgrid::kernel::activity::CommImpl* chosen_comm = mc_model_checker->get_remote_simulation().read( + chosen_comm = mc_model_checker->get_remote_simulation().read( remote(simcall_comm_testany__get__comms(req) + state->transition_.times_considered_)); - mc_model_checker->get_remote_simulation().read(state->internal_comm_, remote(chosen_comm)); - simcall_comm_test__set__comm(&state->internal_req_, state->internal_comm_.get_buffer()); + mc_model_checker->get_remote_simulation().read(remote_comm, remote(chosen_comm)); + simcall_comm_test__set__comm(&state->internal_req_, remote_comm.get_buffer()); simcall_comm_test__set__result(&state->internal_req_, state->transition_.times_considered_); break; - } case Simcall::COMM_WAIT: - mc_model_checker->get_remote_simulation().read(state->internal_comm_, remote(simcall_comm_wait__getraw__comm(req))); + chosen_comm = simcall_comm_wait__getraw__comm(req); + mc_model_checker->get_remote_simulation().read(state->internal_comm_, remote(chosen_comm)); simcall_comm_wait__set__comm(&state->executed_req_, state->internal_comm_.get_buffer()); simcall_comm_wait__set__comm(&state->internal_req_, state->internal_comm_.get_buffer()); break; case Simcall::COMM_TEST: - mc_model_checker->get_remote_simulation().read(state->internal_comm_, remote(simcall_comm_test__getraw__comm(req))); - simcall_comm_test__set__comm(&state->executed_req_, state->internal_comm_.get_buffer()); - simcall_comm_test__set__comm(&state->internal_req_, state->internal_comm_.get_buffer()); + chosen_comm = simcall_comm_test__getraw__comm(req); + mc_model_checker->get_remote_simulation().read(remote_comm, remote(chosen_comm)); + simcall_comm_test__set__comm(&state->executed_req_, remote_comm.get_buffer()); + simcall_comm_test__set__comm(&state->internal_req_, remote_comm.get_buffer()); break; default: