Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix clang build
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 15 Jun 2017 01:58:51 +0000 (03:58 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 15 Jun 2017 01:58:51 +0000 (03:58 +0200)
src/kernel/activity/MailboxImpl.cpp
src/msg/msg_task.cpp
src/simix/ActorImpl.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_host_private.h
src/simix/smx_io.cpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp
teshsuite/s4u/comm-waitany/comm-waitany.cpp

index 81324cc..3f8cedc 100644 (file)
@@ -67,7 +67,7 @@ void MailboxImpl::remove(smx_activity_t activity)
   simgrid::kernel::activity::CommImplPtr comm =
       boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(activity);
 
-  xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm,
+  xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(),
              (comm->mbox ? comm->mbox->name_ : "(null)"), this->name_);
   comm->mbox = nullptr;
   for (auto it = this->comm_queue.begin(); it != this->comm_queue.end(); it++)
@@ -75,7 +75,7 @@ void MailboxImpl::remove(smx_activity_t activity)
       this->comm_queue.erase(it);
       return;
     }
-  xbt_die("Comm %p not found in mailbox %s", comm, this->name_);
+  xbt_die("Comm %p not found in mailbox %s", comm.get(), this->name_);
 }
 }
 }
index 98752c1..42a69af 100644 (file)
@@ -265,7 +265,7 @@ void MSG_task_set_bytes_amount(msg_task_t task, double data_size)
  */
 double MSG_task_get_remaining_communication(msg_task_t task)
 {
-  XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm);
+  XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm.get());
   return task->simdata->comm->remains();
 }
 
index 2efe7b7..edc1116 100644 (file)
@@ -81,7 +81,8 @@ int SIMIX_process_has_pending_comms(smx_actor_t process) {
  */
 void SIMIX_process_cleanup(smx_actor_t process)
 {
-  XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process, process->waiting_synchro);
+  XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process,
+            process->waiting_synchro.get());
 
   process->finished = true;
   SIMIX_process_on_exit_runall(process);
@@ -102,13 +103,13 @@ void SIMIX_process_cleanup(smx_actor_t process)
      * because src_proc or dst_proc would be an invalid pointer */
 
     if (comm->src_proc == process) {
-      XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p",
-          comm, comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
+      XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", comm.get(),
+                comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
       comm->src_proc = nullptr;
 
     } else if (comm->dst_proc == process) {
-      XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
-          comm, (int)comm->state, comm->src_proc, comm->dst_proc);
+      XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", comm.get(), (int)comm->state,
+                comm->src_proc, comm->dst_proc);
       comm->dst_proc = nullptr;
 
       if (comm->detached && comm->src_proc != nullptr) {
@@ -116,7 +117,7 @@ void SIMIX_process_cleanup(smx_actor_t process)
         comm->src_proc->comms.remove(comm);
       }
     } else {
-      xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
+      xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro.get());
     }
     process->comms.pop_front();
     synchro = process->comms.front();
index 808f19a..39c1c41 100644 (file)
@@ -681,7 +681,7 @@ void SIMIX_display_process_status()
 */
 
       XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid,
-               process->cname(), process->host->cname(), synchro_description, process->waiting_synchro,
+               process->cname(), process->host->cname(), synchro_description, process->waiting_synchro.get(),
                process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
     }
     else {
index 5605745..7519162 100644 (file)
@@ -175,7 +175,7 @@ smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name, doubl
       static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
   }
 
-  XBT_DEBUG("Create execute synchro %p: %s", exec, exec->name.c_str());
+  XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name.c_str());
 
   return exec;
 }
@@ -209,14 +209,14 @@ smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_
       exec->timeoutDetector->setData(exec.get());
     }
   }
-  XBT_DEBUG("Create parallel execute synchro %p", exec);
+  XBT_DEBUG("Create parallel execute synchro %p", exec.get());
 
   return exec;
 }
 
 void SIMIX_execution_cancel(smx_activity_t synchro)
 {
-  XBT_DEBUG("Cancel synchro %p", synchro);
+  XBT_DEBUG("Cancel synchro %p", synchro.get());
   simgrid::kernel::activity::ExecImplPtr exec =
       boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
 
@@ -244,7 +244,7 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchr
 {
   simgrid::kernel::activity::ExecImplPtr exec =
       boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
-  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state);
+  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state);
 
   /* Associate this simcall to the synchro */
   synchro->simcalls.push_back(simcall);
