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++)
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_);
}
}
}
*/
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();
}
*/
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);
* 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) {
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();
*/
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 {
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;
}
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);
{
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);
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);
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
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();
}
}
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;
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);
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;
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) {
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();
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...");