Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove redundant guard.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 12 Oct 2022 16:40:25 +0000 (18:40 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 12 Oct 2022 16:40:25 +0000 (18:40 +0200)
AppSide::ignore_heap() already returns early when not MC_is_active().

src/kernel/context/Context.cpp
src/kernel/context/ContextRaw.cpp
src/msg/msg_global.cpp
src/msg/msg_task.cpp
src/smpi/internals/smpi_actor.cpp

index 6827ff9..7f050a0 100644 (file)
@@ -104,11 +104,8 @@ void Context::set_current(Context* self)
 
 void Context::declare_context(std::size_t size)
 {
-#if SIMGRID_HAVE_MC
   /* Store the address of the stack in heap to compare it apart of heap comparison */
-  if(MC_is_active())
-    MC_ignore_heap(this, size);
-#endif
+  MC_ignore_heap(this, size);
 }
 
 Context* ContextFactory::attach(actor::ActorImpl*)
index 85e8169..5f5c842 100644 (file)
@@ -203,8 +203,7 @@ RawContext::RawContext(std::function<void()>&& code, actor::ActorImpl* actor, Sw
   if (has_code()) {
     this->stack_top_ = raw_makecontext(get_stack(), actor->get_stacksize(), smx_ctx_wrapper, this);
   } else {
-    if (MC_is_active())
-      MC_ignore_heap(&stack_top_, sizeof stack_top_);
+    MC_ignore_heap(&stack_top_, sizeof stack_top_);
   }
 }
 
index a1d475b..e699e3f 100644 (file)
@@ -49,10 +49,8 @@ void MSG_init_nocheck(int* argc, char** argv)
     });
   }
 
-  if(MC_is_active()){
-    /* Ignore total amount of messages sent during the simulation for heap comparison */
-    MC_ignore_heap(&msg_global->sent_msg, sizeof msg_global->sent_msg);
-  }
+  /* Ignore total amount of messages sent during the simulation for heap comparison */
+  MC_ignore_heap(&msg_global->sent_msg, sizeof msg_global->sent_msg);
 
   if (simgrid::config::get_value<bool>("debug/clean-atexit"))
     atexit(MSG_exit);
index fc934d2..146845c 100644 (file)
@@ -27,8 +27,7 @@ Task::Task(const std::string& name, double flops_amount, double bytes_amount, vo
   static std::atomic_ullong counter{0};
   id_ = counter++;
   set_data(data);
-  if (MC_is_active())
-    MC_ignore_heap(&id_, sizeof id_);
+  MC_ignore_heap(&id_, sizeof id_);
 }
 
 Task::Task(const std::string& name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
index e513fab..7c56710 100644 (file)
@@ -32,8 +32,7 @@ ActorExt::ActorExt(s4u::Actor* actor) : actor_(actor)
   timer_           = xbt_os_timer_new();
   state_           = SmpiProcessState::UNINITIALIZED;
   info_env_        = MPI_INFO_NULL;
-  if (MC_is_active())
-    MC_ignore_heap(timer_, xbt_os_timer_size());
+  MC_ignore_heap(timer_, xbt_os_timer_size());
 
 #if HAVE_PAPI
   if (not smpi_cfg_papi_events_file().empty()) {