/* 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. */
/* 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. */
namespace msg {
Task::Task(const std::string& name, double flops_amount, double bytes_amount, void* data)
namespace msg {
Task::Task(const std::string& name, double flops_amount, double bytes_amount, void* data)
- : name_(name), userdata_(data), flops_amount(flops_amount), bytes_amount(bytes_amount)
+ : name_(name), flops_amount(flops_amount), bytes_amount(bytes_amount)
if (TRACE_actor_is_enabled()) {
container_t process_container = instr::Container::by_name(instr_pid(*MSG_process_self()));
std::string key = std::string("p") + std::to_string(get_id());
if (TRACE_actor_is_enabled()) {
container_t 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);
* @param flop_amount a value of the processing amount (in flop) needed to process this new task.
* If 0, then it cannot be executed with MSG_task_execute(). This value has to be >=0.
* @param message_size a value of the amount of data (in bytes) needed to transfer this new task. If 0, then it cannot
* @param flop_amount a value of the processing amount (in flop) needed to process this new task.
* If 0, then it cannot be executed with MSG_task_execute(). This value has to be >=0.
* @param message_size a value of the amount of data (in bytes) needed to transfer this new task. If 0, then it cannot
* @return The new corresponding object.
*/
msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
{
* @return The new corresponding object.
*/
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);
* @param bytes_amount an array of @p host_nb* @p host_nb doubles.
* @param data a pointer to any data may want to attach to the new object.
* It is for user-level information and can be nullptr.
* @param bytes_amount an array of @p host_nb* @p host_nb doubles.
* @param data a pointer to any data may want to attach to the new object.
* It is for user-level information and can be nullptr.
*/
msg_task_t MSG_parallel_task_create(const char *name, int host_nb, const msg_host_t * host_list,
double *flops_amount, double *bytes_amount, void *data)
*/
msg_task_t MSG_parallel_task_create(const char *name, int host_nb, const msg_host_t * host_list,
double *flops_amount, double *bytes_amount, void *data)
}
/** @brief Sets the user data of a given task */
void MSG_task_set_data(msg_task_t task, void *data)
{
}
/** @brief Sets the user data of a given task */
void MSG_task_set_data(msg_task_t task, void *data)
{
container_t process_container = simgrid::instr::Container::by_name(instr_pid(*MSG_process_self()));
std::string key = std::string("p") + std::to_string((*task)->get_id());
container_t 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);
- /* 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();
* It works for sequential tasks, but the remaining amount of work is not a scalar value for parallel tasks.
* So you will get an exception if you call this function on parallel tasks. Just don't do it.
*/
* It works for sequential tasks, but the remaining amount of work is not a scalar value for parallel tasks.
* So you will get an exception if you call this function on parallel tasks. Just don't do it.
*/
* If the communication does not exist it will return 0.
* So, if the communication has FINISHED or FAILED it returns zero.
*/
* If the communication does not exist it will return 0.
* So, if the communication has FINISHED or FAILED it returns zero.
*/
{
XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->comm.get());
return task->comm->get_remaining();
}
/** @brief Returns the size of the data attached to the given task. */
{
XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->comm.get());
return task->comm->get_remaining();
}
/** @brief Returns the size of the data attached to the given task. */
{
xbt_assert(task != nullptr, "Invalid parameter");
return task->bytes_amount;
{
xbt_assert(task != nullptr, "Invalid parameter");
return task->bytes_amount;
* @brief Sets the tracing category of a task.
*
* This function should be called after the creation of a MSG task, to define the category of that task. The
* @brief Sets the tracing category of a task.
*
* This function should be called after the creation of a MSG task, to define the category of that task. The
* parameter category must contain a category that was previously declared with the function #TRACE_category
* (or with #TRACE_category_with_color).
*
* parameter category must contain a category that was previously declared with the function #TRACE_category
* (or with #TRACE_category_with_color).
*
*
* @param task the task that is going to be categorized
* @param category the name of the category to be associated to the task
*
* @param task the task that is going to be categorized
* @param category the name of the category to be associated to the task
* @param task the task to be considered
* @return Returns the name of the tracing category of the given task, "" otherwise
*/
* @param task the task to be considered
* @return Returns the name of the tracing category of the given task, "" otherwise
*/