From 3ba5d4a966c2ac976b2b1656c52145f70189d108 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 15 Jun 2017 03:58:51 +0200 Subject: [PATCH] fix clang build --- src/kernel/activity/MailboxImpl.cpp | 4 ++-- src/msg/msg_task.cpp | 2 +- src/simix/ActorImpl.cpp | 13 +++++++------ src/simix/smx_global.cpp | 2 +- src/simix/smx_host.cpp | 8 ++++---- src/simix/smx_host_private.h | 11 ++++++----- src/simix/smx_io.cpp | 2 +- src/simix/smx_network.cpp | 8 ++++---- src/simix/smx_synchro.cpp | 2 +- teshsuite/s4u/comm-waitany/comm-waitany.cpp | 2 +- 10 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/kernel/activity/MailboxImpl.cpp b/src/kernel/activity/MailboxImpl.cpp index 81324ccaac..3f8cedc888 100644 --- a/src/kernel/activity/MailboxImpl.cpp +++ b/src/kernel/activity/MailboxImpl.cpp @@ -67,7 +67,7 @@ void MailboxImpl::remove(smx_activity_t activity) simgrid::kernel::activity::CommImplPtr comm = boost::static_pointer_cast(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_); } } } diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index 98752c1c29..42a69af2f3 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -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(); } diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 2efe7b7e59..edc1116029 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -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(); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 808f19a1ac..39c1c41507 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -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 { diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 5605745391..751916292b 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -175,7 +175,7 @@ smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name, doubl static_cast(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(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(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); diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 7537eb4245..5a953dd552 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -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 diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index d28660d0b7..a420fe13df 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -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(synchro); - XBT_DEBUG("Destroy synchro %p", synchro); + XBT_DEBUG("Destroy synchro %p", synchro.get()); if (io->surf_io) io->surf_io->unref(); } diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 080b391366..07f4c3c8e6 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -63,7 +63,7 @@ _find_matching_comm(boost::circular_buffer_space_optimized* 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) { diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 1b26ac4e9f..c4d9731312 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -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(); diff --git a/teshsuite/s4u/comm-waitany/comm-waitany.cpp b/teshsuite/s4u/comm-waitany/comm-waitany.cpp index 6e3a2af9f8..24420571c1 100644 --- a/teshsuite/s4u/comm-waitany/comm-waitany.cpp +++ b/teshsuite/s4u/comm-waitany/comm-waitany.cpp @@ -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::iterator ret_it = simgrid::s4u::Comm::wait_any(pending_comms.begin(), pending_comms.end()); XBT_INFO("Counting the number of completed comms..."); -- 2.20.1