Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / src / instr / instr_platform.cpp
index e9bb5c4..9e4594c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -465,32 +465,33 @@ void define_callbacks()
     });
     s4u::Actor::on_wake_up.connect(
         [](s4u::Actor const& actor) { Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event(); });
-    s4u::Exec::on_start.connect([](s4u::Exec const&, simgrid::s4u::Actor const& actor) {
-      Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("execute");
+    s4u::Exec::on_start.connect([](s4u::Exec const&) {
+      Container::by_name(instr_pid(*s4u::Actor::self()))->get_state("ACTOR_STATE")->push_event("execute");
     });
-    s4u::Exec::on_completion.connect([](s4u::Exec const&, s4u::Actor const& actor) {
-      Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event();
+    s4u::Exec::on_completion.connect([](s4u::Exec const&) {
+      Container::by_name(instr_pid(*s4u::Actor::self()))->get_state("ACTOR_STATE")->pop_event();
     });
-    s4u::Comm::on_sender_start.connect([](s4u::Comm const&, s4u::Actor const& actor) {
-      Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("send");
+    s4u::Comm::on_start.connect([](s4u::Comm const&, bool is_sender) {
+      Container::by_name(instr_pid(*s4u::Actor::self()))
+          ->get_state("ACTOR_STATE")
+          ->push_event(is_sender ? "send" : "receive");
     });
-    s4u::Comm::on_receiver_start.connect([](s4u::Comm const&, s4u::Actor const& actor) {
-      Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("receive");
-    });
-    s4u::Comm::on_completion.connect([](s4u::Comm const&, s4u::Actor const& actor) {
-      Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event();
+    s4u::Comm::on_completion.connect([](s4u::Comm const&) {
+      Container::by_name(instr_pid(*s4u::Actor::self()))->get_state("ACTOR_STATE")->pop_event();
     });
     s4u::Actor::on_host_change.connect(on_actor_host_change);
   }
 
   if (TRACE_smpi_is_enabled() && TRACE_smpi_is_computing()) {
-    s4u::Exec::on_start.connect([](s4u::Exec const& exec, simgrid::s4u::Actor const& actor) {
-      Container::by_name(std::string("rank-") + std::to_string(actor.get_pid()))
+    s4u::Exec::on_start.connect([](s4u::Exec const& exec) {
+      Container::by_name(std::string("rank-") + std::to_string(s4u::Actor::self()->get_pid()))
           ->get_state("MPI_STATE")
           ->push_event("computing", new CpuTIData("compute", exec.get_cost()));
     });
-    s4u::Exec::on_completion.connect([](s4u::Exec const&, s4u::Actor const& actor) {
-      Container::by_name(std::string("rank-") + std::to_string(actor.get_pid()))->get_state("MPI_STATE")->pop_event();
+    s4u::Exec::on_completion.connect([](s4u::Exec const&) {
+      Container::by_name(std::string("rank-") + std::to_string(s4u::Actor::self()->get_pid()))
+          ->get_state("MPI_STATE")
+          ->pop_event();
     });
   }