Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u_synchro were renamed to activity in 2015, as far as I remember
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 11 Mar 2021 23:03:04 +0000 (00:03 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 11 Mar 2021 23:12:38 +0000 (00:12 +0100)
src/mc/api.cpp

index 4ff1ec0..1055693 100644 (file)
@@ -233,26 +233,26 @@ bool Api::request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2) const
     return false;
 
   // Those are internal requests, we do not need indirection because those objects are copies:
-  const kernel::activity::CommImpl* synchro1 = get_comm(r1);
-  const kernel::activity::CommImpl* synchro2 = get_comm(r2);
+  const kernel::activity::CommImpl* activity1 = get_comm(r1);
+  const kernel::activity::CommImpl* activity2 = get_comm(r2);
 
   if ((r1->call_ == Simcall::COMM_ISEND || r1->call_ == Simcall::COMM_IRECV) && r2->call_ == Simcall::COMM_WAIT) {
     auto mbox                                                  = get_mbox_remote_addr(r1);
-    RemotePtr<kernel::activity::MailboxImpl> synchro2_mbox_cpy = remote(synchro2->mbox_cpy);
+    RemotePtr<kernel::activity::MailboxImpl> activity2_mbox_cpy = remote(activity2->mbox_cpy);
 
-    if (mbox != synchro2_mbox_cpy && simcall_comm_wait__get__timeout(r2) <= 0)
+    if (mbox != activity2_mbox_cpy && simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
 
-    if ((r1->issuer_ != synchro2->src_actor_.get()) && (r1->issuer_ != synchro2->dst_actor_.get()) &&
+    if ((r1->issuer_ != activity2->src_actor_.get()) && (r1->issuer_ != activity2->dst_actor_.get()) &&
         simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
 
-    if ((r1->call_ == Simcall::COMM_ISEND) && (synchro2->type_ == kernel::activity::CommImpl::Type::SEND) &&
-        (synchro2->src_buff_ != simcall_comm_isend__get__src_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
+    if ((r1->call_ == Simcall::COMM_ISEND) && (activity2->type_ == kernel::activity::CommImpl::Type::SEND) &&
+        (activity2->src_buff_ != simcall_comm_isend__get__src_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
 
-    if ((r1->call_ == Simcall::COMM_IRECV) && (synchro2->type_ == kernel::activity::CommImpl::Type::RECEIVE) &&
-        (synchro2->dst_buff_ != simcall_comm_irecv__get__dst_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
+    if ((r1->call_ == Simcall::COMM_IRECV) && (activity2->type_ == kernel::activity::CommImpl::Type::RECEIVE) &&
+        (activity2->dst_buff_ != simcall_comm_irecv__get__dst_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
   }
 
@@ -265,21 +265,21 @@ bool Api::request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2) const
 #endif
 
   if (r1->call_ == Simcall::COMM_WAIT && (r2->call_ == Simcall::COMM_WAIT || r2->call_ == Simcall::COMM_TEST) &&
-      (synchro1->src_actor_.get() == nullptr || synchro1->dst_actor_.get() == nullptr))
+      (activity1->src_actor_.get() == nullptr || activity1->dst_actor_.get() == nullptr))
     return false;
 
-  if (r1->call_ == Simcall::COMM_TEST &&
-      (simcall_comm_test__get__comm(r1) == nullptr || synchro1->src_buff_ == nullptr || synchro1->dst_buff_ == nullptr))
+  if (r1->call_ == Simcall::COMM_TEST && (simcall_comm_test__get__comm(r1) == nullptr ||
+                                          activity1->src_buff_ == nullptr || activity1->dst_buff_ == nullptr))
     return false;
 
   if (r1->call_ == Simcall::COMM_TEST && r2->call_ == Simcall::COMM_WAIT &&
-      synchro1->src_buff_ == synchro2->src_buff_ && synchro1->dst_buff_ == synchro2->dst_buff_)
+      activity1->src_buff_ == activity2->src_buff_ && activity1->dst_buff_ == activity2->dst_buff_)
     return false;
 
-  if (r1->call_ == Simcall::COMM_WAIT && r2->call_ == Simcall::COMM_TEST && synchro1->src_buff_ != nullptr &&
-      synchro1->dst_buff_ != nullptr && synchro2->src_buff_ != nullptr && synchro2->dst_buff_ != nullptr &&
-      synchro1->dst_buff_ != synchro2->src_buff_ && synchro1->dst_buff_ != synchro2->dst_buff_ &&
-      synchro2->dst_buff_ != synchro1->src_buff_)
+  if (r1->call_ == Simcall::COMM_WAIT && r2->call_ == Simcall::COMM_TEST && activity1->src_buff_ != nullptr &&
+      activity1->dst_buff_ != nullptr && activity2->src_buff_ != nullptr && activity2->dst_buff_ != nullptr &&
+      activity1->dst_buff_ != activity2->src_buff_ && activity1->dst_buff_ != activity2->dst_buff_ &&
+      activity2->dst_buff_ != activity1->src_buff_)
     return false;
 
   return true;
@@ -409,33 +409,33 @@ RemotePtr<kernel::activity::CommImpl> Api::get_comm_waitany_raw_addr(smx_simcall
 
 std::string Api::get_pattern_comm_rdv(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
-  Remote<kernel::activity::CommImpl> temp_synchro;
-  mc_model_checker->get_remote_simulation().read(temp_synchro, addr);
-  const kernel::activity::CommImpl* synchro = temp_synchro.get_buffer();
+  Remote<kernel::activity::CommImpl> temp_activity;
+  mc_model_checker->get_remote_simulation().read(temp_activity, addr);
+  const kernel::activity::CommImpl* activity = temp_activity.get_buffer();
 
   char* remote_name = mc_model_checker->get_remote_simulation().read<char*>(RemotePtr<char*>(
-      (uint64_t)(synchro->get_mailbox() ? &synchro->get_mailbox()->get_name() : &synchro->mbox_cpy->get_name())));
+      (uint64_t)(activity->get_mailbox() ? &activity->get_mailbox()->get_name() : &activity->mbox_cpy->get_name())));
   auto rdv          = mc_model_checker->get_remote_simulation().read_string(RemotePtr<char>(remote_name));
   return rdv;
 }
 
 unsigned long Api::get_pattern_comm_src_proc(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
-  Remote<kernel::activity::CommImpl> temp_synchro;
-  mc_model_checker->get_remote_simulation().read(temp_synchro, addr);
-  const kernel::activity::CommImpl* synchro = temp_synchro.get_buffer();
+  Remote<kernel::activity::CommImpl> temp_activity;
+  mc_model_checker->get_remote_simulation().read(temp_activity, addr);
+  const kernel::activity::CommImpl* activity = temp_activity.get_buffer();
   auto src_proc =
-      mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(synchro->src_actor_.get()))->get_pid();
+      mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(activity->src_actor_.get()))->get_pid();
   return src_proc;
 }
 
 unsigned long Api::get_pattern_comm_dst_proc(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
-  Remote<kernel::activity::CommImpl> temp_synchro;
-  mc_model_checker->get_remote_simulation().read(temp_synchro, addr);
-  const kernel::activity::CommImpl* synchro = temp_synchro.get_buffer();
+  Remote<kernel::activity::CommImpl> temp_activity;
+  mc_model_checker->get_remote_simulation().read(temp_activity, addr);
+  const kernel::activity::CommImpl* activity = temp_activity.get_buffer();
   auto src_proc =
-      mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(synchro->dst_actor_.get()))->get_pid();
+      mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(activity->dst_actor_.get()))->get_pid();
   return src_proc;
 }
 
@@ -687,8 +687,8 @@ bool Api::simcall_check_dependency(smx_simcall_t const req1, smx_simcall_t const
     return request_depend_asymmetric(req1, req2) && request_depend_asymmetric(req2, req1);
 
   // Those are internal requests, we do not need indirection because those objects are copies:
-  const kernel::activity::CommImpl* synchro1 = get_comm(req1);
-  const kernel::activity::CommImpl* synchro2 = get_comm(req2);
+  const kernel::activity::CommImpl* activity1 = get_comm(req1);
+  const kernel::activity::CommImpl* activity2 = get_comm(req2);
 
   switch (req1->call_) {
     case Simcall::COMM_ISEND:
@@ -696,11 +696,11 @@ bool Api::simcall_check_dependency(smx_simcall_t const req1, smx_simcall_t const
     case Simcall::COMM_IRECV:
       return simcall_comm_irecv__get__mbox(req1) == simcall_comm_irecv__get__mbox(req2);
     case Simcall::COMM_WAIT:
-      if (synchro1->src_buff_ == synchro2->src_buff_ && synchro1->dst_buff_ == synchro2->dst_buff_)
+      if (activity1->src_buff_ == activity2->src_buff_ && activity1->dst_buff_ == activity2->dst_buff_)
         return false;
-      if (synchro1->src_buff_ != nullptr && synchro1->dst_buff_ != nullptr && synchro2->src_buff_ != nullptr &&
-          synchro2->dst_buff_ != nullptr && synchro1->dst_buff_ != synchro2->src_buff_ &&
-          synchro1->dst_buff_ != synchro2->dst_buff_ && synchro2->dst_buff_ != synchro1->src_buff_)
+      if (activity1->src_buff_ != nullptr && activity1->dst_buff_ != nullptr && activity2->src_buff_ != nullptr &&
+          activity2->dst_buff_ != nullptr && activity1->dst_buff_ != activity2->src_buff_ &&
+          activity1->dst_buff_ != activity2->dst_buff_ && activity2->dst_buff_ != activity1->src_buff_)
         return false;
       return true;
     default:
@@ -749,10 +749,10 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
       } else {
         type = "Wait";
 
-        simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
+        simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_activity;
         const simgrid::kernel::activity::CommImpl* act;
-        mc_model_checker->get_remote_simulation().read(temp_synchro, remote(remote_act));
-        act = temp_synchro.get_buffer();
+        mc_model_checker->get_remote_simulation().read(temp_activity, remote(remote_act));
+        act = temp_activity.get_buffer();
 
         smx_actor_t src_proc =
             mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
@@ -766,10 +766,10 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
 
     case Simcall::COMM_TEST: {
       simgrid::kernel::activity::CommImpl* remote_act = simcall_comm_test__getraw__comm(req);
-      simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
+      simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_activity;
       const simgrid::kernel::activity::CommImpl* act;
-      mc_model_checker->get_remote_simulation().read(temp_synchro, remote(remote_act));
-      act = temp_synchro.get_buffer();
+      mc_model_checker->get_remote_simulation().read(temp_activity, remote(remote_act));
+      act = temp_activity.get_buffer();
 
       if (act->src_actor_.get() == nullptr || act->dst_actor_.get() == nullptr) {
         type = "Test FALSE";