index 7537eb4..5a953dd 100644 (file)
@@ -48,11 +48,6 @@ XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host,
                                          int auto_restart);
 
 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
-XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name,
-    double flops_amount, double priority, double bound);
-XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
-                                                          double* flops_amount, double* bytes_amount, double amount,
-                                                          double rate, double timeout);
 XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
 XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
@@ -63,5 +58,11 @@ XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category
 
 SG_END_DECL()
 
+XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount,
+                                                 double priority, double bound);
+XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
+                                                          double* flops_amount, double* bytes_amount, double amount,
+                                                          double rate, double timeout);
+
 #endif
 
index d28660d..a420fe1 100644 (file)
@@ -179,7 +179,7 @@ int SIMIX_file_move(smx_actor_t process, smx_file_t file, const char* fullpath)
 void SIMIX_io_destroy(smx_activity_t synchro)
 {
   simgrid::kernel::activity::IoImplPtr io = boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro);
-  XBT_DEBUG("Destroy synchro %p", synchro);
+  XBT_DEBUG("Destroy synchro %p", synchro.get());
   if (io->surf_io)
     io->surf_io->unref();
 }
index 080b391..07f4c3c 100644 (file)
@@ -63,7 +63,7 @@ _find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* dequ
     }
     XBT_DEBUG("Sorry, communication synchro %p does not match our needs:"
               " its type is %d but we are looking for a comm of type %d (or maybe the filtering didn't match)",
-              comm, (int)comm->type, (int)type);
+              comm.get(), (int)comm->type, (int)type);
   }
   XBT_DEBUG("No matching communication synchro found");
   return nullptr;
@@ -113,7 +113,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx
       other_comm->state   = SIMIX_READY;
       other_comm->dst_proc=mbox->permanent_receiver.get();
       mbox->done_comm_queue.push_back(other_comm);
-      XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm);
+      XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm.get());
 
     }else{
       mbox->push(other_comm);
@@ -198,7 +198,7 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *
       mbox->push(this_synchro);
     } else {
       if (other_comm->surf_comm && other_comm->remains() < 1e-12) {
-        XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",other_comm);
+        XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
         other_comm->state = SIMIX_DONE;
         other_comm->type = SIMIX_COMM_DONE;
         other_comm->mbox = nullptr;
@@ -564,7 +564,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
         case SIMIX_LINK_FAILURE:
           XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
                     "detached:%d",
-                    synchro, comm->src_proc ? comm->src_proc->host->cname() : nullptr,
+                    synchro.get(), comm->src_proc ? comm->src_proc->host->cname() : nullptr,
                     comm->dst_proc ? comm->dst_proc->host->cname() : nullptr, simcall->issuer->cname(), simcall->issuer,
                     comm->detached);
           if (comm->src_proc == simcall->issuer) {
index 1b26ac4..c4d9731 100644 (file)
@@ -68,7 +68,7 @@ void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall)
 
 void SIMIX_synchro_finish(smx_activity_t synchro)
 {
-  XBT_IN("(%p)",synchro);
+  XBT_IN("(%p)", synchro.get());
   smx_simcall_t simcall = synchro->simcalls.front();
   synchro->simcalls.pop_front();
 
index 6e3a2af..2442057 100644 (file)
@@ -24,7 +24,7 @@ static void receiver()
   for (int i = 0; i < NUM_COMMS; i++) {
     XBT_INFO("Sleeping for 3 seconds (for the %dth time)...", i + 1);
     simgrid::s4u::this_actor::sleep_for(3.0);
-    XBT_INFO("Calling wait_any() for %ld pending comms", pending_comms.size());
+    XBT_INFO("Calling wait_any() for %zu pending comms", pending_comms.size());
     std::vector<simgrid::s4u::CommPtr>::iterator ret_it =
         simgrid::s4u::Comm::wait_any(pending_comms.begin(), pending_comms.end());
     XBT_INFO("Counting the number of completed comms...");