-/* Copyright (c) 2004-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-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. */
s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached)
{
if (TRACE_actor_is_enabled()) {
- container_t process_container = instr::Container::by_name(instr_pid(*MSG_process_self()));
+ auto* process_container = instr::Container::by_name(instr_pid(*MSG_process_self()));
std::string key = std::string("p") + std::to_string(get_id());
- instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->start_event(process_container, "SR", key);
+ instr::Container::get_root()->get_link("ACTOR_LINK")->start_event(process_container, "SR", key);
}
/* Prepare the task to send */
*/
msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
{
- return simgrid::msg::Task::create(name ? std::string(name) : "", flop_amount, message_size, data);
+ return simgrid::msg::Task::create(name ? name : "", flop_amount, message_size, data);
}
/** @brief Creates a new parallel task
}
if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
- container_t process_container = simgrid::instr::Container::by_name(instr_pid(*MSG_process_self()));
+ auto* process_container = simgrid::instr::Container::by_name(instr_pid(*MSG_process_self()));
std::string key = std::string("p") + std::to_string((*task)->get_id());
- simgrid::instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->end_event(process_container, "SR", key);
+ simgrid::instr::Container::get_root()->get_link("ACTOR_LINK")->end_event(process_container, "SR", key);
}
return ret;
}
*/
int MSG_task_listen_from(const char* alias)
{
- /* looks inside the rdv directly. Not clean. */
- simgrid::kernel::activity::CommImplPtr comm = simgrid::s4u::Mailbox::by_name(alias)->front();
-
- if (comm && comm->src_actor_)
- return comm->src_actor_->get_pid();
- else
- return -1;
+ return simgrid::s4u::Mailbox::by_name(alias)->listen_from();
}
/** @brief Destroys the given task.