+ .. group-tab:: C++
+
+ See also :cpp:func:`simgrid::s4u::Engine::get_all_links`.
+
+ .. autodoxymethod:: simgrid::s4u::Link::by_name(const std::string &name)
+ .. autodoxymethod:: simgrid::s4u::Link::by_name_or_null(const std::string &name)
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_link_by_name(const char *name)
+ .. autodoxymethod:: sg_link_count()
+ .. autodoxymethod:: sg_link_list()
+
+Querying info
+--------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Link::get_bandwidth() const
+ .. autodoxymethod:: simgrid::s4u::Link::get_cname() const
+ .. autodoxymethod:: simgrid::s4u::Link::get_latency() const
+ .. autodoxymethod:: simgrid::s4u::Link::get_name() const
+ .. autodoxymethod:: simgrid::s4u::Link::get_sharing_policy() const
+ .. autodoxymethod:: simgrid::s4u::Link::get_usage() const
+ .. autodoxymethod:: simgrid::s4u::Link::is_used() const
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_link_bandwidth(const_sg_link_t link)
+ .. autodoxymethod:: sg_link_is_shared(const_sg_link_t link)
+ .. autodoxymethod:: sg_link_latency(const_sg_link_t link)
+ .. autodoxymethod:: sg_link_name(const_sg_link_t link)
+
+Modifying characteristics
+-------------------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Link::set_bandwidth(double value)
+ .. autodoxymethod:: simgrid::s4u::Link::set_latency(double value)
+
+User data and properties
+------------------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Link::get_property(const std::string &key) const
+ .. autodoxymethod:: simgrid::s4u::Link::set_property(const std::string &key, const std::string &value)
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_link_data(const_sg_link_t link)
+ .. autodoxymethod:: sg_link_data_set(sg_link_t link, void *data)
+
+On/Off
+------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ See also :cpp:func:`simgrid::s4u::Link::set_state_profile`.
+
+ .. autodoxymethod:: simgrid::s4u::Link::is_on() const
+ .. autodoxymethod:: simgrid::s4u::Link::turn_off()
+ .. autodoxymethod:: simgrid::s4u::Link::turn_on()
+
+Dynamic profiles
+----------------
+
+See :ref:`howto_churn` for more details.
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Link::set_bandwidth_profile(kernel::profile::Profile *profile)
+ .. autodoxymethod:: simgrid::s4u::Link::set_latency_profile(kernel::profile::Profile *profile)
+ .. autodoxymethod:: simgrid::s4u::Link::set_state_profile(kernel::profile::Profile *profile)
+
+WIFI links
+----------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Link::set_host_wifi_rate
+
+Signals
+-------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxyvar:: simgrid::s4u::Link::on_bandwidth_change
+ .. cpp:var:: xbt::signal<void(kernel::resource::NetworkAction&, Host* src, Host* dst)> Link::on_communicate
+ .. autodoxyvar:: simgrid::s4u::Link::on_communication_state_change
+ .. autodoxyvar:: simgrid::s4u::Link::on_creation
+ .. autodoxyvar:: simgrid::s4u::Link::on_destruction
+ .. autodoxyvar:: simgrid::s4u::Link::on_state_change
+
+.. _API_s4u_NetZone:
+
+================
+ class NetZone
+================
+
+.. autodoxyclass:: simgrid::s4u::NetZone
+
+Basic management
+----------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/NetZone.hpp>
+
+ Note that there is no NetZonePtr type, and that you cannot use the RAII
+ idiom on network zones because SimGrid does not allow (yet) to create nor
+ destroy resources once the simulation is started.
+
+ .. group-tab:: C
+
+ .. code:: C
+
+ #include <simgrid/zone.h>
+
+ .. doxygentypedef:: sg_netzone_t
+ .. cpp:type:: const s4u_NetZone* const_sg_netzone_t
+
+ Pointer to a constant network zone object.
+
+Retrieving zones
+----------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ See :cpp:func:`simgrid::s4u::Engine::get_netzone_root`,
+ :cpp:func:`simgrid::s4u::Engine::netzone_by_name_or_null` and
+ :cpp:func:`simgrid::s4u::Engine::get_filtered_netzones`.
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_zone_get_by_name(const char *name)
+ .. autodoxymethod:: sg_zone_get_root()
+
+Querying info
+--------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_cname() const
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_name() const
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_zone_get_name(const_sg_netzone_t zone)
+
+User data and properties
+------------------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_properties() const
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_property(const std::string &key) const
+ .. autodoxymethod:: simgrid::s4u::NetZone::set_property(const std::string &key, const std::string &value)
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_zone_get_property_value(const_sg_netzone_t as, const char *name)
+ .. autodoxymethod:: sg_zone_set_property_value(sg_netzone_t netzone, const char *name, const char *value)
+
+Retrieving components
+---------------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_all_hosts() const
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_host_count() const
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_zone_get_hosts(const_sg_netzone_t zone, xbt_dynar_t whereto)
+
+Routing data
+------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::NetZone::add_bypass_route
+ .. autodoxymethod:: simgrid::s4u::NetZone::add_component(kernel::routing::NetPoint *elm)
+ .. autodoxymethod:: simgrid::s4u::NetZone::add_route
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_children() const
+ .. autodoxymethod:: simgrid::s4u::NetZone::get_father()
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_zone_get_sons(const_sg_netzone_t zone, xbt_dict_t whereto)
+
+Signals
+-------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxyvar:: simgrid::s4u::NetZone::on_creation
+ .. autodoxyvar:: simgrid::s4u::NetZone::on_route_creation
+ .. autodoxyvar:: simgrid::s4u::NetZone::on_seal
+
+.. _API_s4u_VirtualMachine:
+
+=======================
+ class VirtualMachine
+=======================
+
+
+.. autodoxyclass:: simgrid::s4u::VirtualMachine
+
+Basic management
+----------------
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/VirtualMachine.hpp>
+
+ Note that there is no VirtualMachinePtr type, and that you cannot use the RAII
+ idiom on virtual machines. There is no good reason for that and should change in the future.
+
+ .. group-tab:: C
+
+ .. code:: C
+
+ #include <simgrid/vm.h>
+
+ .. doxygentypedef:: sg_vm_t
+ .. cpp:type:: const s4u_VirtualMachine* const_sg_vm_t
+
+ Pointer to a constant virtual machine object.
+
+Creating VMs
+------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::VirtualMachine(const std::string &name, Host *physical_host, int core_amount)
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::VirtualMachine(const std::string &name, Host *physical_host, int core_amount, size_t ramsize)
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::destroy
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_vm_create_core
+ .. autodoxymethod:: sg_vm_create_multicore
+ .. autodoxymethod:: sg_vm_destroy
+
+Querying info
+--------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_pm() const
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_ramsize() const
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::get_state()
+
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::set_bound(double bound)
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::set_pm(Host *pm)
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::set_ramsize(size_t ramsize)
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_vm_get_ramsize(const_sg_vm_t vm)
+ .. autodoxymethod:: sg_vm_set_bound(sg_vm_t vm, double bound)
+ .. autodoxymethod:: sg_vm_set_ramsize(sg_vm_t vm, size_t size)
+
+ .. autodoxymethod:: sg_vm_get_name
+ .. autodoxymethod:: sg_vm_get_pm
+ .. autodoxymethod:: sg_vm_is_created
+ .. autodoxymethod:: sg_vm_is_running
+ .. autodoxymethod:: sg_vm_is_suspended
+
+Life cycle
+----------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::resume()
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::shutdown()
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::start()
+ .. autodoxymethod:: simgrid::s4u::VirtualMachine::suspend()
+
+ .. group-tab:: C
+
+ .. autodoxymethod:: sg_vm_start
+ .. autodoxymethod:: sg_vm_suspend
+ .. autodoxymethod:: sg_vm_resume
+ .. autodoxymethod:: sg_vm_shutdown
+
+Signals
+-------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_migration_end
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_migration_start
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_resume
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_shutdown
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_start
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_started
+ .. autodoxyvar:: simgrid::s4u::VirtualMachine::on_suspend
+
+.. _API_s4u_Activity:
+
+==============
+class Activity
+==============
+
+.. autodoxyclass:: simgrid::s4u::Activity
+
+ **Known subclasses:**
+ :ref:`Communications <API_s4u_Comm>` (started on Mailboxes and consuming links),
+ :ref:`Executions <API_s4u_Exec>` (started on Host and consuming CPU resources)
+ :ref:`I/O <API_s4u_Io>` (started on and consumming disks).
+ See also the :ref:`section on activities <s4u_Activities>` above.
+
+Basic management
+----------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/Activity.hpp>
+
+ .. doxygentypedef:: ActivityPtr
+
+Querying info
+-------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Activity::get_cname
+ .. autodoxymethod:: simgrid::s4u::Activity::get_name
+ .. autodoxymethod:: simgrid::s4u::Activity::get_remaining() const
+ .. autodoxymethod:: simgrid::s4u::Activity::get_state() const
+ .. autodoxymethod:: simgrid::s4u::Activity::set_remaining(double remains)
+ .. autodoxymethod:: simgrid::s4u::Activity::set_state(Activity::State state)
+
+
+Activities life cycle
+---------------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Activity::start
+ .. autodoxymethod:: simgrid::s4u::Activity::cancel
+ .. autodoxymethod:: simgrid::s4u::Activity::test
+ .. autodoxymethod:: simgrid::s4u::Activity::wait
+ .. autodoxymethod:: simgrid::s4u::Activity::wait_for
+ .. autodoxymethod:: simgrid::s4u::Activity::wait_until(double time_limit)
+ .. autodoxymethod:: simgrid::s4u::Activity::vetoable_start()
+
+Suspending and resuming an activity
+-----------------------------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Activity::suspend
+ .. autodoxymethod:: simgrid::s4u::Activity::resume
+ .. autodoxymethod:: simgrid::s4u::Activity::is_suspended
+
+.. _API_s4u_Comm:
+
+=============
+ class Comm
+=============
+
+.. autodoxyclass:: simgrid::s4u::Comm
+
+Basic management
+----------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/Comm.hpp>
+
+ .. doxygentypedef:: CommPtr
+
+ .. group-tab:: Python
+
+ .. code:: Python
+
+ from simgrid import Comm
+
+Querying info
+-------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Comm::get_dst_data_size() const
+ .. autodoxymethod:: simgrid::s4u::Comm::get_mailbox() const
+ .. autodoxymethod:: simgrid::s4u::Comm::get_sender() const
+ .. autodoxymethod:: simgrid::s4u::Comm::set_dst_data(void **buff)
+ .. autodoxymethod:: simgrid::s4u::Comm::set_dst_data(void **buff, size_t size)
+ .. autodoxymethod:: simgrid::s4u::Comm::detach()
+ .. autodoxymethod:: simgrid::s4u::Comm::detach(void(*clean_function)(void *))
+ .. autodoxymethod:: simgrid::s4u::Comm::set_rate(double rate)
+ .. autodoxymethod:: simgrid::s4u::Comm::set_src_data(void *buff)
+ .. autodoxymethod:: simgrid::s4u::Comm::set_src_data(void *buff, size_t size)
+ .. autodoxymethod:: simgrid::s4u::Comm::set_src_data_size(size_t size)
+ .. autodoxymethod:: simgrid::s4u::Comm::set_tracing_category(const std::string &category)
+
+Life cycle
+----------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Comm::cancel
+ .. autodoxymethod:: simgrid::s4u::Comm::start
+ .. autodoxymethod:: simgrid::s4u::Comm::test
+ .. autodoxymethod:: simgrid::s4u::Comm::test_any(const std::vector< CommPtr > *comms)
+ .. autodoxymethod:: simgrid::s4u::Comm::wait
+ .. autodoxymethod:: simgrid::s4u::Comm::wait_all(const std::vector< CommPtr > *comms)
+ .. autodoxymethod:: simgrid::s4u::Comm::wait_any(const std::vector< CommPtr > *comms)
+ .. autodoxymethod:: simgrid::s4u::Comm::wait_any_for(const std::vector< CommPtr > *comms_in, double timeout)
+ .. autodoxymethod:: simgrid::s4u::Comm::wait_for
+
+ .. group-tab:: Python
+
+ .. automethod:: simgrid.Comm.test
+ .. automethod:: simgrid.Comm.wait
+ .. automethod:: simgrid.Comm.wait_all
+ .. automethod:: simgrid.Comm.wait_any
+
+Signals
+-------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxyvar:: simgrid::s4u::Comm::on_completion
+ .. autodoxyvar:: simgrid::s4u::Comm::on_receiver_start
+ .. autodoxyvar:: simgrid::s4u::Comm::on_sender_start
+
+.. _API_s4u_Exec:
+
+=============
+ class Exec
+=============
+
+.. autodoxyclass:: simgrid::s4u::Exec
+
+Basic management
+----------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/Exec.hpp>
+
+ .. doxygentypedef:: ExecPtr
+
+ .. group-tab:: Python
+
+ .. code:: Python
+
+ from simgrid import Exec
+
+Querying info
+-------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Exec::get_cost() const
+ .. autodoxymethod:: simgrid::s4u::Exec::get_finish_time() const
+ .. autodoxymethod:: simgrid::s4u::Exec::get_host() const
+ .. autodoxymethod:: simgrid::s4u::Exec::get_host_number() const
+ .. cpp:function:: double Exec::get_remaining()
+
+ On sequential executions, returns the amount of flops that remain to be done;
+ This cannot be used on parallel executions.
+
+ .. autodoxymethod:: simgrid::s4u::Exec::get_remaining_ratio
+ .. autodoxymethod:: simgrid::s4u::Exec::get_start_time() const
+ .. autodoxymethod:: simgrid::s4u::Exec::set_bound(double bound)
+ .. autodoxymethod:: simgrid::s4u::Exec::set_host
+ .. autodoxymethod:: simgrid::s4u::Exec::set_priority(double priority)
+
+ .. group-tab:: Python
+
+ .. autoattribute:: simgrid.Exec.host
+ .. autoattribute:: simgrid.Exec.remaining
+ .. autoattribute:: simgrid.Exec.remaining_ratio
+
+Life cycle
+----------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Exec::cancel
+ .. autodoxymethod:: simgrid::s4u::Exec::set_timeout(double timeout)
+ .. autodoxymethod:: simgrid::s4u::Exec::start
+ .. autodoxymethod:: simgrid::s4u::Exec::test
+ .. autodoxymethod:: simgrid::s4u::Exec::wait
+ .. autodoxymethod:: simgrid::s4u::Exec::wait_any(std::vector< ExecPtr > *execs)
+ .. autodoxymethod:: simgrid::s4u::Exec::wait_any_for(std::vector< ExecPtr > *execs, double timeout)
+ .. autodoxymethod:: simgrid::s4u::Exec::wait_for
+
+ .. group-tab:: Python
+
+ .. automethod:: simgrid.Exec.cancel
+ .. automethod:: simgrid.Exec.start
+ .. automethod:: simgrid.Exec.test
+ .. automethod:: simgrid.Exec.wait
+
+Signals
+-------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. cpp:var:: xbt::signal<void(Actor const&, Exec const&)> Exec::on_completion
+ .. cpp:var:: xbt::signal<void(Actor const&, Exec const&)> Exec::on_start
+
+.. _API_s4u_Io:
+
+===========
+ class Io
+===========
+
+.. autodoxyclass:: simgrid::s4u::Io
+
+Basic management
+----------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/Io.hpp>
+
+ .. doxygentypedef:: IoPtr
+
+Querying info
+-------------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Io::get_performed_ioops() const
+ .. autodoxymethod:: simgrid::s4u::Io::get_remaining
+
+Life cycle
+----------
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. autodoxymethod:: simgrid::s4u::Io::cancel
+ .. autodoxymethod:: simgrid::s4u::Io::start
+ .. autodoxymethod:: simgrid::s4u::Io::test
+ .. autodoxymethod:: simgrid::s4u::Io::wait
+ .. autodoxymethod:: simgrid::s4u::Io::wait_for
+
+.. _API_s4u_Synchronizations:
+
+=======================
+Synchronization Objects
+=======================
+
+.. _API_s4u_Mutex:
+
+==============
+ Mutex
+==============
+
+.. autodoxyclass:: simgrid::s4u::Mutex
+
+Basic management
+----------------
+
+ .. tabs::
+
+ .. group-tab:: C++
+
+ .. code-block:: C++
+
+ #include <simgrid/s4u/Mutex.hpp>
+
+ .. doxygentypedef:: MutexPtr
+
+ .. autodoxymethod:: simgrid::s4u::Mutex::Mutex(kernel::activity::MutexImpl *mutex)
+ .. autodoxymethod:: simgrid::s4u::Mutex::create()
+ .. autodoxymethod:: simgrid::s4u::Mutex::~Mutex()
+
+ .. group-tab:: C
+
+ .. code-block:: C
+
+ #include <simgrid/mutex.h>
+
+ .. doxygentypedef:: sg_mutex_t
+ .. cpp:type:: const s4u_Mutex* const_sg_mutex_t
+
+ Pointer to a constant mutex object.
+
+ .. autodoxymethod:: sg_mutex_init()
+ .. autodoxymethod:: sg_mutex_destroy(const_sg_mutex_t mutex)