Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill superfluous macros.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 6 Mar 2021 21:19:02 +0000 (22:19 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 7 Mar 2021 14:37:07 +0000 (15:37 +0100)
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/CommImpl.cpp
src/simix/popping_generated.cpp
src/simix/popping_private.hpp
src/simix/simcalls.py

index 6c26b63..026c416 100644 (file)
@@ -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 {
index 15ceed9..0191ebf 100644 (file)
@@ -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<simgrid::kernel::activity::CommImpl*>(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<simgrid::kernel::activity::CommImpl*>(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);
index a4f88aa..550131a 100644 (file)
@@ -56,7 +56,7 @@ constexpr std::array<const char*, simgrid::simix::NUM_SIMCALLS> 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())
index e7abda9..a0f1add 100644 (file)
@@ -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);
index a938e4f..fd8a29d 100755 (executable)
@@ -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')