X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c6b1e0d38db0abceafffdc80987bd3d7f92c12c2..c4081e3a628c6ab697d7958f3f22bdf788c0c13c:/src/mc/mc_state.cpp diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 47f86822a3..e399fa2979 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -7,8 +7,8 @@ #include -#include -#include +#include "xbt/log.h" +#include "xbt/sysdep.h" #include "src/simix/smx_private.h" #include "src/mc/mc_state.h" @@ -32,7 +32,7 @@ State::State(unsigned long state_number) std::memset(&this->internal_req, 0, sizeof(this->internal_req)); std::memset(&this->executed_req, 0, sizeof(this->executed_req)); - processStates.resize(MC_smx_get_maxpid()); + actorStates.resize(MC_smx_get_maxpid()); num = state_number; /* Stateful model checking */ if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) { @@ -46,7 +46,7 @@ State::State(unsigned long state_number) std::size_t State::interleaveSize() const { - return boost::range::count_if(this->processStates, + return boost::range::count_if(this->actorStates, [](simgrid::mc::ProcessState const& p) { return p.isTodo(); }); } @@ -75,14 +75,14 @@ static inline smx_simcall_t MC_state_get_request_for_process( simgrid::mc::State* state, smx_actor_t actor) { /* reset the outgoing transition */ - simgrid::mc::ProcessState* procstate = &state->processStates[actor->pid]; + 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()) + if (not procstate->isTodo()) return nullptr; // Not considered by the checker algorithm - if (!simgrid::mc::actor_is_enabled(actor)) + if (not simgrid::mc::actor_is_enabled(actor)) return nullptr; // Not executable in the application smx_simcall_t req = nullptr; @@ -129,11 +129,11 @@ static inline smx_simcall_t MC_state_get_request_for_process( } case SIMCALL_COMM_WAIT: { - simgrid::mc::RemotePtr remote_act = remote( - static_cast(simcall_comm_wait__get__comm(&actor->simcall))); - simgrid::mc::Remote temp_act; + simgrid::mc::RemotePtr remote_act = + remote(static_cast(simcall_comm_wait__get__comm(&actor->simcall))); + simgrid::mc::Remote temp_act; mc_model_checker->process().read(temp_act, remote_act); - simgrid::kernel::activity::Comm* act = temp_act.getBuffer(); + simgrid::kernel::activity::CommImpl* 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 @@ -162,7 +162,7 @@ static inline smx_simcall_t MC_state_get_request_for_process( req = &actor->simcall; break; } - if (!req) + if (not req) return nullptr; state->transition.pid = actor->pid; @@ -180,8 +180,8 @@ static inline smx_simcall_t MC_state_get_request_for_process( read_element(mc_model_checker->process(), &remote_comm, remote(simcall_comm_waitany__get__comms(req)), state->transition.argument, sizeof(remote_comm)); - mc_model_checker->process().read(state->internal_comm, remote( - static_cast(remote_comm))); + mc_model_checker->process().read(state->internal_comm, + remote(static_cast(remote_comm))); simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer()); simcall_comm_wait__set__timeout(&state->internal_req, 0); break; @@ -193,8 +193,8 @@ static inline smx_simcall_t MC_state_get_request_for_process( if (state->transition.argument > 0) { smx_activity_t remote_comm = mc_model_checker->process().read( remote(simcall_comm_testany__get__comms(req) + state->transition.argument)); - mc_model_checker->process().read(state->internal_comm, remote( - static_cast(remote_comm))); + mc_model_checker->process().read(state->internal_comm, + remote(static_cast(remote_comm))); } simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer());