Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make tracing less tightly coupled to MSG
[simgrid.git] / src / simix / ActorImpl.cpp
index b93d874..64eb25a 100644 (file)
@@ -349,7 +349,9 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
   simix_global->process_to_run.push_back(process);
   intrusive_ptr_add_ref(process);
   /* Tracing the process creation */
-  TRACE_msg_process_create(process->getName(), process->pid, process->host);
+  if (TRACE_actor_is_enabled())
+    new simgrid::instr::Container(instr_pid(process->ciface()), "ACTOR",
+                                  simgrid::instr::Container::byName(process->host->getName()));
 
   /* The onCreation() signal must be delayed until there, where the pid and everything is set */
   simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes
@@ -407,7 +409,9 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   intrusive_ptr_add_ref(process);
 
   /* Tracing the process creation */
-  TRACE_msg_process_create(process->getName(), process->pid, process->host);
+  if (TRACE_actor_is_enabled())
+    new simgrid::instr::Container(instr_pid(process->ciface()), "ACTOR",
+                                  simgrid::instr::Container::byName(process->host->getName()));
 
   auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
   if (not context)
@@ -748,8 +752,8 @@ void SIMIX_process_yield(smx_actor_t self)
     std::rethrow_exception(std::move(exception));
   }
 
-  if(SMPI_switch_data_segment){
-    SMPI_switch_data_segment(self->pid);
+  if (SMPI_switch_data_segment && not self->finished) {
+    SMPI_switch_data_segment(self->iface());
   }
 }