Comm::set_payload_size() to change the size of the simulated data.
- New function: Engine::flatify_platform(), to get a fully detailed vision of the
configured platform.
+ - New Task abstraction: They are designed to represent dataflows, i.e, graphs of repeatable Activities.
+ See the examples under examples/cpp/task-* and the associated documentation.
- Full simDAG integration: Activity::start() actually starts only when all dependencies
are fullfiled. If it cannot be started right away, it will start as soon as it becomes
possible.
- Allow to set a concurrency limit on disks and hosts, as it was already the case for links.
- Rename Link::get_usage() to Link::get_load() for consistency with Host::
- Every signal now come with a static version that is invoked for every object of that class,
- and an instance version that is invoked for this specific object only. For example,
+ and an instance version that is invoked for this specific object only. For example,
s4u::Actor::on_suspend_cb() adds a callback that is invoked for the suspend of any actor while
s4u::Actor::on_this_suspend_cb() adds a callback for this specific actor only.
- Activity::on_suspended_cb() is renamed to Activity::on_suspend_cb(), and fired right before the suspend.
That is, callbacks registered in Exec::on_suspend_cb will not be fired for Comms nor Ios.
New S4U plugins:
- - Task: They are designed to represent dataflows, i.e, graphs of repeatable Activities.
- See the examples under examples/cpp/task-* and the documentation in the Plugins page.
- Battery: Enable the management of batteries on hosts.
See the examples under examples/cpp/battery-* and the documentation in the Plugins page.
- Photovoltaic: Enable the management of photovoltaic panels on hosts.
include examples/cpp/task-simple/s4u-task-simple.cpp
include examples/cpp/task-simple/s4u-task-simple.tesh
include examples/cpp/task-storm/s4u-task-storm.cpp
-include examples/cpp/task-storm/s4u-task-storm.thesh
+include examples/cpp/task-storm/s4u-task-storm.tesh
include examples/cpp/task-switch-host/s4u-task-switch-host.cpp
include examples/cpp/task-switch-host/s4u-task-switch-host.tesh
include examples/cpp/task-variable-load/s4u-task-variable-load.cpp
include include/simgrid/plugins/load.h
include include/simgrid/plugins/ns3.hpp
include include/simgrid/plugins/photovoltaic.hpp
-include include/simgrid/plugins/task.hpp
include include/simgrid/s4u.hpp
include include/simgrid/s4u/Activity.hpp
include include/simgrid/s4u/Actor.hpp
include include/simgrid/s4u/Mutex.hpp
include include/simgrid/s4u/NetZone.hpp
include include/simgrid/s4u/Semaphore.hpp
+include include/simgrid/s4u/Task.hpp
include include/simgrid/s4u/VirtualMachine.hpp
include include/simgrid/semaphore.h
include include/simgrid/simix.h
include src/mc/explo/udpor/EventSet.cpp
include src/mc/explo/udpor/EventSet.hpp
include src/mc/explo/udpor/EventSet_test.cpp
-include src/mc/explo/udpor/ExtensionSet_test.cpp
include src/mc/explo/udpor/ExtensionSetCalculator.cpp
include src/mc/explo/udpor/ExtensionSetCalculator.hpp
+include src/mc/explo/udpor/ExtensionSet_test.cpp
include src/mc/explo/udpor/History.cpp
include src/mc/explo/udpor/History.hpp
include src/mc/explo/udpor/History_test.cpp
include src/plugins/link_energy_wifi.cpp
include src/plugins/link_load.cpp
include src/plugins/photovoltaic.cpp
-include src/plugins/task.cpp
include src/plugins/vm/VmLiveMigration.cpp
include src/plugins/vm/VmLiveMigration.hpp
include src/plugins/vm/dirty_page_tracking.cpp
include src/s4u/s4u_Mutex.cpp
include src/s4u/s4u_Netzone.cpp
include src/s4u/s4u_Semaphore.cpp
+include src/s4u/s4u_Task.cpp
include src/s4u/s4u_VirtualMachine.cpp
include src/simgrid/Exception.cpp
include src/simgrid/math_utils.h
/* 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 example demonstrate basic use of the task plugin.
+/* This example demonstrate basic use of tasks.
*
* We model the following graph:
*
* comm is a communication task.
*/
-#include "simgrid/plugins/task.hpp"
+#include "simgrid/s4u/Task.hpp"
#include "simgrid/s4u.hpp"
#include <simgrid/plugins/file_system.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(task_simple, "Messages specific for this task example");
+namespace sg4 = simgrid::s4u;
int main(int argc, char* argv[])
{
- simgrid::s4u::Engine e(&argc, argv);
+ sg4::Engine e(&argc, argv);
e.load_platform(argv[1]);
- simgrid::plugins::Task::init();
// Retrieve hosts
auto* bob = e.host_by_name("bob");
auto* carl = e.host_by_name("carl");
// Create tasks
- auto exec1 = simgrid::plugins::ExecTask::init("exec1", 1e9, bob);
- auto exec2 = simgrid::plugins::ExecTask::init("exec2", 1e9, carl);
- auto write = simgrid::plugins::IoTask::init("write", 1e7, bob->get_disks().front(), simgrid::s4u::Io::OpType::WRITE);
- auto read = simgrid::plugins::IoTask::init("read", 1e7, carl->get_disks().front(), simgrid::s4u::Io::OpType::READ);
+ auto exec1 = sg4::ExecTask::init("exec1", 1e9, bob);
+ auto exec2 = sg4::ExecTask::init("exec2", 1e9, carl);
+ auto write = sg4::IoTask::init("write", 1e7, bob->get_disks().front(), sg4::Io::OpType::WRITE);
+ auto read = sg4::IoTask::init("read", 1e7, carl->get_disks().front(), sg4::Io::OpType::READ);
// Create the graph by defining dependencies between tasks
exec1->add_successor(write);
read->add_successor(exec2);
// Add a function to be called when tasks end for log purpose
- simgrid::plugins::Task::on_end_cb([](const simgrid::plugins::Task* t) {
+ sg4::Task::on_end_cb([](const sg4::Task* t) {
XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
});
/* 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 example demonstrate basic use of the task plugin.
+/* This example demonstrate basic use of tasks.
*
* We model the following graph:
*
* comm is a communication task.
*/
-#include "simgrid/plugins/task.hpp"
#include "simgrid/s4u.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(task_simple, "Messages specific for this task example");
+namespace sg4 = simgrid::s4u;
+
int main(int argc, char* argv[])
{
- simgrid::s4u::Engine e(&argc, argv);
+ sg4::Engine e(&argc, argv);
e.load_platform(argv[1]);
- simgrid::plugins::Task::init();
// Retrieve hosts
auto* tremblay = e.host_by_name("Tremblay");
auto* jupiter = e.host_by_name("Jupiter");
// Create tasks
- auto exec1 = simgrid::plugins::ExecTask::init("exec1", 1e9, tremblay);
- auto exec2 = simgrid::plugins::ExecTask::init("exec2", 1e9, jupiter);
- auto comm = simgrid::plugins::CommTask::init("comm", 1e7, tremblay, jupiter);
+ auto exec1 = sg4::ExecTask::init("exec1", 1e9, tremblay);
+ auto exec2 = sg4::ExecTask::init("exec2", 1e9, jupiter);
+ auto comm = sg4::CommTask::init("comm", 1e7, tremblay, jupiter);
// Create the graph by defining dependencies between tasks
exec1->add_successor(comm);
comm->add_successor(exec2);
// Add a function to be called when tasks end for log purpose
- simgrid::plugins::Task::on_end_cb([](const simgrid::plugins::Task* t) {
+ sg4::Task::on_end_cb([](const sg4::Task* t) {
XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
});
and use them to build a simulation of a stream processing application
Spout SA produces data every 100ms. The volume produced is alternatively 1e3, 1e6 and 1e9 bytes.
- Spout SB produces 1e6 bytes every 200ms.
-
+ Spout SB produces 1e6 bytes every 200ms.
+
Bolt B1 and B2 processes data from Spout SA alternatively. The quantity of work to process this data is 10 flops per bytes
Bolt B3 processes data from Spout SB.
Bolt B4 processes data from Bolt B3.
-
+
Fafard
┌────┐
┌──►│ B1 │
┌────┐ │ │
│ SB ├─────┤ B3 ──► B4│
└────┘ │ │
- └──────────┘
+ └──────────┘
*/
-#include "simgrid/plugins/task.hpp"
#include "simgrid/s4u.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(task_storm, "Messages specific for this s4u example");
+namespace sg4 = simgrid::s4u;
int main(int argc, char* argv[])
{
- simgrid::s4u::Engine e(&argc, argv);
+ sg4::Engine e(&argc, argv);
e.load_platform(argv[1]);
- simgrid::plugins::Task::init();
// Retrieve hosts
auto tremblay = e.host_by_name("Tremblay");
auto bourassa = e.host_by_name("Bourassa");
// Create execution tasks
- auto SA = simgrid::plugins::ExecTask::init("SA", tremblay->get_speed() * 0.1, tremblay);
- auto SB = simgrid::plugins::ExecTask::init("SB", jupiter->get_speed() * 0.2, jupiter);
- auto B1 = simgrid::plugins::ExecTask::init("B1", 1e8, fafard);
- auto B2 = simgrid::plugins::ExecTask::init("B2", 1e8, ginette);
- auto B3 = simgrid::plugins::ExecTask::init("B3", 1e8, bourassa);
- auto B4 = simgrid::plugins::ExecTask::init("B4", 2e8, bourassa);
+ auto SA = sg4::ExecTask::init("SA", tremblay->get_speed() * 0.1, tremblay);
+ auto SB = sg4::ExecTask::init("SB", jupiter->get_speed() * 0.2, jupiter);
+ auto B1 = sg4::ExecTask::init("B1", 1e8, fafard);
+ auto B2 = sg4::ExecTask::init("B2", 1e8, ginette);
+ auto B3 = sg4::ExecTask::init("B3", 1e8, bourassa);
+ auto B4 = sg4::ExecTask::init("B4", 2e8, bourassa);
// Create communication tasks
- auto SA_to_B1 = simgrid::plugins::CommTask::init("SA_to_B1", 0, tremblay, fafard);
- auto SA_to_B2 = simgrid::plugins::CommTask::init("SA_to_B2", 0, tremblay, ginette);
- auto SB_to_B3 = simgrid::plugins::CommTask::init("SB_to_B3", 1e6, jupiter, bourassa);
+ auto SA_to_B1 = sg4::CommTask::init("SA_to_B1", 0, tremblay, fafard);
+ auto SA_to_B2 = sg4::CommTask::init("SA_to_B2", 0, tremblay, ginette);
+ auto SB_to_B3 = sg4::CommTask::init("SB_to_B3", 1e6, jupiter, bourassa);
// Create the graph by defining dependencies between tasks
// Some dependencies are defined dynamically
Alternatively we: remove/add the link between SA and SA_to_B2
add/remove the link between SA and SA_to_B1
*/
- SA->on_this_start_cb([&](simgrid::plugins::Task* t) {
+ SA->on_this_start_cb([&](sg4::Task* t) {
int count = t->get_count();
- simgrid::plugins::CommTaskPtr comm;
+ sg4::CommTaskPtr comm;
if (count % 2 == 0) {
t->remove_successor(SA_to_B2);
t->add_successor(SA_to_B1);
}
std::vector<double> amount = {1e3,1e6,1e9};
comm->set_amount(amount[count % 3]);
- auto token = std::make_shared<simgrid::plugins::Token>();
+ auto token = std::make_shared<sg4::Token>();
token->set_data(new double(amount[count % 3]));
t->set_token(token);
});
// The token sent by SA is forwarded by both communication tasks
- SA_to_B1->on_this_start_cb([&](simgrid::plugins::Task* t) {
+ SA_to_B1->on_this_start_cb([&](sg4::Task* t) {
t->set_token(t->get_next_token_from(SA));
});
- SA_to_B2->on_this_start_cb([&](simgrid::plugins::Task* t) {
+ SA_to_B2->on_this_start_cb([&](sg4::Task* t) {
t->set_token(t->get_next_token_from(SA));
});
/* B1 and B2 read the value of the token received by their predecessors
and use it to adapt their amount of work to do.
- */
- B1->on_this_start_cb([&](simgrid::plugins::Task* t) {
+ */
+ B1->on_this_start_cb([&](sg4::Task* t) {
auto data = t->get_next_token_from(SA_to_B1)->get_unique_data<double>();
t->set_amount(*data * 10);
});
- B2->on_this_start_cb([&](simgrid::plugins::Task* t) {
+ B2->on_this_start_cb([&](sg4::Task* t) {
auto data = t->get_next_token_from(SA_to_B2)->get_unique_data<double>();
t->set_amount(*data * 10);
});
SB->enqueue_execs(5);
// Add a function to be called when tasks end for log purpose
- simgrid::plugins::Task::on_end_cb([]
- (const simgrid::plugins::Task* t) {
+ sg4::Task::on_end_cb([]
+ (const sg4::Task* t) {
XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
});
* With exec1 and exec2 on different hosts.
*/
-#include "simgrid/plugins/task.hpp"
#include "simgrid/s4u.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(task_switch_host, "Messages specific for this task example");
+namespace sg4 = simgrid::s4u;
int main(int argc, char* argv[])
{
- simgrid::s4u::Engine e(&argc, argv);
+ sg4::Engine e(&argc, argv);
e.load_platform(argv[1]);
- simgrid::plugins::Task::init();
// Retrieve hosts
auto* tremblay = e.host_by_name("Tremblay");
auto* fafard = e.host_by_name("Fafard");
// Create tasks
- auto comm0 = simgrid::plugins::CommTask::init("comm0");
+ auto comm0 = sg4::CommTask::init("comm0");
comm0->set_bytes(1e7);
comm0->set_source(tremblay);
- auto exec1 = simgrid::plugins::ExecTask::init("exec1", 1e9, jupiter);
- auto exec2 = simgrid::plugins::ExecTask::init("exec2", 1e9, fafard);
- auto comm1 = simgrid::plugins::CommTask::init("comm1", 1e7, jupiter, tremblay);
- auto comm2 = simgrid::plugins::CommTask::init("comm2", 1e7, fafard, tremblay);
+ auto exec1 = sg4::ExecTask::init("exec1", 1e9, jupiter);
+ auto exec2 = sg4::ExecTask::init("exec2", 1e9, fafard);
+ auto comm1 = sg4::CommTask::init("comm1", 1e7, jupiter, tremblay);
+ auto comm2 = sg4::CommTask::init("comm2", 1e7, fafard, tremblay);
// Create the initial graph by defining dependencies between tasks
comm0->add_successor(exec2);
exec2->add_successor(comm2);
// Add a function to be called when tasks end for log purpose
- simgrid::plugins::Task::on_end_cb([](const simgrid::plugins::Task* t) {
+ sg4::Task::on_end_cb([](const sg4::Task* t) {
XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
});
// Add a function to be called before each executions of comm0
// This function modifies the graph of tasks by adding or removing
// successors to comm0
- comm0->on_this_start_cb([exec1, exec2, jupiter, fafard](simgrid::plugins::Task* t) {
- auto* comm0 = dynamic_cast<simgrid::plugins::CommTask*>(t);
+ comm0->on_this_start_cb([exec1, exec2, jupiter, fafard](sg4::Task* t) {
+ auto* comm0 = dynamic_cast<sg4::CommTask*>(t);
static int count = 0;
if (count % 2 == 0) {
comm0->set_destination(jupiter);
* With a heavy load there is a burst of comm before the exec task can even finish once.
*/
-#include "simgrid/plugins/task.hpp"
#include "simgrid/s4u.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(task_variable_load, "Messages specific for this s4u example");
+namespace sg4 = simgrid::s4u;
-static void variable_load(simgrid::plugins::TaskPtr t)
+static void variable_load(sg4::TaskPtr t)
{
XBT_INFO("--- Small load ---");
for (int i = 0; i < 3; i++) {
t->enqueue_execs(1);
- simgrid::s4u::this_actor::sleep_for(100);
+ sg4::this_actor::sleep_for(100);
}
- simgrid::s4u::this_actor::sleep_until(1000);
+ sg4::this_actor::sleep_until(1000);
XBT_INFO("--- Heavy load ---");
for (int i = 0; i < 3; i++) {
t->enqueue_execs(1);
- simgrid::s4u::this_actor::sleep_for(1);
+ sg4::this_actor::sleep_for(1);
}
}
int main(int argc, char* argv[])
{
- simgrid::s4u::Engine e(&argc, argv);
+ sg4::Engine e(&argc, argv);
e.load_platform(argv[1]);
- simgrid::plugins::Task::init();
// Retreive hosts
auto* tremblay = e.host_by_name("Tremblay");
auto* jupiter = e.host_by_name("Jupiter");
// Create tasks
- auto comm = simgrid::plugins::CommTask::init("comm", 1e7, tremblay, jupiter);
- auto exec = simgrid::plugins::ExecTask::init("exec", 1e9, jupiter);
+ auto comm = sg4::CommTask::init("comm", 1e7, tremblay, jupiter);
+ auto exec = sg4::ExecTask::init("exec", 1e9, jupiter);
// Create the graph by defining dependencies between tasks
comm->add_successor(exec);
// Add a function to be called when tasks end for log purpose
- simgrid::plugins::Task::on_end_cb([](const simgrid::plugins::Task* t) {
+ sg4::Task::on_end_cb([](const sg4::Task* t) {
XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
});
// Create the actor that will inject load during the simulation
- simgrid::s4u::Actor::create("input", tremblay, variable_load, comm);
+ sg4::Actor::create("input", tremblay, variable_load, comm);
// Start the simulation
e.run();
args = parse()
e = Engine(sys.argv)
e.load_platform(args.platform)
- Task.init()
# Retrieve hosts
bob = e.host_by_name('bob')
args = parse()
e = Engine(sys.argv)
e.load_platform(args.platform)
- Task.init()
# Retrieve hosts
tremblay = e.host_by_name('Tremblay')
# runs the simulation
e.run()
-
args = parse()
e = Engine(sys.argv)
e.load_platform(args.platform)
- Task.init()
# Retrieve hosts
tremblay = e.host_by_name('Tremblay')
args = parse()
e = Engine(sys.argv)
e.load_platform(args.platform)
- Task.init()
# Retrieve hosts
tremblay = e.host_by_name('Tremblay')
#include <simgrid/s4u/Mutex.hpp>
#include <simgrid/s4u/NetZone.hpp>
#include <simgrid/s4u/Semaphore.hpp>
+#include <simgrid/s4u/Task.hpp>
#include <simgrid/s4u/VirtualMachine.hpp>
#include <simgrid/Exception.hpp>
-#ifndef SIMGRID_PLUGINS_TASK_H_
-#define SIMGRID_PLUGINS_TASK_H_
+#ifndef SIMGRID_S4U_TASK_H_
+#define SIMGRID_S4U_TASK_H_
#include <simgrid/s4u/Activity.hpp>
#include <simgrid/s4u/Io.hpp>
#include <memory>
#include <set>
-namespace simgrid::plugins {
+namespace simgrid::s4u {
class Task;
using TaskPtr = boost::intrusive_ptr<Task>;
class IoTask;
using IoTaskPtr = boost::intrusive_ptr<IoTask>;
-struct ExtendedAttributeActivity {
- static simgrid::xbt::Extension<simgrid::s4u::Activity, ExtendedAttributeActivity> EXTENSION_ID;
- Task* task_;
-};
-
class XBT_PUBLIC Token : public xbt::Extendable<Token> {};
class Task {
bool ready_to_run() const;
void receive(Task* source);
- void complete();
protected:
std::string name_;
explicit Task(const std::string& name);
virtual ~Task() = default;
virtual void fire() = 0;
+ void complete();
static xbt::signal<void(Task*)> on_start;
static xbt::signal<void(Task*)> on_end;
std::atomic_int_fast32_t refcount_{0};
public:
- static void init();
const std::string& get_name() const { return name_; }
const char* get_cname() const { return name_.c_str(); }
void enqueue_execs(int n);
IoTaskPtr set_op_type(s4u::Io::OpType type);
s4u::Io::OpType get_op_type() const { return type_; }
};
-} // namespace simgrid::plugins
+} // namespace simgrid::s4u
#endif
#include "simgrid/kernel/ProfileBuilder.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include <simgrid/Exception.hpp>
-#include <simgrid/plugins/task.hpp>
#include <simgrid/s4u/Actor.hpp>
#include <simgrid/s4u/Barrier.hpp>
#include <simgrid/s4u/Comm.hpp>
#include <simgrid/s4u/Mutex.hpp>
#include <simgrid/s4u/NetZone.hpp>
#include <simgrid/s4u/Semaphore.hpp>
+#include <simgrid/s4u/Task.hpp>
#include <simgrid/version.h>
#include <algorithm>
#include <vector>
namespace py = pybind11;
-using simgrid::plugins::CommTask;
-using simgrid::plugins::CommTaskPtr;
-using simgrid::plugins::ExecTask;
-using simgrid::plugins::ExecTaskPtr;
-using simgrid::plugins::IoTask;
-using simgrid::plugins::IoTaskPtr;
-using simgrid::plugins::Task;
-using simgrid::plugins::TaskPtr;
+using simgrid::s4u::CommTask;
+using simgrid::s4u::CommTaskPtr;
+using simgrid::s4u::ExecTask;
+using simgrid::s4u::ExecTaskPtr;
+using simgrid::s4u::IoTask;
+using simgrid::s4u::IoTaskPtr;
+using simgrid::s4u::Task;
+using simgrid::s4u::TaskPtr;
using simgrid::s4u::Actor;
using simgrid::s4u::ActorPtr;
using simgrid::s4u::Barrier;
/* Class Task */
py::class_<Task, TaskPtr>(m, "Task", "Task. See the C++ documentation for details.")
- .def_static("init", &Task::init)
.def_static(
"on_start_cb",
[](py::object cb) {
#include <memory>
#include <simgrid/Exception.hpp>
-#include <simgrid/plugins/task.hpp>
+#include <simgrid/s4u/Task.hpp>
#include <simgrid/s4u/Comm.hpp>
#include <simgrid/s4u/Exec.hpp>
#include <simgrid/s4u/Io.hpp>
#include "src/simgrid/module.hpp"
SIMGRID_REGISTER_PLUGIN(task, "Battery management", nullptr)
-/** @defgroup plugin_task plugin_task Plugin Task
-
+/**
@beginrst
-This is the task plugin, enabling management of Tasks.
-To activate this plugin, first call :cpp:func:`Task::init`.
Tasks are designed to represent dataflows, i.e, graphs of Tasks.
Tasks can only be instancied using either
-:cpp:func:`simgrid::plugins::ExecTask::init` or :cpp:func:`simgrid::plugins::CommTask::init`
+:cpp:func:`simgrid::s4u::ExecTask::init` or :cpp:func:`simgrid::s4u::CommTask::init`
An ExecTask is an Execution Task. Its underlying Activity is an :ref:`Exec <API_s4u_Exec>`.
A CommTask is a Communication Task. Its underlying Activity is a :ref:`Comm <API_s4u_Comm>`.
*/
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Task, kernel, "Logging specific to the task plugin");
-namespace simgrid::plugins {
-
-xbt::Extension<s4u::Activity, ExtendedAttributeActivity> ExtendedAttributeActivity::EXTENSION_ID;
+namespace simgrid::s4u {
xbt::signal<void(Task*)> Task::on_start;
xbt::signal<void(Task*)> Task::on_end;
fire();
}
-/** @ingroup plugin_task
- * @brief Init the Task plugin.
- * @note Add a completion callback to all Activities to call Task::complete().
- */
-void Task::init()
-{
- static bool inited = false;
- if (inited)
- return;
-
- inited = true;
- ExtendedAttributeActivity::EXTENSION_ID = simgrid::s4u::Activity::extension_create<ExtendedAttributeActivity>();
- simgrid::s4u::Exec::on_completion_cb(
- [](simgrid::s4u::Exec const& exec) { exec.extension<ExtendedAttributeActivity>()->task_->complete(); });
- simgrid::s4u::Comm::on_completion_cb(
- [](simgrid::s4u::Comm const& comm) { comm.extension<ExtendedAttributeActivity>()->task_->complete(); });
- simgrid::s4u::Io::on_completion_cb(
- [](simgrid::s4u::Io const& io) { io.extension<ExtendedAttributeActivity>()->task_->complete(); });
-}
-
-/** @ingroup plugin_task
- * @param n The number of executions to enqueue.
+/** @param n The number of executions to enqueue.
* @brief Enqueue executions.
* @note Immediatly starts an execution if possible.
*/
});
}
-/** @ingroup plugin_task
- * @param amount The amount to set.
+/** @param amount The amount to set.
* @brief Set the amout of work to do.
* @note Amount in flop for ExecTask and in bytes for CommTask.
*/
simgrid::kernel::actor::simcall_answered([this, amount] { amount_ = amount; });
}
-/** @ingroup plugin_task
- * @param token The token to set.
+/** @param token The token to set.
* @brief Set the token to send to successors.
* @note The token is passed to each successor after the task end, i.e., after the on_end callback.
*/
simgrid::kernel::actor::simcall_answered([this, token] { token_ = token; });
}
-/** @ingroup plugin_task
- * @return Map of tokens received for the next execution.
+/** @return Map of tokens received for the next execution.
* @note If there is no queued execution for this task the map might not exist or be partially empty.
*/
std::shared_ptr<Token> Task::get_next_token_from(TaskPtr t)
return tokens_received_.front()[t];
}
-/** @ingroup plugin_task
- * @param successor The Task to add.
+/** @param successor The Task to add.
* @brief Add a successor to this Task.
* @note It also adds this as a predecessor of successor.
*/
});
}
-/** @ingroup plugin_task
- * @param successor The Task to remove.
+/** @param successor The Task to remove.
* @brief Remove a successor from this Task.
* @note It also remove this from the predecessors of successor.
*/
exec->set_flops_amount(amount_);
exec->set_host(host_);
exec->start();
- exec->extension_set(new ExtendedAttributeActivity());
- exec->extension<ExtendedAttributeActivity>()->task_ = this;
+ exec->on_this_completion_cb([this](Exec const& exec) { this->complete(); });
current_activity_ = exec;
}
comm->set_name(name_);
comm->set_payload_size(amount_);
comm->start();
- comm->extension_set(new ExtendedAttributeActivity());
- comm->extension<ExtendedAttributeActivity>()->task_ = this;
+ comm->on_this_completion_cb([this](Comm const& comm) { this->complete(); });
current_activity_ = comm;
}
io->set_disk(disk_);
io->set_op_type(type_);
io->start();
- io->extension_set(new ExtendedAttributeActivity());
- io->extension<ExtendedAttributeActivity>()->task_ = this;
- current_activity_ = io;
+ io->on_this_completion_cb([this](Io const& io) { this->complete(); });
+ current_activity_ = io;
}
-} // namespace simgrid::plugins
+} // namespace simgrid::s4u
src/kernel/resource/models/network_ns3.hpp
src/kernel/resource/models/ns3/ns3_simulator.hpp
src/kernel/resource/models/ptask_L07.hpp
-
+
src/mc/datatypes.h
src/mc/mc.h
src/mc/mc_mmu.hpp
src/xbt/log_private.hpp
src/xbt/mallocator_private.h
src/xbt/parmap.hpp
-
+
src/xbt/mmalloc/mmalloc.h
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_legacy.c
src/kernel/actor/SimcallObserver.hpp
src/kernel/actor/SynchroObserver.cpp
src/kernel/actor/SynchroObserver.hpp
-
+
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextRaw.cpp
src/plugins/vm/VmLiveMigration.hpp
src/plugins/vm/dirty_page_tracking.cpp
src/plugins/battery.cpp
- src/plugins/task.cpp
src/plugins/photovoltaic.cpp
)
src/s4u/s4u_Mutex.cpp
src/s4u/s4u_Netzone.cpp
src/s4u/s4u_Semaphore.cpp
+ src/s4u/s4u_Task.cpp
src/s4u/s4u_VirtualMachine.cpp
)
src/mc/mc_replay.hpp
src/mc/transition/Transition.cpp
)
-
+
set(MC_SRC_STATELESS
src/mc/api/ActorState.hpp
src/mc/api/ClockVector.cpp
src/mc/api/State.hpp
src/mc/api/RemoteApp.cpp
src/mc/api/RemoteApp.hpp
-
+
src/mc/explo/DFSExplorer.cpp
src/mc/explo/DFSExplorer.hpp
src/mc/explo/Exploration.cpp
src/mc/explo/LivenessChecker.hpp
src/mc/explo/UdporChecker.cpp
src/mc/explo/UdporChecker.hpp
-
+
src/mc/explo/udpor/Comb.hpp
src/mc/explo/udpor/Configuration.hpp
src/mc/explo/udpor/Configuration.cpp
src/mc/explo/udpor/Unfolding.hpp
src/mc/explo/udpor/udpor_forward.hpp
src/mc/explo/udpor/udpor_tests_private.hpp
-
+
src/mc/inspect/DwarfExpression.cpp
src/mc/inspect/DwarfExpression.hpp
src/mc/inspect/Frame.cpp
src/mc/inspect/mc_unw.cpp
src/mc/inspect/mc_unw.hpp
src/mc/inspect/mc_unw_vmread.cpp
-
+
src/mc/sosp/ChunkedData.cpp
src/mc/sosp/ChunkedData.hpp
src/mc/sosp/PageStore.cpp
src/mc/api/strategy/MinMatchComm.hpp
src/mc/api/strategy/Strategy.hpp
src/mc/api/strategy/UniformStrategy.hpp
-
+
src/xbt/mmalloc/mm_interface.c
)
include/simgrid/plugins/file_system.h
include/simgrid/plugins/live_migration.h
include/simgrid/plugins/load.h
- include/simgrid/plugins/task.hpp
include/simgrid/plugins/photovoltaic.hpp
include/simgrid/plugins/ProducerConsumer.hpp
include/simgrid/instr.h
include/simgrid/s4u/Mutex.hpp
include/simgrid/s4u/NetZone.hpp
include/simgrid/s4u/Semaphore.hpp
+ include/simgrid/s4u/Task.hpp
include/simgrid/s4u/VirtualMachine.hpp
include/simgrid/s4u.hpp