8 <object id="TOC" data="graphical-toc.svg" type="image/svg+xml"></object>
10 window.onload=function() { // Wait for the SVG to be loaded before changing it
11 var elem=document.querySelector("#TOC").contentDocument.getElementById("ActorBox")
12 elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
18 The S4U interface (SimGrid for you) mixes the full power of SimGrid
19 with the full power of C++. This is the preferred interface to describe
20 abstract algorithms in the domains of Cloud, P2P, HPC, IoT, and similar
23 Since v3.33 (Spring 2023), S4U is the main interface of SimGrid for algorithms.
24 It is feature complete, but may still evolve slightly in future releases.
25 When this happens, compiling your code will produce deprecation warnings for 4
26 releases (one year) before the removal of the old symbols.
28 .. _S4U_main_concepts:
33 A typical SimGrid simulation is composed of several |API_s4u_Actors|_, that
34 execute user-provided functions. The actors have to explicitly use the
35 S4U interface to express their :ref:`computation <API_s4u_Exec>`,
36 :ref:`communication <API_s4u_Comm>`, :ref:`disk usage <API_s4u_Io>`,
37 and other |API_s4u_Activities|_, so that they get reflected within the
38 simulator. These activities take place on resources such as |API_s4u_Hosts|_,
39 |API_s4u_Links|_, and |API_s4u_Disks|_. SimGrid predicts the time taken by each
40 activity and orchestrates the actors accordingly, waiting for the
41 completion of these activities.
44 When **communicating**, data is not directly sent to other actors but
45 posted onto a |API_s4u_Mailbox|_ that serves as a rendezvous point between
46 communicating actors. This means that you don't need to know who you
47 are talking to, you just put your communication `Put` request in a
48 mailbox, and it will be matched with a complementary `Get`
49 request. Alternatively, actors can interact through **classical
50 synchronization mechanisms** such as |API_s4u_Barrier|_, |API_s4u_Semaphore|_,
51 |API_s4u_Mutex|_, and |API_s4u_ConditionVariable|_.
53 Each actor is located on a simulated |API_s4u_Host|_. Each host is located
54 in a |API_s4u_NetZone|_, that knows the networking path between one
55 resource to another. Each NetZone is included in another one, forming
56 a tree of NetZones which root zone contains the whole platform. The
57 actors can also be located on a |API_s4U_VirtualMachine|_ that may
58 restrict the activities it contains to a limited amount of cores.
59 Virtual machines can also be migrated between hosts.
61 The :ref:`simgrid::s4u::this_actor <API_s4u_this_actor>` namespace
62 provides many helper functions to simplify the code of actors.
64 .. rst-class:: compact-list
66 - **Simulation Elements**
68 - :ref:`class Actor <API_s4u_Actor>`: Active entities executing your application.
69 - :ref:`class Engine <API_s4u_Engine>`: Simulation engine (singleton).
70 - :ref:`class Mailbox <API_s4u_Mailbox>`: Communication rendezvous, with which actors meet each other.
74 - :ref:`class Disk <API_s4u_Disk>`: Resource on which actors can write and read data.
75 - :ref:`class Host <API_s4u_Host>`: Actor location, providing computational power.
76 - :ref:`class Link <API_s4u_Link>`: Interconnecting hosts.
77 - :ref:`class NetZone <API_s4u_NetZone>`: Sub-region of the platform, containing resources (Hosts, Links, etc).
78 - :ref:`class VirtualMachine <API_s4u_VirtualMachine>`: Execution containers that can be moved between Hosts.
80 - **Activities** (:ref:`class Activity <API_s4u_Activity>`): The things that actors can do on resources.
82 - :ref:`class Comm <API_s4u_Comm>`: Communication activity, started on Mailboxes and consuming links.
83 - :ref:`class Exec <API_s4u_Exec>`: Computation activity, started on Host and consuming CPU resources.
84 - :ref:`class Io <API_s4u_Io>`: I/O activity, started on and consuming disks.
86 - **Synchronization Objects**: Classical IPC that actors can use
88 - :ref:`class Barrier <API_s4u_Barrier>`
89 - :ref:`class ConditionVariable <API_s4u_ConditionVariable>`
90 - :ref:`class Mutex <API_s4u_Mutex>`
91 - :ref:`class Semaphore <API_s4u_Semaphore>`
93 .. |API_s4u_Actors| replace:: **Actors**
94 .. _API_s4u_Actors: #api-s4u-actor
96 .. |API_s4u_Activities| replace:: **Activities**
97 .. _API_s4u_Activities: #api-s4u-activity
99 .. |API_s4u_Tasks| replace:: **Tasks**
100 .. _API_s4u_Tasks: #api-s4u-task
102 .. |API_s4u_Hosts| replace:: **Hosts**
103 .. _API_s4u_Hosts: #api-s4u-host
105 .. |API_s4u_Links| replace:: **Links**
106 .. _API_s4u_Links: #api-s4u-link
108 .. |API_s4u_Disks| replace:: **Disks**
109 .. _API_s4u_Disks: #api-s4u-disk
111 .. |API_s4u_VirtualMachine| replace:: **VirtualMachines**
113 .. |API_s4u_Host| replace:: **Host**
115 .. |API_s4u_Mailbox| replace:: **Mailbox**
117 .. |API_s4u_Mailboxes| replace:: **Mailboxes**
118 .. _API_s4u_Mailboxes: #s4u-mailbox
120 .. |API_s4u_NetZone| replace:: **NetZone**
122 .. |API_s4u_Barrier| replace:: **Barrier**
124 .. |API_s4u_Semaphore| replace:: **Semaphore**
126 .. |API_s4u_ConditionVariable| replace:: **ConditionVariable**
128 .. |API_s4u_Mutex| replace:: **Mutex**
135 Activities represent the actions that consume a resource, such as a
136 :ref:`Comm <API_s4u_Comm>` that consumes the *transmitting power* of
137 :ref:`Link <API_s4u_Link>` resources, or an :ref:`Exec <API_s4u_Exec>`
138 that consumes the *computing power* of :ref:`Host <API_s4u_Host>` resources.
139 See also the :ref:`full API <API_s4u_Activity>` below.
141 =======================
142 Asynchronous Activities
143 =======================
145 Every activity can be either **blocking** or **asynchronous**. For
146 example, :cpp:func:`s4u::Mailbox::put() <simgrid::s4u::Mailbox::put>`
147 and :cpp:func:`s4u::Mailbox::get() <simgrid::s4u::Mailbox::get>`
148 create blocking communications: the actor is blocked until the
149 completion of that communication. Asynchronous communications do not
150 block the actor during their execution but progress on their own.
152 Once your asynchronous activity is started, you can test for its
153 completion using :cpp:func:`s4u::Activity::test() <simgrid::s4u::Activity::test>`.
154 This function returns ``true`` if the activity is completed already.
155 You can also use :cpp:func:`s4u::Activity::wait() <simgrid::s4u::Activity::wait>`
156 to block until the completion of the activity. To wait for at most a given amount of time,
157 use :cpp:func:`s4u::Activity::wait_for() <simgrid::s4u::Activity::wait_for>`.
158 Finally, to wait at most until a specified time limit, use
159 :cpp:func:`s4u::Activity::wait_until() <simgrid::s4u::Activity::wait_until>`.
161 Every kind of activity can be asynchronous.
162 :ref:`s4u::CommPtr <API_s4u_Comm>` are created with :cpp:func:`s4u::Mailbox::put_async() <simgrid::s4u::Mailbox::put_async>` and
163 :cpp:func:`s4u::Mailbox::get_async() <simgrid::s4u::Mailbox::get_async>`;
164 :ref:`s4u::IoPtr <API_s4u_Io>` are created with :cpp:func:`s4u::Disk::read_async() <simgrid::s4u::Disk::read_async>` and
165 :cpp:func:`s4u::Disk::write_async() <simgrid::s4u::Disk::write_async>`; and
166 :ref:`s4u::ExecPtr <API_s4u_Exec>` are created with
167 :cpp:func:`s4u::Host::exec_async() <simgrid::s4u::Host::exec_async>`.
168 In the future, it will become possible to have asynchronous IPC such as asynchronous mutex lock requests.
170 The following example shows how to have several concurrent
171 communications ongoing. First, you have to declare a vector in which
172 we will store the ongoing communications. It is also useful to have a
175 .. literalinclude:: ../../examples/cpp/comm-waitall/s4u-comm-waitall.cpp
177 :start-after: init-begin
178 :end-before: init-end
181 Then, you start all the communications that should occur concurrently with
182 :cpp:func:`s4u::Mailbox::put_async() <simgrid::s4u::Mailbox::put_async>`.
183 Finally, the actor waits for the completion of all of them at once
184 with :cpp:func:`s4u::Comm::wait_all() <simgrid::s4u::Comm::wait_all>`.
186 .. literalinclude:: ../../examples/cpp/comm-waitall/s4u-comm-waitall.cpp
188 :start-after: put-begin
192 =====================
193 Activities Life Cycle
194 =====================
196 Sometimes, you want to change the setting of an activity before it even starts.
198 .. todo:: write this section
200 =====================
201 Repeatable Activities
202 =====================
204 In order to simulate the execution of Dataflow applications, we introduced the
205 concept of |API_s4u_Tasks|, that can be seen as repeatable activities. A Dataflow
206 is defined as a graph of |API_s4u_Tasks| through which circulate Tokens. Tokens
207 can carry any user-defined data, using the same internal mechanisms as for the
208 other simulated objects. Each Task has to receive a token from each of its
209 predecessor to fire a new instance of a |API_s4u_Comm|, |API_s4u_Exec|, or
210 |API_s4u_Io| activity. On completion of this activity, the Task propagates tokens
211 to its successors, and waits for the next set of tokens to arrive.
213 To initiate the execution of a Dataflow, it is possible to some make
214 |API_s4u_Tasks| fire one or more activities without waiting for any token with the
215 :cpp:func:`s4u::Task::enqueue_firings() <simgrid::s4u::Task::enqueue_firings>`
218 The parameters and successors of a Task can be redefined at runtime by attaching
220 :cpp:func:`s4u::Task::on_this_start <simgrid::s4u::Task::on_this_start>`
222 :cpp:func:`s4u::Task::on_this_completion <simgrid::s4u::Task::on_this_completion>`
231 Please also refer to the :ref:`API reference for s4u::Mailbox
238 |API_s4u_Mailboxes|_ are rendezvous points for network communications,
239 similar to URLs on which you could post and retrieve data. Actually,
240 the mailboxes are not involved in the communication once it starts,
241 but only to find the contact with which you want to communicate.
243 They are similar to many common things: The phone number, which allows
244 the caller to find the receiver. The Twitter hashtag, which helps
245 senders and receivers to find each other. In TCP, the pair
246 ``{host name, host port}`` to which you can connect to find your peer.
247 In HTTP, URLs through which the clients can connect to the servers.
248 In ZeroMQ, the queues are used to match senders and receivers.
250 One big difference with most of these systems is that no actor is the
251 exclusive owner of a mailbox, neither in sending nor in receiving.
252 Many actors can send into and/or receive from the same mailbox. TCP
253 socket ports for example are shared on the sender side but exclusive
254 on the receiver side (only one process can receive from a given socket
255 at a given point of time).
257 A big difference with TCP sockets or MPI communications is that
258 communications do not start right away after a
259 :cpp:func:`Mailbox::put() <simgrid::s4u::Mailbox::put>`, but wait
260 for the corresponding :cpp:func:`Mailbox::get() <simgrid::s4u::Mailbox::get>`.
261 You can change this by :ref:`declaring a receiving actor <s4u_receiving_actor>`.
263 A big difference with Twitter hashtags is that SimGrid does not
264 offer easy support to broadcast a given message to many
265 receivers. So that would be like a Twitter tag where each message
266 is consumed by the first receiver.
268 A big difference with the ZeroMQ queues is that you cannot filter
269 on the data you want to get from the mailbox. To model such settings
270 in SimGrid, you'd have one mailbox per potential topic, and subscribe
271 to each topic individually with a
272 :cpp:func:`get_async() <simgrid::s4u::Mailbox::get_async>` on each mailbox.
273 Then, use :cpp:func:`Comm::wait_any() <simgrid::s4u::Comm::wait_any>`
274 to get the first message on any of the mailboxes you are subscribed to.
276 The mailboxes are not located on the network, and you can access
277 them without any latency. The network delays are only related to the
278 location of the sender and receiver once the match between them is
279 done on the mailbox. This is just like the phone number that you
280 can use locally, and the geographical distance only comes into play
281 once you start the communication by dialing this number.
283 =====================
284 How to use Mailboxes?
285 =====================
287 You can retrieve any existing mailbox from its name (which is a
288 unique string, just like a Twitter tag). This results in a
289 versatile tool that can be used to build many different
292 To model classical socket communications, use "hostname:port" as
293 mailbox names, and make sure that only one actor reads into a given
294 mailbox. This does not make it easy to build a perfectly realistic
295 model of the TCP sockets, but in most cases, this system is too
296 cumbersome for your simulations anyway. You probably want something
297 simpler, that turns out to be easy to build with the mailboxes.
299 Many SimGrid examples use a sort of yellow page system where the
300 mailbox names are the name of the service (such as "worker",
301 "master", or "reducer"). That way, you don't have to know where your
302 peer is located to contact it. You don't even need its name. Its
303 function is enough for that. This also gives you some sort of load
304 balancing for free if more than one actor pulls from the mailbox:
305 the first actor that can deal with the request will handle it.
307 =========================================
308 How are put() and get() requests matched?
309 =========================================
311 The matching algorithm simple: first come, first serve. When a new
312 send arrives, it matches the oldest enqueued receive. If no receive is
313 currently enqueued, then the incoming send is enqueued. As you can
314 see, the mailbox cannot contain both send and receive requests: all
315 enqueued requests must be of the same sort.
317 .. _s4u_receiving_actor:
319 ===========================
320 Declaring a Receiving Actor
321 ===========================
323 The last twist is that by default in the simulator, the data starts
324 to be exchanged only when both the sender and the receiver are
325 announced (it waits until both :cpp:func:`put() <simgrid::s4u::Mailbox::put()>`
326 and :cpp:func:`get() <simgrid::s4u::Mailbox::get()>` are posted).
327 In TCP, since you establish connections beforehand, the data starts to
328 flow as soon as the sender posts it, even if the receiver did not post
329 its :cpp:func:`put() <simgrid::s4u::Mailbox::put()>` yet.
331 To model this in SimGrid, you can declare a specific receiver to a
332 given mailbox (with the function
333 :cpp:func:`set_receiver() <simgrid::s4u::Mailbox::set_receiver()>`).
334 That way, any :cpp:func:`put() <simgrid::s4u::Mailbox::put()>`
335 posted to that mailbox will start as soon as possible, and the data
336 will already be there on the receiver host when the receiver actor
337 posts its :cpp:func:`get() <simgrid::s4u::Mailbox::get()>`
339 Note that being permanent receivers of a mailbox prevents actors to be
340 garbage-collected. If your simulation creates many short-lived actors
341 that are marked as permanent receiver, you should call
342 ``mailbox->set_receiver(nullptr)`` by the end of the actors so that their
343 memory gets properly reclaimed. This call should be at the end of the
344 actor's function, not in an on_exit callback.
346 ===============================
347 Communicating without Mailboxes
348 ===============================
350 Sometimes you don't want to simulate communications between actors as
351 allowed by mailboxes, but you want to create a direct communication
352 between two arbitrary hosts. This can arise when you write a
353 high-level model of a centralized scheduler, or when you model direct
354 communications such as one-sided communications in MPI or remote
355 memory direct access in PGAS.
357 For that, :cpp:func:`Comm::sendto() <simgrid::s4u::Comm::sendto()>`
358 simulates a direct communication between the two specified hosts. No
359 mailbox is used, and there is no rendezvous between actors. You can
360 freely mix such direct communications and rendezvous-based
361 communications. Alternatively, :cpp:func:`Comm::sendto_init()
362 <simgrid::s4u::Comm::sendto_init()>` and
363 :cpp:func:`Comm::sendto_async() <simgrid::s4u::Comm::sendto_async()>`
364 create asynchronous direct communications.
371 For sake of simplicity, we use `RAII
372 <https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
373 for many classes in S4U. This is an idiom where resources are automatically
374 managed through the context. Provided that you never manipulate
375 objects of type Foo directly but always FooPtr references (which are
376 defined as `boost::intrusive_ptr
377 <http://www.boost.org/doc/libs/1_61_0/libs/smart_ptr/intrusive_ptr.html>`_
378 <Foo>), you will never have to explicitly release the resource that
379 you use nor to free the memory of unused objects.
380 Here is a little example:
386 simgrid::s4u::MutexPtr mutex = simgrid::s4u::Mutex::create(); // Too bad we cannot use `new`
388 mutex->lock(); // use the mutex as a simple reference
392 } // The mutex gets automatically freed because the only existing reference gets out of scope
394 Note that Mailboxes, Hosts, and Links are not handled through smart
395 pointers (yet?). This means that it is currently impossible to destroy a
396 mailbox or a link. You can still destroy a host (but probably
397 shouldn't), using :cpp:func:`simgrid::s4u::Host::destroy`.
402 .. _API_s4u_simulation_object:
418 .. doxygenclass:: simgrid::s4u::Actor
420 .. doxygentypedef:: aid_t
423 .. group-tab:: Python
425 .. autoclass:: simgrid.Actor
436 #include <simgrid/s4u/Actor.hpp>
438 .. doxygentypedef:: ActorPtr
440 .. group-tab:: Python
444 from simgrid import Actor
450 #include <simgrid/actor.h>
452 .. doxygentypedef:: sg_actor_t
453 .. doxygentypedef:: const_sg_actor_t
454 .. doxygenfunction:: sg_actor_ref
455 .. doxygenfunction:: sg_actor_unref
461 See also :ref:`the relevant example <s4u_ex_actors_create>`.
467 .. doxygenfunction:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, const std::function< void()> &code)
468 .. doxygenfunction:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, F code)
469 .. doxygenfunction:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, F code, Args... args)
470 .. doxygenfunction:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, const std::string &function, std::vector< std::string > args)
472 .. doxygenfunction:: simgrid::s4u::Actor::init(const std::string &name, s4u::Host *host)
473 .. doxygenfunction:: simgrid::s4u::Actor::start(const std::function< void()> &code)
474 .. doxygenfunction:: simgrid::s4u::Actor::set_stacksize
476 .. group-tab:: Python
478 .. automethod:: simgrid.Actor.create
482 .. doxygenfunction:: sg_actor_create(const char *name, sg_host_t host, xbt_main_func_t code, int argc, char *const *argv)
483 .. doxygenfunction:: sg_actor_init(const char *name, sg_host_t host)
484 .. doxygenfunction:: sg_actor_start(sg_actor_t actor, xbt_main_func_t code, int argc, char *const *argv)
485 .. doxygenfunction:: sg_actor_set_stacksize
487 .. doxygenfunction:: sg_actor_attach(const char *name, void *data, sg_host_t host, xbt_dict_t properties)
488 .. doxygenfunction:: sg_actor_detach()
497 .. doxygenfunction:: simgrid::s4u::Actor::by_pid(aid_t pid)
498 .. doxygenfunction:: simgrid::s4u::Actor::self()
500 .. group-tab:: Python
502 .. automethod:: simgrid.Actor.by_pid
503 .. automethod:: simgrid.Actor.self
507 .. doxygenfunction:: sg_actor_by_pid(aid_t pid)
508 .. doxygenfunction:: sg_actor_self()
509 .. doxygenfunction:: sg_actor_list()
518 .. doxygenfunction:: simgrid::s4u::Actor::get_cname
519 .. doxygenfunction:: simgrid::s4u::Actor::get_name
520 .. doxygenfunction:: simgrid::s4u::Actor::get_pid
521 .. doxygenfunction:: simgrid::s4u::Actor::get_ppid
522 .. doxygenfunction:: simgrid::s4u::Actor::get_properties() const
523 .. doxygenfunction:: simgrid::s4u::Actor::get_property(const std::string &key) const
524 .. doxygenfunction:: simgrid::s4u::Actor::set_property(const std::string &key, const std::string &value)
526 .. doxygenfunction:: simgrid::s4u::Actor::get_host
527 .. doxygenfunction:: simgrid::s4u::Actor::set_host
529 .. doxygenfunction:: simgrid::s4u::Actor::get_refcount
530 .. doxygenfunction:: simgrid::s4u::Actor::get_impl
532 .. group-tab:: Python
534 .. autoattribute:: simgrid.Actor.name
535 .. autoattribute:: simgrid.Actor.host
536 .. autoattribute:: simgrid.Actor.pid
537 .. autoattribute:: simgrid.Actor.ppid
541 .. doxygenfunction:: sg_actor_get_name(const_sg_actor_t actor)
542 .. doxygenfunction:: sg_actor_get_pid(const_sg_actor_t actor)
543 .. doxygenfunction:: sg_actor_get_ppid(const_sg_actor_t actor)
544 .. doxygenfunction:: sg_actor_get_properties(const_sg_actor_t actor)
545 .. doxygenfunction:: sg_actor_get_property_value(const_sg_actor_t actor, const char *name)
547 .. doxygenfunction:: sg_actor_get_host(const_sg_actor_t actor)
548 .. doxygenfunction:: sg_actor_set_host(sg_actor_t actor, sg_host_t host)
550 .. doxygenfunction:: sg_actor_get_data(const_sg_actor_t actor)
551 .. doxygenfunction:: sg_actor_set_data(sg_actor_t actor, void *userdata)
553 Suspending and resuming actors
554 ------------------------------
560 .. doxygenfunction:: simgrid::s4u::Actor::suspend()
561 .. doxygenfunction:: simgrid::s4u::Actor::resume()
562 .. doxygenfunction:: simgrid::s4u::Actor::is_suspended
564 .. group-tab:: Python
566 .. automethod:: simgrid.Actor.resume
567 .. automethod:: simgrid.Actor.suspend
568 .. automethod:: simgrid.Actor.is_suspended
572 .. doxygenfunction:: sg_actor_suspend(sg_actor_t actor)
573 .. doxygenfunction:: sg_actor_resume(sg_actor_t actor)
574 .. doxygenfunction:: sg_actor_is_suspended(const_sg_actor_t actor)
576 Specifying when actors should terminate
577 ---------------------------------------
583 .. doxygenfunction:: simgrid::s4u::Actor::kill()
584 .. doxygenfunction:: simgrid::s4u::Actor::kill_all()
585 .. doxygenfunction:: simgrid::s4u::Actor::set_kill_time(double time)
586 .. doxygenfunction:: simgrid::s4u::Actor::get_kill_time
588 .. doxygenfunction:: simgrid::s4u::Actor::restart()
589 .. doxygenfunction:: simgrid::s4u::Actor::daemonize()
590 .. doxygenfunction:: simgrid::s4u::Actor::is_daemon
592 .. group-tab:: Python
594 .. automethod:: simgrid.Actor.kill
595 .. automethod:: simgrid.Actor.kill_all
597 .. automethod:: simgrid.Actor.daemonize
598 .. automethod:: simgrid.Actor.is_daemon
602 .. doxygenfunction:: sg_actor_kill(sg_actor_t actor)
603 .. doxygenfunction:: sg_actor_kill_all()
604 .. doxygenfunction:: sg_actor_set_kill_time(sg_actor_t actor, double kill_time)
606 .. doxygenfunction:: sg_actor_restart(sg_actor_t actor)
607 .. doxygenfunction:: sg_actor_daemonize(sg_actor_t actor)
608 .. doxygenfunction:: sg_actor_is_daemon
610 .. _API_s4u_Actor_end:
612 Reacting to the end of actors
613 -----------------------------
619 .. doxygenfunction:: simgrid::s4u::Actor::on_exit
620 .. doxygenfunction:: simgrid::s4u::Actor::join() const
621 .. doxygenfunction:: simgrid::s4u::Actor::join(double timeout) const
622 .. doxygenfunction:: simgrid::s4u::Actor::set_auto_restart(bool autorestart)
623 .. doxygenfunction:: simgrid::s4u::Actor::get_restart_count
625 .. group-tab:: Python
627 .. automethod:: simgrid.Actor.join
631 .. doxygenfunction:: sg_actor_on_exit
632 .. doxygenfunction:: sg_actor_join(const_sg_actor_t actor, double timeout)
633 .. doxygenfunction:: sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart)
642 .. doxygenfunction:: simgrid::s4u::Actor::on_creation_cb
643 .. doxygenfunction:: simgrid::s4u::Actor::on_suspend_cb
644 .. doxygenfunction:: simgrid::s4u::Actor::on_this_suspend_cb
645 .. doxygenfunction:: simgrid::s4u::Actor::on_host_change_cb
646 .. doxygenfunction:: simgrid::s4u::Actor::on_this_host_change_cb
647 .. doxygenfunction:: simgrid::s4u::Actor::on_resume_cb
648 .. doxygenfunction:: simgrid::s4u::Actor::on_this_resume_cb
649 .. doxygenfunction:: simgrid::s4u::Actor::on_sleep_cb
650 .. doxygenfunction:: simgrid::s4u::Actor::on_this_sleep_cb
651 .. doxygenfunction:: simgrid::s4u::Actor::on_wake_up_cb
652 .. doxygenfunction:: simgrid::s4u::Actor::on_this_wake_up_cb
653 .. doxygenfunction:: simgrid::s4u::Actor::on_termination_cb
654 .. doxygenfunction:: simgrid::s4u::Actor::on_this_termination_cb
655 .. doxygenfunction:: simgrid::s4u::Actor::on_destruction_cb
656 .. doxygenfunction:: simgrid::s4u::Actor::on_this_destruction_cb
658 .. _API_s4u_this_actor:
664 These functions can be used in your user code to interact with the actor
665 currently running (the one retrieved with :cpp:func:`simgrid::s4u::Actor::self`).
666 Using these functions can greatly improve the code readability.
675 .. doxygenfunction:: simgrid::s4u::this_actor::get_cname()
676 .. doxygenfunction:: simgrid::s4u::this_actor::get_name()
677 .. doxygenfunction:: simgrid::s4u::this_actor::get_pid()
678 .. doxygenfunction:: simgrid::s4u::this_actor::get_ppid()
679 .. doxygenfunction:: simgrid::s4u::this_actor::is_maestro()
681 .. doxygenfunction:: simgrid::s4u::this_actor::get_host()
682 .. doxygenfunction:: simgrid::s4u::this_actor::set_host(Host *new_host)
684 .. group-tab:: Python
686 .. autofunction:: simgrid.this_actor.get_host
687 .. autofunction:: simgrid.this_actor.set_host
689 .. autofunction:: simgrid.this_actor.get_pid
690 .. autofunction:: simgrid.this_actor.get_ppid
694 .. doxygenfunction:: sg_actor_self_get_data()
695 .. doxygenfunction:: sg_actor_self_set_data(void *data)
696 .. doxygenfunction:: sg_actor_self_get_name()
697 .. doxygenfunction:: sg_actor_self_get_pid()
698 .. doxygenfunction:: sg_actor_self_get_ppid()
699 .. doxygenfunction:: sg_host_self()
700 .. doxygenfunction:: sg_host_self_get_name()
702 Suspending and resuming
703 -----------------------
709 .. doxygenfunction:: simgrid::s4u::this_actor::suspend()
710 .. doxygenfunction:: simgrid::s4u::this_actor::yield()
712 .. group-tab:: Python
714 .. autofunction:: simgrid.this_actor.suspend
715 .. autofunction:: simgrid.this_actor.yield_
719 .. doxygenfunction:: sg_actor_yield()
728 Please refer to :ref:`the relevant documentation <logging_prog>`.
730 .. group-tab:: Python
732 .. autofunction:: simgrid.this_actor.debug
733 .. autofunction:: simgrid.this_actor.info
734 .. autofunction:: simgrid.this_actor.warning
735 .. autofunction:: simgrid.this_actor.error
744 .. doxygenfunction:: simgrid::s4u::this_actor::sleep_for(double duration)
745 .. doxygenfunction:: simgrid::s4u::this_actor::sleep_for(std::chrono::duration< Rep, Period > duration)
746 .. doxygenfunction:: simgrid::s4u::this_actor::sleep_until(const SimulationTimePoint< Duration > &wakeup_time)
747 .. doxygenfunction:: simgrid::s4u::this_actor::sleep_until(double wakeup_time)
749 .. group-tab:: Python
751 .. autofunction:: simgrid.this_actor.sleep_for
752 .. autofunction:: simgrid.this_actor.sleep_until
756 .. doxygenfunction:: sg_actor_sleep_for(double duration)
758 Simulating executions
759 ---------------------
761 Simulate the execution of some code on this actor. You can either simulate
762 parallel or sequential code and you can either block upon the termination of
763 the execution, or start an asynchronous activity.
769 .. doxygenfunction:: simgrid::s4u::this_actor::exec_async
770 .. doxygenfunction:: simgrid::s4u::this_actor::exec_init(const std::vector< s4u::Host * > &hosts, const std::vector< double > &flops_amounts, const std::vector< double > &bytes_amounts)
771 .. doxygenfunction:: simgrid::s4u::this_actor::exec_init(double flops_amounts)
772 .. doxygenfunction:: simgrid::s4u::this_actor::execute(double flop)
773 .. doxygenfunction:: simgrid::s4u::this_actor::execute(double flop, double priority)
774 .. doxygenfunction:: simgrid::s4u::this_actor::parallel_execute(const std::vector< s4u::Host * > &hosts, const std::vector< double > &flops_amounts, const std::vector< double > &bytes_amounts)
775 .. doxygenfunction:: simgrid::s4u::this_actor::thread_execute
777 .. group-tab:: Python
779 .. autofunction:: simgrid.this_actor.exec_async
780 .. autofunction:: simgrid.this_actor.exec_init
781 .. autofunction:: simgrid.this_actor.execute
785 .. doxygenfunction:: sg_actor_execute(double flops)
786 .. doxygenfunction:: sg_actor_execute_with_priority(double flops, double priority)
787 .. doxygenfunction:: sg_actor_exec_init(double computation_amount)
788 .. doxygenfunction:: sg_actor_exec_async(double computation_amount)
789 .. doxygenfunction:: sg_actor_parallel_exec_init(int host_nb, const sg_host_t* host_list, double* flops_amount, double* bytes_amount);
798 .. doxygenfunction:: simgrid::s4u::this_actor::exit()
799 .. doxygenfunction:: simgrid::s4u::this_actor::on_exit(const std::function< void(bool)> &fun)
801 .. group-tab:: Python
803 .. autofunction:: simgrid.this_actor.exit
804 .. autofunction:: simgrid.this_actor.on_exit
808 See also :cpp:func:`sg_actor_on_exit`.
810 .. doxygenfunction:: sg_actor_exit
822 .. doxygenclass:: simgrid::s4u::Engine
824 .. group-tab:: Python
826 .. autoclass:: simgrid.Engine
835 .. doxygenfunction:: simgrid::s4u::Engine::Engine(int *argc, char **argv)
836 .. doxygenfunction:: simgrid::s4u::Engine::is_initialized()
837 .. doxygenfunction:: simgrid::s4u::Engine::shutdown()
838 .. doxygenfunction:: simgrid::s4u::Engine::get_instance()
840 .. group-tab:: Python
842 .. automethod:: simgrid.Engine.__init__
843 .. autoattribute:: simgrid.Engine.instance
847 .. doxygenfunction:: simgrid_init
856 .. doxygenfunction:: simgrid::s4u::Engine::set_config(const std::string &str)
857 .. doxygenfunction:: simgrid::s4u::Engine::set_config(const std::string &name, bool value)
858 .. doxygenfunction:: simgrid::s4u::Engine::set_config(const std::string &name, double value)
859 .. doxygenfunction:: simgrid::s4u::Engine::set_config(const std::string &name, int value)
860 .. doxygenfunction:: simgrid::s4u::Engine::set_config(const std::string &name, const std::string &value)
862 .. doxygenfunction:: simgrid::s4u::Engine::load_deployment
863 .. doxygenfunction:: simgrid::s4u::Engine::load_platform
864 .. doxygenfunction:: simgrid::s4u::Engine::flatify_platform
865 .. doxygenfunction:: simgrid::s4u::Engine::register_actor(const std::string &name)
866 .. doxygenfunction:: simgrid::s4u::Engine::register_actor(const std::string &name, F code)
867 .. doxygenfunction:: simgrid::s4u::Engine::register_default(const std::function< void(int, char **)> &code)
868 .. doxygenfunction:: simgrid::s4u::Engine::register_default(const kernel::actor::ActorCodeFactory &factory)
870 .. doxygenfunction:: simgrid::s4u::Engine::register_function(const std::string &name, const std::function< void(int, char **)> &code)
871 .. doxygenfunction:: simgrid::s4u::Engine::register_function(const std::string &name, const std::function< void(std::vector< std::string >)> &code)
872 .. doxygenfunction:: simgrid::s4u::Engine::register_function(const std::string &name, const kernel::actor::ActorCodeFactory &factory)
874 .. group-tab:: Python
876 .. automethod:: simgrid.Engine.load_deployment
877 .. automethod:: simgrid.Engine.load_platform
878 .. automethod:: simgrid.Engine.register_actor
882 .. doxygenfunction:: simgrid_load_deployment
883 .. doxygenfunction:: simgrid_load_platform
884 .. doxygenfunction:: simgrid_register_default
885 .. doxygenfunction:: simgrid_register_function
895 .. doxygenfunction:: simgrid::s4u::Engine::get_clock()
896 .. doxygenfunction:: simgrid::s4u::Engine::run
897 .. doxygenfunction:: simgrid::s4u::Engine::run_until
899 .. group-tab:: Python
901 .. autoattribute:: simgrid.Engine.clock
902 .. automethod:: simgrid.Engine.run
903 .. automethod:: simgrid.Engine.run_until
907 .. doxygenfunction:: simgrid_get_clock
908 .. doxygenfunction:: simgrid_run
909 .. doxygenfunction:: simgrid_run_until
918 .. doxygenfunction:: simgrid::s4u::Engine::get_actor_count
919 .. doxygenfunction:: simgrid::s4u::Engine::get_all_actors
920 .. doxygenfunction:: simgrid::s4u::Engine::get_filtered_actors
924 .. doxygenfunction:: sg_actor_count()
933 .. doxygenfunction:: simgrid::s4u::Engine::get_all_hosts
934 .. doxygenfunction:: simgrid::s4u::Engine::get_host_count
935 .. doxygenfunction:: simgrid::s4u::Engine::get_filtered_hosts
936 .. doxygenfunction:: simgrid::s4u::Engine::host_by_name
937 .. doxygenfunction:: simgrid::s4u::Engine::host_by_name_or_null
939 .. group-tab:: Python
941 .. autoattribute:: simgrid.Engine.all_hosts
942 .. automethod:: simgrid.Engine.host_by_name
946 See also :cpp:func:`sg_host_list` and :cpp:func:`sg_host_count`.
955 .. doxygenfunction:: simgrid::s4u::Engine::get_all_links
956 .. doxygenfunction:: simgrid::s4u::Engine::get_link_count
957 .. doxygenfunction:: simgrid::s4u::Engine::get_filtered_links
958 .. doxygenfunction:: simgrid::s4u::Engine::link_by_name
959 .. doxygenfunction:: simgrid::s4u::Engine::link_by_name_or_null
961 .. group-tab:: Python
963 .. autoattribute:: simgrid.Engine.all_links
965 Interacting with the routing
966 ----------------------------
972 .. doxygenfunction:: simgrid::s4u::Engine::get_all_netpoints
973 .. doxygenfunction:: simgrid::s4u::Engine::get_filtered_netzones
974 .. doxygenfunction:: simgrid::s4u::Engine::get_netzone_root
975 .. doxygenfunction:: simgrid::s4u::Engine::netpoint_by_name_or_null
976 .. doxygenfunction:: simgrid::s4u::Engine::netzone_by_name_or_null
978 .. group-tab:: Python
980 .. autoattribute:: simgrid.Engine.all_netpoints
981 .. autoattribute:: simgrid.Engine.netzone_root
982 .. automethod:: simgrid.Engine.netpoint_by_name
983 .. automethod:: simgrid.Engine.netzone_by_name
992 .. doxygenfunction:: simgrid::s4u::Engine::on_deadlock_cb
993 .. doxygenfunction:: simgrid::s4u::Engine::on_platform_created_cb
994 .. doxygenfunction:: simgrid::s4u::Engine::on_platform_creation_cb
995 .. doxygenfunction:: simgrid::s4u::Engine::on_simulation_start_cb
996 .. doxygenfunction:: simgrid::s4u::Engine::on_simulation_end_cb
997 .. doxygenfunction:: simgrid::s4u::Engine::on_time_advance_cb
1009 .. doxygenclass:: simgrid::s4u::Mailbox
1011 .. group-tab:: Python
1013 .. autoclass:: simgrid.Mailbox
1015 Please also refer to the :ref:`full doc on s4u::Mailbox <s4u_mailbox>`.
1026 #include <simgrid/s4u/Mailbox.hpp>
1028 Note that there is no MailboxPtr type and that you cannot use the RAII
1029 idiom on mailboxes because they are internal objects to the simulation
1030 engine. Once created, there is no way to destroy a mailbox before the end
1033 .. doxygenfunction:: simgrid::s4u::Mailbox::by_name(const std::string &name)
1035 .. group-tab:: Python
1039 #include <simgrid/mailbox.h>
1041 .. automethod:: simgrid.Mailbox.by_name
1047 #include <simgrid/s4u/mailbox.h>
1049 .. doxygentypedef:: sg_mailbox_t
1050 .. doxygentypedef:: const_sg_mailbox_t
1052 .. doxygenfunction:: sg_mailbox_by_name(const char *alias)
1061 .. doxygenfunction:: simgrid::s4u::Mailbox::get_cname
1062 .. doxygenfunction:: simgrid::s4u::Mailbox::get_name
1064 .. group-tab:: Python
1066 .. autoattribute:: simgrid.Mailbox.name
1075 .. doxygenfunction:: simgrid::s4u::Mailbox::put(void *payload, uint64_t simulated_size_in_bytes)
1076 .. doxygenfunction:: simgrid::s4u::Mailbox::put(void *payload, uint64_t simulated_size_in_bytes, double timeout)
1077 .. doxygenfunction:: simgrid::s4u::Mailbox::put_async(void *data, uint64_t simulated_size_in_bytes)
1078 .. doxygenfunction:: simgrid::s4u::Mailbox::put_init()
1079 .. doxygenfunction:: simgrid::s4u::Mailbox::put_init(void *data, uint64_t simulated_size_in_bytes)
1081 .. group-tab:: Python
1083 .. automethod:: simgrid.Mailbox.put
1084 .. automethod:: simgrid.Mailbox.put_async
1085 .. automethod:: simgrid.Mailbox.put_init
1089 .. doxygenfunction:: sg_mailbox_put(sg_mailbox_t mailbox, void *payload, long simulated_size_in_bytes)
1090 .. doxygenfunction:: sg_mailbox_put_init(sg_mailbox_t mailbox, void *payload, long simulated_size_in_bytes)
1091 .. doxygenfunction:: sg_mailbox_put_async(sg_mailbox_t mailbox, void *payload, long simulated_size_in_bytes)
1101 .. doxygenfunction:: simgrid::s4u::Mailbox::empty
1102 .. doxygenfunction:: simgrid::s4u::Mailbox::front
1103 .. doxygenfunction:: simgrid::s4u::Mailbox::get()
1104 .. doxygenfunction:: simgrid::s4u::Mailbox::get(double timeout)
1105 .. doxygenfunction:: simgrid::s4u::Mailbox::get_async(T **data)
1106 .. doxygenfunction:: simgrid::s4u::Mailbox::get_init()
1107 .. doxygenfunction:: simgrid::s4u::Mailbox::iprobe(int type, const std::function<bool(void *, void *, kernel::activity::CommImpl *)>& match_fun, void *data)
1108 .. doxygenfunction:: simgrid::s4u::Mailbox::listen
1109 .. doxygenfunction:: simgrid::s4u::Mailbox::ready
1111 .. group-tab:: Python
1113 .. automethod:: simgrid.Mailbox.get
1114 .. automethod:: simgrid.Mailbox.get_async
1115 .. autoattribute:: simgrid.Mailbox.ready
1119 .. doxygenfunction:: sg_mailbox_get(sg_mailbox_t mailbox)
1120 .. doxygenfunction:: sg_mailbox_get_async(sg_mailbox_t mailbox, void **data)
1121 .. doxygenfunction:: sg_mailbox_get_name(const_sg_mailbox_t mailbox)
1122 .. doxygenfunction:: sg_mailbox_listen(const char *alias)
1127 See :ref:`s4u_receiving_actor`.
1133 .. doxygenfunction:: simgrid::s4u::Mailbox::get_receiver
1134 .. doxygenfunction:: simgrid::s4u::Mailbox::set_receiver(ActorPtr actor)
1138 .. doxygenfunction:: sg_mailbox_set_receiver(const char *alias)
1140 .. _API_s4u_Resource:
1156 .. doxygenclass:: simgrid::s4u::Disk
1158 .. group-tab:: Python
1160 .. autoclass:: simgrid.Disk
1164 .. doxygentypedef:: sg_disk_t
1165 .. doxygentypedef:: const_sg_disk_t
1176 #include <simgrid/s4u/Disk.hpp>
1178 Note that there is no DiskPtr type and that you cannot use the RAII
1179 idiom on disks because SimGrid does not allow (yet) to create nor
1180 destroy resources once the simulation is started.
1182 .. doxygenfunction:: simgrid::s4u::Disk::seal()
1184 .. group-tab:: Python
1188 from simgrid import Disk
1190 .. automethod:: simgrid.Disk.seal
1200 .. doxygenfunction:: simgrid::s4u::Disk::get_cname() const
1201 .. doxygenfunction:: simgrid::s4u::Disk::get_host() const
1202 .. doxygenfunction:: simgrid::s4u::Disk::get_name() const
1203 .. doxygenfunction:: simgrid::s4u::Disk::get_properties() const
1204 .. doxygenfunction:: simgrid::s4u::Disk::get_property(const std::string &key) const
1205 .. doxygenfunction:: simgrid::s4u::Disk::get_read_bandwidth() const
1206 .. doxygenfunction:: simgrid::s4u::Disk::get_write_bandwidth() const
1207 .. doxygenfunction:: simgrid::s4u::Disk::set_property(const std::string &, const std::string &value)
1208 .. doxygenfunction:: simgrid::s4u::Disk::set_sharing_policy
1210 .. group-tab:: Python
1212 .. autoattribute:: simgrid.Disk.name
1213 .. automethod:: simgrid.Disk.set_sharing_policy
1222 .. doxygenfunction:: simgrid::s4u::Disk::io_init(sg_size_t size, s4u::Io::OpType type) const
1223 .. doxygenfunction:: simgrid::s4u::Disk::read(sg_size_t size) const
1224 .. doxygenfunction:: simgrid::s4u::Disk::read_async(sg_size_t size) const
1225 .. doxygenfunction:: simgrid::s4u::Disk::write(sg_size_t size) const
1226 .. doxygenfunction:: simgrid::s4u::Disk::write_async(sg_size_t size) const
1228 .. group-tab:: Python
1230 .. automethod:: simgrid.Disk.read
1231 .. automethod:: simgrid.Disk.read_async
1232 .. automethod:: simgrid.Disk.write
1233 .. automethod:: simgrid.Disk.write_async
1242 .. doxygenfunction:: simgrid::s4u::Disk::on_creation_cb
1243 .. doxygenfunction:: simgrid::s4u::Disk::on_destruction_cb
1244 .. doxygenfunction:: simgrid::s4u::Disk::on_this_destruction_cb
1245 .. doxygenfunction:: simgrid::s4u::Disk::on_onoff_cb
1246 .. doxygenfunction:: simgrid::s4u::Disk::on_this_onoff_cb
1259 .. doxygenclass:: simgrid::s4u::Host
1261 .. group-tab:: Python
1263 .. autoclass:: simgrid.Host
1274 #include <simgrid/s4u/Host.hpp>
1276 Note that there is no HostPtr type, and that you cannot use the RAII
1277 idiom on hosts because SimGrid does not allow (yet) to create nor
1278 destroy resources once the simulation is started.
1280 .. doxygenfunction:: simgrid::s4u::Host::destroy()
1281 .. doxygenfunction:: simgrid::s4u::Host::seal()
1283 .. group-tab:: Python
1287 from simgrid import Host
1289 .. automethod:: simgrid.Host.seal
1295 #include <simgrid/host.h>
1297 .. doxygentypedef:: sg_host_t
1298 .. cpp:type:: const s4u_Host* const_sg_host_t
1300 Pointer to a constant host object.
1309 See also :cpp:func:`simgrid::s4u::Engine::get_all_hosts`.
1311 .. doxygenfunction:: simgrid::s4u::Host::by_name(const std::string &name)
1312 .. doxygenfunction:: simgrid::s4u::Host::by_name_or_null(const std::string &name)
1313 .. doxygenfunction:: simgrid::s4u::Host::current()
1315 .. group-tab:: Python
1317 See also :py:attr:`simgrid.Engine.all_hosts`.
1319 .. automethod:: simgrid.Host.by_name
1320 .. automethod:: simgrid.Host.current
1324 .. doxygenfunction:: sg_host_by_name(const char *name)
1325 .. doxygenfunction:: sg_host_count()
1326 .. doxygenfunction:: sg_host_list()
1328 Modifying characteristics
1329 -------------------------
1335 .. doxygenfunction:: simgrid::s4u::Host::set_core_count(int core_count)
1336 .. doxygenfunction:: simgrid::s4u::Host::set_coordinates(const std::string& coords)
1337 .. doxygenfunction:: simgrid::s4u::Host::set_sharing_policy
1339 .. group-tab:: Python
1341 .. autoattribute:: simgrid.Host.core_count
1343 .. automethod:: simgrid.Host.set_coordinates
1344 .. automethod:: simgrid.Host.set_sharing_policy
1353 .. doxygenfunction:: simgrid::s4u::Host::get_cname() const
1354 .. doxygenfunction:: simgrid::s4u::Host::get_core_count() const
1355 .. doxygenfunction:: simgrid::s4u::Host::get_name() const
1356 .. doxygenfunction:: simgrid::s4u::Host::get_available_speed() const
1357 .. doxygenfunction:: simgrid::s4u::Host::get_load() const
1358 .. doxygenfunction:: simgrid::s4u::Host::get_speed() const
1360 .. group-tab:: Python
1362 .. autoattribute:: simgrid.Host.name
1363 .. autoattribute:: simgrid.Host.core_count
1364 .. autoattribute:: simgrid.Host.load
1365 .. autoattribute:: simgrid.Host.speed
1366 .. autoattribute:: simgrid.Host.available_speed
1370 .. doxygenfunction:: sg_host_core_count(const_sg_host_t host)
1371 .. doxygenfunction:: sg_host_get_name(const_sg_host_t host)
1372 .. doxygenfunction:: sg_host_get_load(const_sg_host_t host)
1373 .. doxygenfunction:: sg_host_get_speed(const_sg_host_t host)
1375 User data and properties
1376 ------------------------
1382 .. doxygenfunction:: simgrid::s4u::Host::get_properties() const
1383 .. doxygenfunction:: simgrid::s4u::Host::get_property(const std::string &key) const
1384 .. doxygenfunction:: simgrid::s4u::Host::set_properties(const std::unordered_map< std::string, std::string > &properties)
1385 .. doxygenfunction:: simgrid::s4u::Host::set_property(const std::string &key, const std::string &value)
1389 .. doxygenfunction:: sg_host_set_property_value(sg_host_t host, const char *name, const char *value)
1390 .. doxygenfunction:: sg_host_get_properties(const_sg_host_t host)
1391 .. doxygenfunction:: sg_host_get_property_value(const_sg_host_t host, const char *name)
1392 .. doxygenfunction:: sg_host_extension_create(void(*deleter)(void *))
1393 .. doxygenfunction:: sg_host_extension_get(const_sg_host_t host, size_t rank)
1395 Retrieving components
1396 ---------------------
1402 .. doxygenfunction:: simgrid::s4u::Host::add_disk(const Disk *disk)
1403 .. doxygenfunction:: simgrid::s4u::Host::get_actor_count() const
1404 .. doxygenfunction:: simgrid::s4u::Host::get_all_actors() const
1405 .. doxygenfunction:: simgrid::s4u::Host::get_disks() const
1406 .. doxygenfunction:: simgrid::s4u::Host::remove_disk(const std::string &disk_name)
1408 .. group-tab:: Python
1410 .. automethod:: simgrid.Host.get_disks
1414 .. doxygenfunction:: sg_host_get_actor_list(const_sg_host_t host, xbt_dynar_t whereto)
1423 .. doxygenfunction:: simgrid::s4u::Host::is_on() const
1424 .. doxygenfunction:: simgrid::s4u::Host::turn_off()
1425 .. doxygenfunction:: simgrid::s4u::Host::turn_on()
1429 .. doxygenfunction:: sg_host_is_on(const_sg_host_t host)
1430 .. doxygenfunction:: sg_host_turn_off(sg_host_t host)
1431 .. doxygenfunction:: sg_host_turn_on(sg_host_t host)
1433 .. _API_s4u_Host_dvfs:
1438 See also the :ref:`relevant examples <s4u_ex_dvfs>`.
1444 .. doxygenfunction:: simgrid::s4u::Host::get_pstate() const
1445 .. doxygenfunction:: simgrid::s4u::Host::get_pstate_count() const
1446 .. doxygenfunction:: simgrid::s4u::Host::get_pstate_speed(unsigned long pstate_index) const
1447 .. doxygenfunction:: simgrid::s4u::Host::set_pstate(unsigned long pstate_index)
1449 .. group-tab:: Python
1451 .. autoattribute:: simgrid.Host.pstate
1452 .. autoattribute:: simgrid.Host.pstate_count
1453 .. automethod:: simgrid.Host.pstate_speed
1457 .. doxygenfunction:: sg_host_get_available_speed(const_sg_host_t host)
1458 .. doxygenfunction:: sg_host_get_nb_pstates(const_sg_host_t host)
1459 .. doxygenfunction:: sg_host_get_pstate(const_sg_host_t host)
1460 .. doxygenfunction:: sg_host_get_pstate_speed(const_sg_host_t host, unsigned long pstate_index)
1461 .. doxygenfunction:: sg_host_set_pstate(sg_host_t host, unsigned long pstate)
1470 .. doxygenfunction:: simgrid::s4u::Host::set_speed_profile(kernel::profile::Profile *p)
1471 .. doxygenfunction:: simgrid::s4u::Host::set_state_profile(kernel::profile::Profile *p)
1473 .. group-tab:: Python
1475 .. automethod:: simgrid.Host.set_speed_profile
1476 .. automethod:: simgrid.Host.set_state_profile
1485 .. doxygenfunction:: simgrid::s4u::Host::exec_async
1486 .. doxygenfunction:: simgrid::s4u::Host::execute(double flops) const
1487 .. doxygenfunction:: simgrid::s4u::Host::execute(double flops, double priority) const
1489 Platform and routing
1490 --------------------
1492 You can also start direct communications between two arbitrary hosts
1493 using :cpp:func:`Comm::sendto() <simgrid::s4u::Comm::sendto()>`.
1499 .. doxygenfunction:: simgrid::s4u::Host::get_englobing_zone() const
1500 .. doxygenfunction:: simgrid::s4u::Host::get_netpoint() const
1501 .. doxygenfunction:: simgrid::s4u::Host::route_to(const Host *dest, std::vector< Link * > &links, double *latency) const
1502 .. doxygenfunction:: simgrid::s4u::Host::route_to(const Host *dest, std::vector< kernel::resource::StandardLinkImpl * > &links, double *latency) const
1503 .. doxygenfunction:: simgrid::s4u::Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
1504 .. doxygenfunction:: simgrid::s4u::Host::create_disk(const std::string& name, const std::string& read_bandwidth, const std::string& write_bandwidth)
1506 .. group-tab:: Python
1508 .. autoattribute:: simgrid.Host.netpoint
1509 .. automethod:: simgrid.Host.create_disk
1511 .. automethod:: simgrid.Host.route_to
1515 .. doxygenfunction:: sg_host_get_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links)
1516 .. doxygenfunction:: sg_host_get_route_bandwidth(const_sg_host_t from, const_sg_host_t to)
1517 .. doxygenfunction:: sg_host_get_route_latency(const_sg_host_t from, const_sg_host_t to)
1518 .. doxygenfunction:: sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount)
1527 .. doxygenfunction:: simgrid::s4u::Host::on_creation_cb
1528 .. doxygenfunction:: simgrid::s4u::Host::on_destruction_cb
1529 .. doxygenfunction:: simgrid::s4u::Host::on_this_destruction_cb
1530 .. doxygenfunction:: simgrid::s4u::Host::on_speed_change_cb
1531 .. doxygenfunction:: simgrid::s4u::Host::on_this_speed_change_cb
1532 .. doxygenfunction:: simgrid::s4u::Host::on_onoff_cb
1533 .. doxygenfunction:: simgrid::s4u::Host::on_this_onoff_cb
1534 .. doxygenfunction:: simgrid::s4u::Host::on_exec_state_change_cb
1546 .. doxygenclass:: simgrid::s4u::Link
1547 .. doxygenclass:: simgrid::s4u::SplitDuplexLink
1548 .. doxygenclass:: simgrid::s4u::LinkInRoute
1551 .. group-tab:: Python
1553 .. autoclass:: simgrid.Link
1564 #include <simgrid/s4u/Link.hpp>
1566 Note that there is no LinkPtr type and that you cannot use the RAII
1567 idiom on hosts because SimGrid does not allow (yet) to create nor
1568 destroy resources once the simulation is started.
1570 .. doxygenfunction:: simgrid::s4u::Link::seal()
1572 .. group-tab:: Python
1576 from simgrid import Link
1578 .. automethod:: simgrid.Link.seal
1584 #include <simgrid/link.h>
1586 .. doxygentypedef:: sg_link_t
1587 .. cpp:type:: const s4u_Link* const_sg_link_t
1589 Pointer to a constant link object.
1598 See also :cpp:func:`simgrid::s4u::Engine::get_all_links`.
1600 .. doxygenfunction:: simgrid::s4u::Link::by_name(const std::string &name)
1601 .. doxygenfunction:: simgrid::s4u::Link::by_name_or_null(const std::string &name)
1603 .. group-tab:: Python
1605 See also :py:attr:`simgrid.Engine.all_links`.
1607 .. automethod:: simgrid.Link.by_name
1608 .. autoattribute:: simgrid.Link.name
1612 .. doxygenfunction:: sg_link_by_name(const char *name)
1613 .. doxygenfunction:: sg_link_count()
1614 .. doxygenfunction:: sg_link_list()
1623 .. doxygenfunction:: simgrid::s4u::Link::get_bandwidth() const
1624 .. doxygenfunction:: simgrid::s4u::Link::get_cname() const
1625 .. doxygenfunction:: simgrid::s4u::Link::get_latency() const
1626 .. doxygenfunction:: simgrid::s4u::Link::get_name() const
1627 .. doxygenfunction:: simgrid::s4u::Link::get_sharing_policy() const
1628 .. doxygenfunction:: simgrid::s4u::Link::get_concurrency_limit() const
1629 .. doxygenfunction:: simgrid::s4u::Link::get_usage() const
1630 .. doxygenfunction:: simgrid::s4u::Link::is_used() const
1632 .. group-tab:: Python
1634 .. autoattribute:: simgrid.Link.bandwidth
1635 .. autoattribute:: simgrid.Link.latency
1639 .. doxygenfunction:: sg_link_get_bandwidth(const_sg_link_t link)
1640 .. doxygenfunction:: sg_link_get_latency(const_sg_link_t link)
1641 .. doxygenfunction:: sg_link_get_name(const_sg_link_t link)
1642 .. doxygenfunction:: sg_link_is_shared(const_sg_link_t link)
1644 Modifying characteristics
1645 -------------------------
1651 .. doxygenfunction:: simgrid::s4u::Link::set_bandwidth(double value)
1652 .. doxygenfunction:: simgrid::s4u::Link::set_latency(double value)
1653 .. doxygenfunction:: simgrid::s4u::Link::set_latency(const std::string& value)
1654 .. doxygenfunction:: simgrid::s4u::Link::set_concurrency_limit(int limit)
1655 .. doxygenfunction:: simgrid::s4u::Link::set_sharing_policy
1657 .. group-tab:: Python
1659 .. automethod:: simgrid.Link.set_bandwidth
1660 .. automethod:: simgrid.Link.set_latency
1661 .. automethod:: simgrid.Link.set_concurrency_limit
1662 .. automethod:: simgrid.Link.set_sharing_policy
1666 .. doxygenfunction:: sg_link_set_bandwidth(sg_link_t link, double value)
1667 .. doxygenfunction:: sg_link_set_latency(sg_link_t link, double value)
1669 User data and properties
1670 ------------------------
1676 .. doxygenfunction:: simgrid::s4u::Link::get_property(const std::string &key) const
1677 .. doxygenfunction:: simgrid::s4u::Link::set_property(const std::string &key, const std::string &value)
1681 .. doxygenfunction:: sg_link_get_data(const_sg_link_t link)
1682 .. doxygenfunction:: sg_link_set_data(sg_link_t link, void *data)
1691 See also :cpp:func:`simgrid::s4u::Link::set_state_profile`.
1693 .. doxygenfunction:: simgrid::s4u::Link::is_on() const
1694 .. doxygenfunction:: simgrid::s4u::Link::turn_off()
1695 .. doxygenfunction:: simgrid::s4u::Link::turn_on()
1697 .. group-tab:: Python
1699 See also :py:func:`simgrid.Link.set_state_profile`.
1701 .. automethod:: simgrid.Link.is_on
1702 .. automethod:: simgrid.Link.turn_off
1703 .. automethod:: simgrid.Link.turn_on
1708 See :ref:`howto_churn` for more details.
1714 .. doxygenfunction:: simgrid::s4u::Link::set_bandwidth_profile(kernel::profile::Profile *profile)
1715 .. doxygenfunction:: simgrid::s4u::Link::set_latency_profile(kernel::profile::Profile *profile)
1716 .. doxygenfunction:: simgrid::s4u::Link::set_state_profile(kernel::profile::Profile *profile)
1718 .. group-tab:: Python
1720 .. automethod:: simgrid.Link.set_bandwidth_profile
1721 .. automethod:: simgrid.Link.set_latency_profile
1722 .. automethod:: simgrid.Link.set_state_profile
1731 .. doxygenfunction:: simgrid::s4u::Link::set_host_wifi_rate
1733 .. group-tab:: Python
1735 .. automethod:: simgrid.Link.set_host_wifi_rate
1744 .. doxygenfunction:: simgrid::s4u::Link::on_bandwidth_change_cb
1745 .. doxygenfunction:: simgrid::s4u::Link::on_this_bandwidth_change_cb
1746 .. doxygenfunction:: simgrid::s4u::Link::on_communication_state_change_cb
1747 .. doxygenfunction:: simgrid::s4u::Link::on_creation_cb
1748 .. doxygenfunction:: simgrid::s4u::Link::on_destruction_cb
1749 .. doxygenfunction:: simgrid::s4u::Link::on_this_destruction_cb
1750 .. doxygenfunction:: simgrid::s4u::Link::on_onoff_cb
1751 .. doxygenfunction:: simgrid::s4u::Link::on_this_onoff_cb
1753 .. _API_s4u_NetZone:
1763 .. doxygenclass:: simgrid::s4u::NetZone
1765 .. group-tab:: Python
1767 .. autoclass:: simgrid.NetZone
1778 #include <simgrid/s4u/NetZone.hpp>
1780 Note that there is no NetZonePtr type and that you cannot use the RAII
1781 idiom on network zones because SimGrid does not allow (yet) to create nor
1782 destroy resources once the simulation is started.
1784 .. doxygenfunction:: simgrid::s4u::NetZone::seal
1786 .. group-tab:: Python
1790 from simgrid import NetZone
1792 .. automethod:: simgrid.NetZone.seal
1798 #include <simgrid/zone.h>
1800 .. doxygentypedef:: sg_netzone_t
1801 .. cpp:type:: const s4u_NetZone* const_sg_netzone_t
1803 Pointer to a constant network zone object.
1812 See :cpp:func:`simgrid::s4u::Engine::get_netzone_root`,
1813 :cpp:func:`simgrid::s4u::Engine::netzone_by_name_or_null` and
1814 :cpp:func:`simgrid::s4u::Engine::get_filtered_netzones`.
1818 .. doxygenfunction:: sg_zone_get_by_name(const char *name)
1819 .. doxygenfunction:: sg_zone_get_root()
1828 .. doxygenfunction:: simgrid::s4u::NetZone::get_cname() const
1829 .. doxygenfunction:: simgrid::s4u::NetZone::get_name() const
1830 .. doxygenfunction:: simgrid::s4u::NetZone::get_netpoint()
1832 .. group-tab:: Python
1834 .. autoattribute:: simgrid.NetZone.name
1835 .. autoattribute:: simgrid.NetZone.netpoint
1839 .. doxygenfunction:: sg_zone_get_name(const_sg_netzone_t zone)
1841 User data and properties
1842 ------------------------
1848 .. doxygenfunction:: simgrid::s4u::NetZone::get_properties() const
1849 .. doxygenfunction:: simgrid::s4u::NetZone::get_property(const std::string &key) const
1850 .. doxygenfunction:: simgrid::s4u::NetZone::set_property(const std::string &key, const std::string &value)
1852 .. group-tab:: Python
1854 .. automethod:: simgrid.NetZone.set_property
1858 .. doxygenfunction:: sg_zone_get_property_value(const_sg_netzone_t as, const char *name)
1859 .. doxygenfunction:: sg_zone_set_property_value(sg_netzone_t netzone, const char *name, const char *value)
1861 Retrieving components
1862 ---------------------
1868 .. doxygenfunction:: simgrid::s4u::NetZone::get_all_hosts() const
1869 .. doxygenfunction:: simgrid::s4u::NetZone::get_host_count() const
1873 .. doxygenfunction:: sg_zone_get_hosts(const_sg_netzone_t zone, xbt_dynar_t whereto)
1882 .. doxygenfunction:: simgrid::s4u::NetZone::add_component(kernel::routing::NetPoint *elm)
1883 .. doxygenfunction:: simgrid::s4u::NetZone::add_route
1884 .. doxygenfunction:: simgrid::s4u::NetZone::add_bypass_route
1885 .. doxygenfunction:: simgrid::s4u::NetZone::get_children() const
1886 .. doxygenfunction:: simgrid::s4u::NetZone::get_parent() const
1887 .. doxygenfunction:: simgrid::s4u::NetZone::set_parent(const NetZone* parent)
1889 .. group-tab:: Python
1891 .. automethod:: simgrid.NetZone.add_route
1892 .. automethod:: simgrid.NetZone.set_parent
1896 .. doxygenfunction:: sg_zone_get_sons(const_sg_netzone_t zone, xbt_dict_t whereto)
1905 .. doxygenfunction:: simgrid::s4u::NetZone::on_creation_cb
1906 .. doxygenfunction:: simgrid::s4u::NetZone::on_seal_cb
1917 .. doxygenfunction:: simgrid::s4u::create_full_zone
1918 .. doxygenfunction:: simgrid::s4u::create_empty_zone
1919 .. doxygenfunction:: simgrid::s4u::create_star_zone
1920 .. doxygenfunction:: simgrid::s4u::create_dijkstra_zone
1921 .. doxygenfunction:: simgrid::s4u::create_floyd_zone
1922 .. doxygenfunction:: simgrid::s4u::create_vivaldi_zone
1923 .. doxygenfunction:: simgrid::s4u::create_wifi_zone
1924 .. doxygenfunction:: simgrid::s4u::create_torus_zone
1925 .. doxygenfunction:: simgrid::s4u::create_fatTree_zone
1926 .. doxygenfunction:: simgrid::s4u::create_dragonfly_zone
1928 .. group-tab:: Python
1930 .. automethod:: simgrid.NetZone.create_full_zone
1931 .. automethod:: simgrid.NetZone.create_empty_zone
1932 .. automethod:: simgrid.NetZone.create_star_zone
1933 .. automethod:: simgrid.NetZone.create_dijkstra_zone
1934 .. automethod:: simgrid.NetZone.create_floyd_zone
1935 .. automethod:: simgrid.NetZone.create_vivaldi_zone
1936 .. automethod:: simgrid.NetZone.create_wifi_zone
1937 .. automethod:: simgrid.NetZone.create_torus_zone
1938 .. automethod:: simgrid.NetZone.create_fatTree_zone
1939 .. automethod:: simgrid.NetZone.create_dragonfly_zone
1948 .. doxygenfunction:: simgrid::s4u::NetZone::create_host(const std::string& name, const std::vector<double>& speed_per_pstate)
1949 .. doxygenfunction:: simgrid::s4u::NetZone::create_host(const std::string& name, double speed)
1950 .. doxygenfunction:: simgrid::s4u::NetZone::create_host(const std::string& name, const std::vector<std::string>& speed_per_pstate)
1951 .. doxygenfunction:: simgrid::s4u::NetZone::create_host(const std::string& name, const std::string& speed)
1953 .. group-tab:: Python
1955 .. automethod:: simgrid.NetZone.create_host
1964 .. doxygenfunction:: simgrid::s4u::NetZone::create_link(const std::string& name, const std::vector<double>& bandwidths)
1965 .. doxygenfunction:: simgrid::s4u::NetZone::create_link(const std::string& name, double bandwidth)
1966 .. doxygenfunction:: simgrid::s4u::NetZone::create_link(const std::string& name, const std::vector<std::string>& bandwidthds)
1967 .. doxygenfunction:: simgrid::s4u::NetZone::create_link(const std::string& name, const std::string& bandwidth)
1968 .. doxygenfunction:: simgrid::s4u::NetZone::create_split_duplex_link(const std::string& name, const std::string& bandwidth)
1969 .. doxygenfunction:: simgrid::s4u::NetZone::create_split_duplex_link(const std::string& name, double bandwidth)
1971 .. group-tab:: Python
1973 .. automethod:: simgrid.NetZone.create_link
1974 .. automethod:: simgrid.NetZone.create_split_duplex_link
1983 .. doxygenfunction:: simgrid::s4u::NetZone::create_router(const std::string& name)
1985 .. group-tab:: Python
1987 .. automethod:: simgrid.NetZone.create_router
1989 .. _API_s4u_VirtualMachine:
1991 =======================
1992 class VirtualMachine
1993 =======================
1996 .. doxygenclass:: simgrid::s4u::VirtualMachine
2006 #include <simgrid/s4u/VirtualMachine.hpp>
2008 Note that there is no VirtualMachinePtr type, and that you cannot use the RAII
2009 idiom on virtual machines. There is no good reason for that and should change in the future.
2015 #include <simgrid/vm.h>
2017 .. doxygentypedef:: sg_vm_t
2018 .. cpp:type:: const s4u_VirtualMachine* const_sg_vm_t
2020 Pointer to a constant virtual machine object.
2029 .. doxygenfunction:: simgrid::s4u::Host::create_vm(const std::string &name, int core_amount)
2030 .. doxygenfunction:: simgrid::s4u::Host::create_vm(const std::string &name, int core_amount, size_t ramsize)
2031 .. doxygenfunction:: simgrid::s4u::VirtualMachine::destroy
2035 .. doxygenfunction:: sg_vm_create_core
2036 .. doxygenfunction:: sg_vm_create_multicore
2037 .. doxygenfunction:: sg_vm_destroy
2046 .. doxygenfunction:: simgrid::s4u::VirtualMachine::get_pm() const
2047 .. doxygenfunction:: simgrid::s4u::VirtualMachine::get_ramsize() const
2048 .. doxygenfunction:: simgrid::s4u::VirtualMachine::get_state() const
2050 .. doxygenfunction:: simgrid::s4u::VirtualMachine::set_bound(double bound)
2051 .. doxygenfunction:: simgrid::s4u::VirtualMachine::set_pm(Host *pm)
2052 .. doxygenfunction:: simgrid::s4u::VirtualMachine::set_ramsize(size_t ramsize)
2056 .. doxygenfunction:: sg_vm_get_ramsize(const_sg_vm_t vm)
2057 .. doxygenfunction:: sg_vm_set_bound(sg_vm_t vm, double bound)
2058 .. doxygenfunction:: sg_vm_set_ramsize(sg_vm_t vm, size_t size)
2060 .. doxygenfunction:: sg_vm_get_name
2061 .. doxygenfunction:: sg_vm_get_pm
2062 .. doxygenfunction:: sg_vm_is_created
2063 .. doxygenfunction:: sg_vm_is_running
2064 .. doxygenfunction:: sg_vm_is_suspended
2073 .. doxygenfunction:: simgrid::s4u::VirtualMachine::resume()
2074 .. doxygenfunction:: simgrid::s4u::VirtualMachine::shutdown()
2075 .. doxygenfunction:: simgrid::s4u::VirtualMachine::start()
2076 .. doxygenfunction:: simgrid::s4u::VirtualMachine::suspend()
2080 .. doxygenfunction:: sg_vm_start
2081 .. doxygenfunction:: sg_vm_suspend
2082 .. doxygenfunction:: sg_vm_resume
2083 .. doxygenfunction:: sg_vm_shutdown
2092 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_creation_cb
2093 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_destruction_cb
2094 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_destruction_cb
2095 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_migration_end_cb
2096 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_migration_end_cb
2097 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_migration_start_cb
2098 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_migration_start_cb
2099 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_resume_cb
2100 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_resume_cb
2101 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_shutdown_cb
2102 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_shutdown_cb
2103 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_start_cb
2104 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_start_cb
2105 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_started_cb
2106 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_started_cb
2107 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_suspend_cb
2108 .. doxygenfunction:: simgrid::s4u::VirtualMachine::on_this_suspend_cb
2110 .. _API_s4u_Activity:
2120 .. doxygenclass:: simgrid::s4u::Activity
2122 **Known subclasses:**
2123 :ref:`Communications <API_s4u_Comm>` (started on Mailboxes and consuming links),
2124 :ref:`Executions <API_s4u_Exec>` (started on Host and consuming CPU resources)
2125 :ref:`I/O <API_s4u_Io>` (started on and consuming disks).
2126 See also the :ref:`section on activities <s4u_Activities>` above.
2137 #include <simgrid/s4u/Activity.hpp>
2139 .. doxygentypedef:: ActivityPtr
2148 .. doxygenfunction:: simgrid::s4u::Activity::get_cname() const
2149 .. doxygenfunction:: simgrid::s4u::Activity::get_name() const
2150 .. doxygenfunction:: simgrid::s4u::Activity::get_remaining() const
2151 .. doxygenfunction:: simgrid::s4u::Activity::get_state() const
2152 .. doxygenfunction:: simgrid::s4u::Activity::set_remaining(double remains)
2153 .. doxygenfunction:: simgrid::s4u::Activity::set_state(Activity::State state)
2156 Activities life cycle
2157 ---------------------
2163 .. doxygenfunction:: simgrid::s4u::Activity::start
2164 .. doxygenfunction:: simgrid::s4u::Activity::cancel
2165 .. doxygenfunction:: simgrid::s4u::Activity::test
2166 .. doxygenfunction:: simgrid::s4u::Activity::wait
2167 .. doxygenfunction:: simgrid::s4u::Activity::wait_for
2168 .. doxygenfunction:: simgrid::s4u::Activity::wait_until(double time_limit)
2169 .. doxygenfunction:: simgrid::s4u::Activity::vetoable_start()
2171 Suspending and resuming an activity
2172 -----------------------------------
2178 .. doxygenfunction:: simgrid::s4u::Activity::suspend
2179 .. doxygenfunction:: simgrid::s4u::Activity::resume
2180 .. doxygenfunction:: simgrid::s4u::Activity::is_suspended
2192 .. doxygenclass:: simgrid::s4u::Comm
2194 .. group-tab:: Python
2196 .. autoclass:: simgrid.Comm
2207 #include <simgrid/s4u/Comm.hpp>
2209 .. doxygentypedef:: CommPtr
2211 .. group-tab:: Python
2215 from simgrid import Comm
2221 #include <simgrid/comm.h>
2223 .. doxygentypedef:: sg_comm_t
2232 .. doxygenfunction:: simgrid::s4u::Comm::get_dst_data_size() const
2233 .. doxygenfunction:: simgrid::s4u::Comm::get_mailbox() const
2234 .. doxygenfunction:: simgrid::s4u::Comm::get_sender() const
2235 .. doxygenfunction:: simgrid::s4u::Comm::set_dst_data(void **buff)
2236 .. doxygenfunction:: simgrid::s4u::Comm::set_dst_data(void **buff, size_t size)
2237 .. doxygenfunction:: simgrid::s4u::Comm::detach()
2238 .. doxygenfunction:: simgrid::s4u::Comm::detach(const std::function<void(void*)>& clean_function)
2239 .. doxygenfunction:: simgrid::s4u::Comm::set_payload_size(uint64_t bytes)
2240 .. doxygenfunction:: simgrid::s4u::Comm::set_rate(double rate)
2241 .. doxygenfunction:: simgrid::s4u::Comm::set_src_data(void *buff)
2242 .. doxygenfunction:: simgrid::s4u::Comm::set_src_data(void *buff, size_t size)
2243 .. doxygenfunction:: simgrid::s4u::Comm::set_src_data_size(size_t size)
2245 .. group-tab:: Python
2247 .. autoattribute:: simgrid.Comm.dst_data_size
2248 .. autoattribute:: simgrid.Comm.mailbox
2249 .. autoattribute:: simgrid.Comm.sender
2250 .. autoattribute:: simgrid.Comm.state_str
2251 .. automethod:: simgrid.Comm.detach
2252 .. automethod:: simgrid.Comm.set_payload_size
2253 .. automethod:: simgrid.Comm.set_rate
2255 Direct host-to-host communication
2256 ---------------------------------
2258 Most communications are created using :ref:`s4u_mailbox`, but you can
2259 also start direct communications as shown below. See also the
2260 :ref:`relevant examples <s4u_ex_comm_host2host>`.
2266 .. doxygenfunction:: simgrid::s4u::Comm::sendto
2267 .. doxygenfunction:: simgrid::s4u::Comm::sendto_init()
2268 .. doxygenfunction:: simgrid::s4u::Comm::sendto_init(Host *from, Host *to)
2269 .. doxygenfunction:: simgrid::s4u::Comm::sendto_async
2271 .. group-tab:: Python
2273 .. automethod:: simgrid.Comm.sendto
2274 .. automethod:: simgrid.Comm.sendto_init
2275 .. automethod:: simgrid.Comm.sendto_async
2284 .. doxygenfunction:: simgrid::s4u::Comm::cancel
2285 .. doxygenfunction:: simgrid::s4u::Comm::start
2286 .. doxygenfunction:: simgrid::s4u::Comm::test
2287 .. doxygenfunction:: simgrid::s4u::Comm::test_any(const std::vector< CommPtr >& comms)
2288 .. doxygenfunction:: simgrid::s4u::Comm::wait
2289 .. doxygenfunction:: simgrid::s4u::Comm::wait_all(const std::vector< CommPtr >& comms)
2290 .. doxygenfunction:: simgrid::s4u::Comm::wait_all_for(const std::vector< CommPtr >& comms, double timeout)
2291 .. doxygenfunction:: simgrid::s4u::Comm::wait_any(const std::vector< CommPtr >& comms)
2292 .. doxygenfunction:: simgrid::s4u::Comm::wait_any_for(const std::vector< CommPtr >& comms, double timeout)
2293 .. doxygenfunction:: simgrid::s4u::Comm::wait_for
2294 .. doxygenfunction:: simgrid::s4u::Comm::wait_until
2296 .. group-tab:: Python
2298 .. automethod:: simgrid.Comm.cancel
2299 .. automethod:: simgrid.Comm.start
2300 .. automethod:: simgrid.Comm.test
2301 .. automethod:: simgrid.Comm.test_any
2302 .. automethod:: simgrid.Comm.wait
2303 .. automethod:: simgrid.Comm.wait_for
2304 .. automethod:: simgrid.Comm.wait_all
2305 .. automethod:: simgrid.Comm.wait_all_for
2306 .. automethod:: simgrid.Comm.wait_any
2307 .. automethod:: simgrid.Comm.wait_any_for
2308 .. automethod:: simgrid.Comm.wait_until
2312 .. doxygenfunction:: sg_comm_test
2313 .. doxygenfunction:: sg_comm_wait
2314 .. doxygenfunction:: sg_comm_wait_all
2315 .. doxygenfunction:: sg_comm_wait_any
2317 Suspending and resuming a communication
2318 ---------------------------------------
2324 .. doxygenfunction:: simgrid::s4u::Comm::suspend
2325 .. doxygenfunction:: simgrid::s4u::Comm::resume
2326 .. doxygenfunction:: simgrid::s4u::Comm::is_suspended
2328 .. group-tab:: Python
2330 .. automethod:: simgrid.Comm.suspend
2331 .. automethod:: simgrid.Comm.resume
2332 .. autoattribute:: simgrid.Comm.is_suspended
2341 .. doxygenfunction:: simgrid::s4u::Comm::on_start_cb
2342 .. doxygenfunction:: simgrid::s4u::Comm::on_this_start_cb
2343 .. doxygenfunction:: simgrid::s4u::Comm::on_completion_cb
2344 .. doxygenfunction:: simgrid::s4u::Comm::on_this_completion_cb
2345 .. doxygenfunction:: simgrid::s4u::Comm::on_recv_cb
2346 .. doxygenfunction:: simgrid::s4u::Comm::on_send_cb
2347 .. doxygenfunction:: simgrid::s4u::Comm::on_suspended_cb
2348 .. doxygenfunction:: simgrid::s4u::Comm::on_resumed_cb
2349 .. doxygenfunction:: simgrid::s4u::Comm::on_veto_cb
2361 .. doxygenclass:: simgrid::s4u::Exec
2363 .. group-tab:: Python
2365 .. autoclass:: simgrid.Exec
2376 #include <simgrid/s4u/Exec.hpp>
2378 .. doxygentypedef:: ExecPtr
2380 .. group-tab:: Python
2384 from simgrid import Exec
2390 #include <simgrid/exec.h>
2392 .. doxygentypedef:: sg_exec_t
2393 .. doxygentypedef:: const_sg_exec_t
2402 .. doxygenfunction:: simgrid::s4u::Exec::get_cost() const
2403 .. doxygenfunction:: simgrid::s4u::Exec::get_finish_time() const
2404 .. doxygenfunction:: simgrid::s4u::Exec::get_host() const
2405 .. doxygenfunction:: simgrid::s4u::Exec::get_host_number() const
2406 .. doxygenfunction:: simgrid::s4u::Exec::get_remaining
2407 .. doxygenfunction:: simgrid::s4u::Exec::get_remaining_ratio
2408 .. doxygenfunction:: simgrid::s4u::Exec::get_start_time() const
2409 .. doxygenfunction:: simgrid::s4u::Exec::set_bound(double bound)
2410 .. doxygenfunction:: simgrid::s4u::Exec::set_host
2411 .. doxygenfunction:: simgrid::s4u::Exec::set_priority(double priority)
2413 .. group-tab:: Python
2415 .. autoattribute:: simgrid.Exec.host
2416 .. autoattribute:: simgrid.Exec.remaining
2417 .. autoattribute:: simgrid.Exec.remaining_ratio
2421 .. doxygenfunction:: sg_exec_set_bound(sg_exec_t exec, double bound)
2422 .. doxygenfunction:: sg_exec_get_name(const_sg_exec_t exec)
2423 .. doxygenfunction:: sg_exec_set_name(sg_exec_t exec, const char* name)
2424 .. doxygenfunction:: sg_exec_set_host(sg_exec_t exec, sg_host_t new_host)
2425 .. doxygenfunction:: sg_exec_get_remaining(const_sg_exec_t exec)
2426 .. doxygenfunction:: sg_exec_get_remaining_ratio(const_sg_exec_t exec)
2435 .. doxygenfunction:: simgrid::s4u::Exec::cancel
2436 .. doxygenfunction:: simgrid::s4u::Exec::start
2437 .. doxygenfunction:: simgrid::s4u::Exec::test
2438 .. doxygenfunction:: simgrid::s4u::Exec::wait
2439 .. doxygenfunction:: simgrid::s4u::Exec::wait_any(const std::vector< ExecPtr >& execs)
2440 .. doxygenfunction:: simgrid::s4u::Exec::wait_any_for(const std::vector< ExecPtr >& execs, double timeout)
2441 .. doxygenfunction:: simgrid::s4u::Exec::wait_for
2443 .. group-tab:: Python
2445 .. automethod:: simgrid.Exec.cancel
2446 .. automethod:: simgrid.Exec.start
2447 .. automethod:: simgrid.Exec.test
2448 .. automethod:: simgrid.Exec.wait
2452 .. doxygenfunction:: sg_exec_start(sg_exec_t exec)
2453 .. doxygenfunction:: sg_exec_cancel(sg_exec_t exec);
2454 .. doxygenfunction:: sg_exec_test(sg_exec_t exec);
2455 .. doxygenfunction:: sg_exec_wait(sg_exec_t exec);
2456 .. doxygenfunction:: sg_exec_wait_for(sg_exec_t exec, double timeout);
2457 .. doxygenfunction:: sg_exec_wait_any_for(sg_exec_t* execs, size_t count, double timeout);
2458 .. doxygenfunction:: sg_exec_wait_any(sg_exec_t* execs, size_t count);
2460 Suspending and resuming an execution
2461 ------------------------------------
2467 .. doxygenfunction:: simgrid::s4u::Exec::suspend
2468 .. doxygenfunction:: simgrid::s4u::Exec::resume
2469 .. doxygenfunction:: simgrid::s4u::Exec::is_suspended
2471 .. group-tab:: Python
2473 .. automethod:: simgrid.Exec.suspend
2474 .. automethod:: simgrid.Exec.resume
2475 .. autoattribute:: simgrid.Exec.is_suspended
2484 .. doxygenfunction:: simgrid::s4u::Exec::on_start_cb
2485 .. doxygenfunction:: simgrid::s4u::Exec::on_this_start_cb
2486 .. doxygenfunction:: simgrid::s4u::Exec::on_completion_cb
2487 .. doxygenfunction:: simgrid::s4u::Exec::on_this_completion_cb
2489 .. doxygenfunction:: simgrid::s4u::Exec::on_suspended_cb
2490 .. doxygenfunction:: simgrid::s4u::Exec::on_resumed_cb
2491 .. doxygenfunction:: simgrid::s4u::Exec::on_veto_cb
2503 .. doxygenclass:: simgrid::s4u::Io
2505 .. group-tab:: Python
2507 .. autoclass:: simgrid.Io
2518 #include <simgrid/s4u/Io.hpp>
2520 .. doxygentypedef:: IoPtr
2529 .. doxygenfunction:: simgrid::s4u::Io::get_performed_ioops() const
2530 .. doxygenfunction:: simgrid::s4u::Io::get_remaining
2539 .. doxygenfunction:: simgrid::s4u::Io::cancel
2540 .. doxygenfunction:: simgrid::s4u::Io::start
2541 .. doxygenfunction:: simgrid::s4u::Io::test
2542 .. doxygenfunction:: simgrid::s4u::Io::wait
2543 .. doxygenfunction:: simgrid::s4u::Io::wait_for
2544 .. doxygenfunction:: simgrid::s4u::Io::wait_any(const std::vector<IoPtr> &ios)
2545 .. doxygenfunction:: simgrid::s4u::Io::wait_any_for(const std::vector<IoPtr> &ios, double timeout)
2547 .. group-tab:: Python
2549 .. automethod:: simgrid.Io.test
2550 .. automethod:: simgrid.Io.wait
2551 .. automethod:: simgrid.Io.wait_any_for
2552 .. automethod:: simgrid.Io.wait_any
2561 .. doxygenfunction:: simgrid::s4u::Io::on_start_cb
2562 .. doxygenfunction:: simgrid::s4u::Io::on_this_start_cb
2563 .. doxygenfunction:: simgrid::s4u::Io::on_completion_cb
2564 .. doxygenfunction:: simgrid::s4u::Io::on_this_completion_cb
2566 .. doxygenfunction:: simgrid::s4u::Io::on_suspended_cb
2567 .. doxygenfunction:: simgrid::s4u::Io::on_resumed_cb
2568 .. doxygenfunction:: simgrid::s4u::Io::on_veto_cb
2581 .. doxygenclass:: simgrid::s4u::Task
2583 **Known subclasses:**
2584 :ref:`Communication Tasks <API_s4u_CommTask>`,
2585 :ref:`Executions Tasks <API_s4u_ExecTask>`,
2586 :ref:`I/O Tasks <API_s4u_Task>`.
2587 See also the :ref:`section on activities <s4u_Tasks>` above.
2598 #include <simgrid/s4u/Task.hpp>
2600 .. doxygentypedef:: TaskPtr
2609 .. doxygenfunction:: simgrid::s4u::Task::get_cname() const
2610 .. doxygenfunction:: simgrid::s4u::Task::get_name() const
2611 .. doxygenfunction:: simgrid::s4u::Task::get_count() const
2612 .. doxygenfunction:: simgrid::s4u::Task::get_amount() const
2613 .. doxygenfunction:: simgrid::s4u::Task::set_amount(double amount)
2621 .. doxygenfunction:: simgrid::s4u::Task::enqueue_firings(int n)
2623 Managing Dependencies
2624 ---------------------
2628 .. doxygenfunction:: simgrid::s4u::Task::add_successor(TaskPtr t)
2629 .. doxygenfunction:: simgrid::s4u::Task::remove_successor(TaskPtr t)
2630 .. doxygenfunction:: simgrid::s4u::Task::remove_all_successors()
2631 .. doxygenfunction:: simgrid::s4u::Task::get_successors() const
2635 .. doxygenclass:: simgrid::s4u::Token
2640 .. doxygenfunction:: simgrid::s4u::Task::set_token(std::shared_ptr<Token> token)
2641 .. doxygenfunction:: simgrid::s4u::Task::get_next_token_from(TaskPtr t)
2649 .. doxygenfunction:: simgrid::s4u::Task::on_start_cb
2650 .. doxygenfunction:: simgrid::s4u::Task::on_this_start_cb
2651 .. doxygenfunction:: simgrid::s4u::Task::on_completion_cb
2652 .. doxygenfunction:: simgrid::s4u::Task::on_this_completion_cb
2654 .. _API_s4u_CommTask:
2663 .. doxygenclass:: simgrid::s4u::CommTask
2674 #include <simgrid/s4u/Task.hpp>
2676 .. doxygentypedef:: CommTaskPtr
2685 .. doxygenfunction:: simgrid::s4u::Task::get_source() const
2686 .. doxygenfunction:: simgrid::s4u::Task::get_destination() const
2687 .. doxygenfunction:: simgrid::s4u::Task::get_bytes() const
2688 .. doxygenfunction:: simgrid::s4u::Task::set_source(simgrid::s4u::Host* source);
2689 .. doxygenfunction:: simgrid::s4u::Task::set_destination(simgrid::s4u::Host* destination);
2690 .. doxygenfunction:: simgrid::s4u::Task::set_bytes(double bytes)
2693 .. _API_s4u_ExecTask:
2702 .. doxygenclass:: simgrid::s4u::ExecTask
2713 #include <simgrid/s4u/Task.hpp>
2715 .. doxygentypedef:: ExecTaskPtr
2724 .. doxygenfunction:: simgrid::s4u::Task::get_host() const
2725 .. doxygenfunction:: simgrid::s4u::Task::get_flops() const
2726 .. doxygenfunction:: simgrid::s4u::Task::set_host(simgrid::s4u::Host* host);
2727 .. doxygenfunction:: simgrid::s4u::Task::set_flops(double flops);
2738 .. doxygenclass:: simgrid::s4u::IoTask
2749 #include <simgrid/s4u/Task.hpp>
2751 .. doxygentypedef:: IoTaskPtr
2760 .. doxygenfunction:: simgrid::s4u::Task::get_disk() const
2761 .. doxygenfunction:: simgrid::s4u::Task::get_bytes() const
2762 .. doxygenfunction:: simgrid::s4u::Task::get_op_type() const
2763 .. doxygenfunction:: simgrid::s4u::Task::set_disk(simgrid::s4u::Disk* disk);
2764 .. doxygenfunction:: simgrid::s4u::Task::set_bytes(simgrid::double bytes);
2765 .. doxygenfunction:: simgrid::s4u::Task::set_op_type(simgrid::s4u::Io::OpType type);
2767 .. _API_s4u_Synchronizations:
2769 =======================
2770 Synchronization Objects
2771 =======================
2783 .. doxygenclass:: simgrid::s4u::Mutex
2785 .. group-tab:: Python
2787 .. autoclass:: simgrid.Mutex
2798 #include <simgrid/s4u/Mutex.hpp>
2800 .. doxygentypedef:: MutexPtr
2802 .. doxygenfunction:: simgrid::s4u::Mutex::create()
2804 .. group-tab:: Python
2806 .. code-block:: Python
2808 from simgrid import Mutex
2811 # Use a context manager to acquire and automatically release the mutex
2812 # when leaving the scope.
2814 # Access shared resource ...
2817 .. automethod:: simgrid.Mutex.__init__
2823 #include <simgrid/mutex.h>
2825 .. doxygentypedef:: sg_mutex_t
2826 .. cpp:type:: const s4u_Mutex* const_sg_mutex_t
2828 Pointer to a constant mutex object.
2830 .. doxygenfunction:: sg_mutex_init()
2831 .. doxygenfunction:: sg_mutex_destroy(const_sg_mutex_t mutex)
2840 .. doxygenfunction:: simgrid::s4u::Mutex::lock()
2841 .. doxygenfunction:: simgrid::s4u::Mutex::try_lock()
2842 .. doxygenfunction:: simgrid::s4u::Mutex::unlock()
2844 .. group-tab:: Python
2846 .. automethod:: simgrid.Mutex.lock
2847 .. automethod:: simgrid.Mutex.try_lock
2848 .. automethod:: simgrid.Mutex.unlock
2852 .. doxygenfunction:: sg_mutex_lock(sg_mutex_t mutex)
2853 .. doxygenfunction:: sg_mutex_try_lock(sg_mutex_t mutex)
2854 .. doxygenfunction:: sg_mutex_unlock(sg_mutex_t mutex)
2856 .. _API_s4u_Barrier:
2866 .. doxygenclass:: simgrid::s4u::Barrier
2868 .. group-tab:: Python
2870 .. autoclass:: simgrid.Barrier
2878 #include <simgrid/s4u/Barrier.hpp>
2880 .. doxygentypedef:: BarrierPtr
2882 .. doxygenfunction:: simgrid::s4u::Barrier::create(unsigned int expected_actors)
2883 .. doxygenfunction:: simgrid::s4u::Barrier::wait()
2885 .. group-tab:: Python
2887 .. code-block:: Python
2889 from simgrid import Barrier
2890 barrier = Barrier(2)
2892 .. automethod:: simgrid.Barrier.__init__
2893 .. automethod:: simgrid.Barrier.wait
2899 #include <simgrid/barrier.hpp>
2901 .. doxygentypedef:: sg_bar_t
2903 .. doxygenfunction:: sg_barrier_init(unsigned int count)
2904 .. doxygenfunction:: sg_barrier_destroy(sg_bar_t bar)
2905 .. doxygenfunction:: sg_barrier_wait(sg_bar_t bar)
2908 .. _API_s4u_ConditionVariable:
2910 ==========================
2911 Condition variable
2912 ==========================
2914 .. doxygenclass:: simgrid::s4u::ConditionVariable
2925 #include <simgrid/s4u/ConditionVariable.hpp>
2927 .. doxygentypedef:: ConditionVariablePtr
2929 .. doxygenfunction:: simgrid::s4u::ConditionVariable::create()
2935 #include <simgrid/cond.h>
2937 .. doxygentypedef:: sg_cond_t
2938 .. doxygentypedef:: const_sg_cond_t
2939 .. doxygenfunction:: sg_cond_init
2940 .. doxygenfunction:: sg_cond_destroy
2942 Waiting and notifying
2943 ---------------------
2949 .. doxygenfunction:: simgrid::s4u::ConditionVariable::notify_all()
2950 .. doxygenfunction:: simgrid::s4u::ConditionVariable::notify_one()
2951 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait(s4u::MutexPtr lock)
2952 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait(const std::unique_lock< s4u::Mutex > &lock)
2953 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait(const std::unique_lock< Mutex > &lock, P pred)
2954 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_for(const std::unique_lock< s4u::Mutex > &lock, double duration)
2955 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_for(const std::unique_lock< s4u::Mutex > &lock, double duration, P pred)
2956 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_for(const std::unique_lock< s4u::Mutex > &lock, std::chrono::duration< Rep, Period > duration)
2957 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_for(const std::unique_lock< s4u::Mutex > &lock, std::chrono::duration< Rep, Period > duration, P pred)
2958 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_until(const std::unique_lock< s4u::Mutex > &lock, const SimulationTimePoint< Duration > &timeout_time)
2959 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_until(const std::unique_lock< s4u::Mutex > &lock, const SimulationTimePoint< Duration > &timeout_time, P pred)
2960 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_until(const std::unique_lock< s4u::Mutex > &lock, double timeout_time)
2961 .. doxygenfunction:: simgrid::s4u::ConditionVariable::wait_until(const std::unique_lock< s4u::Mutex > &lock, double timeout_time, P pred)
2965 .. doxygenfunction:: sg_cond_notify_all
2966 .. doxygenfunction:: sg_cond_notify_one
2967 .. doxygenfunction:: sg_cond_wait
2968 .. doxygenfunction:: sg_cond_wait_for
2970 .. _API_s4u_Semaphore:
2980 .. doxygenclass:: simgrid::s4u::Semaphore
2982 .. group-tab:: Python
2984 .. autoclass:: simgrid.Semaphore
2995 #include <simgrid/s4u/Semaphore.hpp>
2997 .. doxygentypedef:: SemaphorePtr
2998 .. doxygenfunction:: simgrid::s4u::Semaphore::create(unsigned int initial_capacity)
3000 .. group-tab:: Python
3002 .. code-block:: Python
3004 from simgrid import Semaphore
3005 semaphore = Semaphore(1)
3006 # Automatically acquire the semaphore, and release it after leaving the scope.
3008 # Do something with the shared resource
3011 .. automethod:: simgrid.Semaphore.__init__
3017 #include <simgrid/semaphore.h>
3019 .. doxygentypedef:: sg_sem_t
3020 .. cpp:type:: const s4u_Semaphore* const_sg_sem_t
3022 Pointer to a constant semaphore object.
3024 .. doxygenfunction:: sg_sem_init(int initial_value)
3025 .. doxygenfunction:: sg_sem_destroy(const_sg_sem_t sem)
3034 .. doxygenfunction:: simgrid::s4u::Semaphore::acquire()
3035 .. doxygenfunction:: simgrid::s4u::Semaphore::acquire_timeout(double timeout)
3036 .. doxygenfunction:: simgrid::s4u::Semaphore::get_capacity() const
3037 .. doxygenfunction:: simgrid::s4u::Semaphore::release()
3038 .. doxygenfunction:: simgrid::s4u::Semaphore::would_block() const
3040 .. group-tab:: Python
3042 .. automethod:: simgrid.Semaphore.acquire
3043 .. automethod:: simgrid.Semaphore.acquire_timeout
3044 .. autoattribute:: simgrid.Semaphore.capacity
3045 .. automethod:: simgrid.Semaphore.release
3046 .. autoattribute:: simgrid.Semaphore.would_block
3050 .. doxygenfunction:: sg_sem_acquire(sg_sem_t sem)
3051 .. doxygenfunction:: sg_sem_acquire_timeout(sg_sem_t sem, double timeout)
3052 .. doxygenfunction:: sg_sem_get_capacity(const_sg_sem_t sem)
3053 .. doxygenfunction:: sg_sem_release(sg_sem_t sem)
3054 .. doxygenfunction:: sg_sem_would_block(const_sg_sem_t sem)
3064 .. doxygenclass:: simgrid::Exception
3066 The following exceptions denote a problem in the simulated platform, and it is often useful to catch them.
3068 .. doxygenclass:: simgrid::CancelException
3069 .. doxygenclass:: simgrid::HostFailureException
3070 .. doxygenclass:: simgrid::NetworkFailureException
3071 .. doxygenclass:: simgrid::StorageFailureException
3072 .. doxygenclass:: simgrid::TimeoutException
3073 .. doxygenclass:: simgrid::VmFailureException
3075 The following errors denote a problem in the SimGrid tool itself. Most of the time, you should let these
3076 exception go, so that the simulation stops. But you may want to catch them, for example when you launch
3077 SimGrid from a python notebook and want to handle the problem accordingly.
3079 .. doxygenclass:: simgrid::AssertionError
3080 .. doxygenclass:: simgrid::ParseError
3081 .. doxygenclass:: simgrid::TracingError
3083 .. group-tab:: Python
3085 The following exceptions denote a problem in the simulated platform, and it is often useful to catch them.
3087 .. autoclass:: simgrid.CancelException
3088 .. autoclass:: simgrid.HostFailureException
3089 .. autoclass:: simgrid.NetworkFailureException
3090 .. autoclass:: simgrid.StorageFailureException
3091 .. autoclass:: simgrid.TimeoutException
3092 .. autoclass:: simgrid.VmFailureException
3094 The following errors denote a problem in the SimGrid tool itself. Most of the time, you should let these
3095 exception go, so that the simulation stops. But you may want to catch them, for example when you launch
3096 SimGrid from a python notebook and want to handle the problem accordingly.
3098 .. autoclass:: simgrid.AssertionError
3102 .. doxygenenum:: sg_error_t