.. doxygenfunction:: simgrid::s4u::Actor::join() const
.. doxygenfunction:: simgrid::s4u::Actor::join(double timeout) const
.. doxygenfunction:: simgrid::s4u::Actor::set_auto_restart(bool autorestart)
+ .. doxygenfunction:: simgrid::s4u::Actor::get_restart_count()
.. group-tab:: Python
.. autofunction:: simgrid.this_actor.debug
.. autofunction:: simgrid.this_actor.info
+ .. autofunction:: simgrid.this_actor.warning
.. autofunction:: simgrid.this_actor.error
Sleeping
.. group-tab:: Python
.. automethod:: simgrid.Engine.__init__
- .. automethod:: simgrid.Engine.instance
+ .. autoattribute:: simgrid.Engine.instance
.. group-tab:: C
.. group-tab:: Python
- .. automethod:: simgrid.Engine.get_clock
+ .. autoattribute:: simgrid.Engine.clock
.. automethod:: simgrid.Engine.run
.. automethod:: simgrid.Engine.run_until
.. group-tab:: Python
- .. automethod:: simgrid.Engine.get_all_hosts
+ .. autoattribute:: simgrid.Engine.all_hosts
.. group-tab:: C
.. group-tab:: Python
- .. automethod:: simgrid.Engine.get_all_links
+ .. autoattribute:: simgrid.Engine.all_links
Interacting with the routing
----------------------------
.. doxygenfunction:: simgrid::s4u::Engine::get_netzone_root
.. doxygenfunction:: simgrid::s4u::Engine::netpoint_by_name_or_null
.. doxygenfunction:: simgrid::s4u::Engine::netzone_by_name_or_null
- .. doxygenfunction:: simgrid::s4u::Engine::set_netzone_root(const NetZone *netzone)
.. group-tab:: Python
- .. automethod:: simgrid.Engine.get_all_netpoints
- .. automethod:: simgrid.Engine.get_netzone_root
+ .. autoattribute:: simgrid.Engine.all_netpoints
+ .. autoattribute:: simgrid.Engine.netzone_root
.. automethod:: simgrid.Engine.netpoint_by_name
.. automethod:: simgrid.Engine.netzone_by_name
- .. automethod:: simgrid.Engine.set_netzone_root
Signals
-------
.. doxygenfunction:: simgrid::s4u::Engine::on_deadlock_cb
.. doxygenfunction:: simgrid::s4u::Engine::on_platform_created_cb
.. doxygenfunction:: simgrid::s4u::Engine::on_platform_creation_cb
+ .. doxygenfunction:: simgrid::s4u::Engine::on_simulation_start_cb
.. doxygenfunction:: simgrid::s4u::Engine::on_simulation_end_cb
.. doxygenfunction:: simgrid::s4u::Engine::on_time_advance_cb
.. automethod:: simgrid.Mailbox.put
.. automethod:: simgrid.Mailbox.put_async
+ .. automethod:: simgrid.Mailbox.put_init
.. group-tab:: C
.. doxygenfunction:: simgrid::s4u::Mailbox::get(double timeout)
.. doxygenfunction:: simgrid::s4u::Mailbox::get_async(T **data)
.. doxygenfunction:: simgrid::s4u::Mailbox::get_init()
- .. doxygenfunction:: simgrid::s4u::Mailbox::iprobe(int type, bool(*match_fun)(void *, void *, kernel::activity::CommImpl *), void *data)
+ .. doxygenfunction:: simgrid::s4u::Mailbox::iprobe(int type, const std::function<bool(void *, void *, kernel::activity::CommImpl *)>& match_fun, void *data)
.. doxygenfunction:: simgrid::s4u::Mailbox::listen
.. doxygenfunction:: simgrid::s4u::Mailbox::ready
.. group-tab:: Python
- See also :py:func:`simgrid.Engine.get_all_hosts`.
+ See also :py:attr:`simgrid.Engine.all_hosts`.
.. automethod:: simgrid.Host.by_name
.. automethod:: simgrid.Host.current
.. group-tab:: Python
- .. automethod:: simgrid.Host.set_core_count
+ .. autoattribute:: simgrid.Host.core_count
.. automethod:: simgrid.Host.set_coordinates
.. automethod:: simgrid.Host.set_sharing_policy
.. group-tab:: Python
.. autoattribute:: simgrid.Host.name
+ .. autoattribute:: simgrid.Host.core_count
.. autoattribute:: simgrid.Host.load
.. autoattribute:: simgrid.Host.pstate
.. autoattribute:: simgrid.Host.speed
.. group-tab:: C
.. doxygenfunction:: sg_host_core_count(const_sg_host_t host)
- .. doxygenfunction:: sg_host_dump(const_sg_host_t ws)
.. doxygenfunction:: sg_host_get_name(const_sg_host_t host)
.. doxygenfunction:: sg_host_get_load(const_sg_host_t host)
.. doxygenfunction:: sg_host_get_speed(const_sg_host_t host)
.. group-tab:: Python
- .. automethod:: simgrid.Host.get_pstate_count
- .. automethod:: simgrid.Host.get_pstate_speed
+ .. autoattribute:: simgrid.Host.pstate_count
+ .. automethod:: simgrid.Host.pstate_speed
.. group-tab:: C
.. group-tab:: Python
- .. automethod:: simgrid.Host.get_netpoint
+ .. autoattribute:: simgrid.Host.netpoint
.. automethod:: simgrid.Host.create_disk
.. automethod:: simgrid.Host.route_to
.. group-tab:: Python
- See also :py:func:`simgrid.Engine.get_all_links`.
+ See also :py:attr:`simgrid.Engine.all_links`.
.. automethod:: simgrid.Link.by_name
.. autoattribute:: simgrid.Link.name
.. group-tab:: Python
.. autoattribute:: simgrid.NetZone.name
- .. automethod:: simgrid.NetZone.get_netpoint
+ .. autoattribute:: simgrid.NetZone.netpoint
.. group-tab:: C
#include <simgrid/comm.h>
.. doxygentypedef:: sg_comm_t
- .. doxygentypedef:: const_sg_comm_t
Querying info
-------------
.. doxygenfunction:: simgrid::s4u::Comm::set_dst_data(void **buff)
.. doxygenfunction:: simgrid::s4u::Comm::set_dst_data(void **buff, size_t size)
.. doxygenfunction:: simgrid::s4u::Comm::detach()
- .. doxygenfunction:: simgrid::s4u::Comm::detach(void(*clean_function)(void *))
+ .. doxygenfunction:: simgrid::s4u::Comm::detach(const std::function<void(void*)>& clean_function)
.. doxygenfunction:: simgrid::s4u::Comm::set_payload_size(uint64_t bytes)
.. doxygenfunction:: simgrid::s4u::Comm::set_rate(double rate)
.. doxygenfunction:: simgrid::s4u::Comm::set_src_data(void *buff)
.. doxygenfunction:: simgrid::s4u::Comm::set_src_data(void *buff, size_t size)
.. doxygenfunction:: simgrid::s4u::Comm::set_src_data_size(size_t size)
+ .. group-tab:: Python
+
+ .. automethod:: simgrid.Comm.detach
+
Life cycle
----------
.. automethod:: simgrid.Comm.test
.. automethod:: simgrid.Comm.wait
+ .. automethod:: simgrid.Comm.wait_for
.. automethod:: simgrid.Comm.wait_all
+ .. automethod:: simgrid.Comm.wait_all_for
.. automethod:: simgrid.Comm.wait_any
+ .. automethod:: simgrid.Comm.wait_any_for
.. group-tab:: C
Mutex
==============
-.. doxygenclass:: simgrid::s4u::Mutex
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. doxygenclass:: simgrid::s4u::Mutex
+
+ .. group-tab:: Python
+
+ .. autoclass:: simgrid.Mutex
Basic management
----------------
.. doxygenfunction:: simgrid::s4u::Mutex::create()
+ .. group-tab:: Python
+
+ .. code-block:: Python
+
+ from simgrid import Mutex
+ mutex = Mutex()
+
+ # Use a context manager to acquire and automatically release the mutex
+ # when leaving the scope.
+ with mutex:
+ # Access shared resource ...
+ pass
+
.. group-tab:: C
.. code-block:: C
.. doxygenfunction:: simgrid::s4u::Mutex::try_lock()
.. doxygenfunction:: simgrid::s4u::Mutex::unlock()
+ .. group-tab:: Python
+
+ .. automethod:: simgrid.Mutex.lock()
+ .. automethod:: simgrid.Mutex.try_lock()
+ .. automethod:: simgrid.Mutex.unlock()
+
.. group-tab:: C
.. doxygenfunction:: sg_mutex_lock(sg_mutex_t mutex)
#include <simgrid/barrier.hpp>
.. doxygentypedef:: sg_bar_t
- .. doxygentypedef:: const_sg_bar_t
.. doxygenfunction:: sg_barrier_init(unsigned int count)
- .. doxygenfunction:: sg_barrier_destroy(const_sg_bar_t bar)
+ .. doxygenfunction:: sg_barrier_destroy(sg_bar_t bar)
.. doxygenfunction:: sg_barrier_wait(sg_bar_t bar)