From: Arnaud Giersch Date: Sat, 6 Mar 2021 21:19:02 +0000 (+0100) Subject: Kill superfluous macros. X-Git-Tag: v3.27~230 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b875e185e4ea9d8e5aec292f061354e2edc46c34 Kill superfluous macros. --- diff --git a/src/kernel/activity/ActivityImpl.cpp b/src/kernel/activity/ActivityImpl.cpp index 6c26b6386c..026c4167bb 100644 --- a/src/kernel/activity/ActivityImpl.cpp +++ b/src/kernel/activity/ActivityImpl.cpp @@ -63,7 +63,7 @@ void ActivityImpl::wait_for(actor::ActorImpl* issuer, double timeout) register_simcall(&issuer->simcall_); if (MC_is_active() || MC_record_replay_is_active()) { - int idx = SIMCALL_GET_MC_VALUE(issuer->simcall_); + int idx = issuer->simcall_.mc_value_; if (idx == 0) { state_ = simgrid::kernel::activity::State::DONE; } else { diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 15ceed9435..0191ebf65d 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -26,7 +26,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sr { simgrid::kernel::activity::ActivityImplPtr comm = simcall_HANDLER_comm_isend( simcall, src, mbox, task_size, rate, src_buff, src_buff_size, match_fun, nullptr, copy_data_fun, data, false); - SIMCALL_SET_MC_VALUE(*simcall, 0); + simcall->mc_value_ = 0; simcall_HANDLER_comm_wait(simcall, static_cast(comm.get()), timeout); } @@ -103,7 +103,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t re { simgrid::kernel::activity::ActivityImplPtr comm = simcall_HANDLER_comm_irecv( simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); - SIMCALL_SET_MC_VALUE(*simcall, 0); + simcall->mc_value_ = 0; simcall_HANDLER_comm_wait(simcall, static_cast(comm.get()), timeout); } @@ -188,7 +188,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity: comm->register_simcall(simcall); if (MC_is_active() || MC_record_replay_is_active()) { - int idx = SIMCALL_GET_MC_VALUE(*simcall); + int idx = simcall->mc_value_; if (idx == 0) { comm->state_ = simgrid::kernel::activity::State::DONE; } else { @@ -252,7 +252,7 @@ void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activi simcall_comm_testany__set__result(simcall, -1); if (MC_is_active() || MC_record_replay_is_active()) { - int idx = SIMCALL_GET_MC_VALUE(*simcall); + int idx = simcall->mc_value_; if (idx == -1) { simcall->issuer_->simcall_answer(); } else { @@ -297,7 +297,7 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activi if (MC_is_active() || MC_record_replay_is_active()) { if (timeout > 0.0) xbt_die("Timeout not implemented for waitany in the model-checker"); - int idx = SIMCALL_GET_MC_VALUE(*simcall); + int idx = simcall->mc_value_; auto* comm = comms[idx]; comm->simcalls_.push_back(simcall); simcall_comm_waitany__set__result(simcall, idx); diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index a4f88aaf9c..550131a2e7 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -56,7 +56,7 @@ constexpr std::array simcall_names{{ void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered_) { XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_.call_)); - SIMCALL_SET_MC_VALUE(simcall_, times_considered_); + simcall_.mc_value_ = times_considered_; if (simcall_.observer_ != nullptr) simcall_.observer_->prepare(times_considered_); if (context_->wannadie()) diff --git a/src/simix/popping_private.hpp b/src/simix/popping_private.hpp index e7abda9f18..a0f1add9d2 100644 --- a/src/simix/popping_private.hpp +++ b/src/simix/popping_private.hpp @@ -54,9 +54,6 @@ struct s_smx_simcall { u_smx_scalar result_ = {}; }; -#define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall).mc_value_ = (value)) -#define SIMCALL_GET_MC_VALUE(simcall) ((simcall).mc_value_) - /******************************** General *************************************/ XBT_PRIVATE const char* SIMIX_simcall_name(simgrid::simix::Simcall kind); diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index a938e4f6cb..fd8a29d893 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -337,7 +337,7 @@ if __name__ == '__main__': fd.write('void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered_)\n') fd.write('{\n') fd.write(' XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_.call_));\n') - fd.write(' SIMCALL_SET_MC_VALUE(simcall_, times_considered_);\n') + fd.write(' simcall_.mc_value_ = times_considered_;\n') fd.write(' if (simcall_.observer_ != nullptr)\n') fd.write(' simcall_.observer_->prepare(times_considered_);\n')