A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sonar green again.
[simgrid.git]
/
src
/
msg
/
msg_task.cpp
diff --git
a/src/msg/msg_task.cpp
b/src/msg/msg_task.cpp
index 4757400c927e0a55c5ca191996b37989ce5aa5c9..7cd74c2ea7357925abefbe9d8f24693f08d4bbc9 100644
(file)
--- a/
src/msg/msg_task.cpp
+++ b/
src/msg/msg_task.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2004-202
0
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-202
1
. 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. */
/* 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. */
@@
-16,6
+16,9
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
namespace simgrid {
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
namespace simgrid {
+
+template class xbt::Extendable<msg::Task>;
+
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)
@@
-25,7
+28,7
@@
Task::Task(const std::string& name, double flops_amount, double bytes_amount, vo
id_ = counter++;
set_data(data);
if (MC_is_active())
id_ = counter++;
set_data(data);
if (MC_is_active())
- MC_ignore_heap(&
(id_), sizeof(id_)
);
+ MC_ignore_heap(&
id_, sizeof id_
);
}
Task::Task(const std::string& name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
}
Task::Task(const std::string& name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
@@
-100,9
+103,9
@@
msg_error_t Task::execute()
s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached)
{
if (TRACE_actor_is_enabled()) {
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());
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 */
}
/* Prepare the task to send */
@@
-210,17
+213,17
@@
void Task::report_multiple_use() const
*/
msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
{
*/
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
*
* A constructor for #msg_task_t taking six arguments.
*
}
/** @brief Creates a new parallel task
*
* A constructor for #msg_task_t taking six arguments.
*
- *
\
rst
+ *
@begin
rst
* See :cpp:func:`void simgrid::s4u::this_actor::parallel_execute(int, s4u::Host**, double*, double*)` for
* the exact semantic of the parameters.
* See :cpp:func:`void simgrid::s4u::this_actor::parallel_execute(int, s4u::Host**, double*, double*)` for
* the exact semantic of the parameters.
- *
\
endrst
+ *
@
endrst
*
* @param name a name for the object. It is for user-level information and can be nullptr.
* @param host_nb the number of hosts implied in the parallel task.
*
* @param name a name for the object. It is for user-level information and can be nullptr.
* @param host_nb the number of hosts implied in the parallel task.
@@
-570,10
+573,10
@@
msg_error_t MSG_task_receive_with_timeout_bounded(msg_task_t* task, const char*
}
if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
}
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());
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;
}
}
return ret;
}
@@
-634,13
+637,7
@@
msg_comm_t MSG_task_irecv_bounded(msg_task_t* task, const char* name, double rat
*/
int MSG_task_listen_from(const char* alias)
{
*/
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.
}
/** @brief Destroys the given task.
@@
-703,7
+700,7
@@
double MSG_task_get_remaining_work_ratio(const_msg_task_t task)
*/
double MSG_task_get_flops_amount(const_msg_task_t task)
{
*/
double MSG_task_get_flops_amount(const_msg_task_t task)
{
- if (task->compute != nullptr) {
+ if (task->compute != nullptr
&& task->compute->get_state() == simgrid::s4u::Activity::State::STARTED
) {
return task->compute->get_remaining();
} else {
// Not started or already done.
return task->compute->get_remaining();
} else {
// Not started or already done.