XBT_PUBLIC sg_host_t MSG_host_self();
-XBT_ATTRIB_DEPRECATED_v320("Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() "
- "completely.") static inline double MSG_host_get_current_power_peak(msg_host_t host)
-{
- return sg_host_speed(host);
-}
-
/* ******************************** VMs ************************************* */
typedef sg_vm_t msg_vm_t;
XBT_PUBLIC msg_comm_t MSG_task_isend(msg_task_t task, const char* alias);
XBT_PUBLIC msg_comm_t MSG_task_isend_bounded(msg_task_t task, const char* alias, double maxrate);
-XBT_ATTRIB_DEPRECATED_v320(
- "This function will be removed from SimGrid v3.20. If you really need this function, please speak up quickly.")
- XBT_PUBLIC msg_comm_t MSG_task_isend_with_matching(msg_task_t task, const char* alias,
- int (*match_fun)(void*, void*, void*), void* match_data);
XBT_PUBLIC void MSG_task_dsend(msg_task_t task, const char* alias, void_f_pvoid_t cleanup);
XBT_PUBLIC void MSG_task_dsend_bounded(msg_task_t task, const char* alias, void_f_pvoid_t cleanup, double maxrate);
this_actor::sleep_until(timeout_native.time_since_epoch().count());
}
-XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into an error.") inline void sleep(
- double duration)
-{
- return sleep_for(duration);
-}
-
/** Block the actor, computing the given amount of flops */
XBT_PUBLIC void execute(double flop);
XBT_PUBLIC ExecPtr exec_init(double flops_amounts);
XBT_PUBLIC ExecPtr exec_async(double flops_amounts);
-/** Block the actor until it gets a message from the given mailbox.
- *
- * See \ref Comm for the full communication API (including non blocking communications).
- */
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC
- void* recv(MailboxPtr chan);
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC
- void* recv(MailboxPtr chan, double timeout);
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC CommPtr
- irecv(MailboxPtr chan, void** data);
-
-/** Block the actor until it delivers a message of the given simulated size to the given mailbox
- *
- * See \ref Comm for the full communication API (including non blocking communications).
-*/
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC
- void send(MailboxPtr chan, void* payload, double simulatedSize);
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC
- void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout);
-
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC CommPtr
- isend(MailboxPtr chan, void* payload, double simulatedSize);
-
/** @brief Returns the actor ID of the current actor). */
XBT_PUBLIC aid_t getPid();
#ifndef SIMGRID_S4U_COMM_HPP
#define SIMGRID_S4U_COMM_HPP
+#include <xbt/asserts.h>
#include <xbt/base.h>
+#include <xbt/dynar.h>
#include <simgrid/forward.h>
#include <simgrid/s4u/Activity.hpp>
-#include <simgrid/s4u/Mailbox.hpp> // DEPRECATED 3.20
#include <simgrid/s4u/forward.hpp>
+#include <simgrid/simix.h>
+#include <atomic>
#include <vector>
namespace simgrid {
/*! take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
static int test_any(std::vector<CommPtr> * comms);
- /** Creates (but don't start) an async send to the mailbox @p dest */
- XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
- send_init(MailboxPtr dest)
- {
- return dest->put_init();
- }
- /** Creates (but don't start) an async send to the mailbox @p dest */
- XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
- send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
- {
- return dest->put_init(data, simulatedByteAmount);
- }
- /** Creates and start an async send to the mailbox @p dest */
- XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") static CommPtr
- send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
- {
- return dest->put_async(data, simulatedByteAmount);
- }
- /** Creates (but don't start) an async recv onto the mailbox @p from */
- XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.") static CommPtr
- recv_init(MailboxPtr from)
- {
- return from->get_init();
- }
- /** Creates and start an async recv to the mailbox @p from */
- XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.") static CommPtr
- recv_async(MailboxPtr from, void** data)
- {
- return from->get_async(data);
- }
-
Activity* start() override;
Activity* wait() override;
Activity* wait(double timeout) override;
#define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
#endif
-#define XBT_ATTRIB_DEPRECATED_v320(mesg) XBT_ATTRIB_DEPRECATED(mesg) /* Will be dropped in v3.20 */
#define XBT_ATTRIB_DEPRECATED_v321(mesg) XBT_ATTRIB_DEPRECATED(mesg) /* Will be dropped in v3.21 */
#define XBT_ATTRIB_DEPRECATED_v322(mesg) XBT_ATTRIB_DEPRECATED(mesg) /* Will be dropped in v3.22 */
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
return MSG_task_isend_internal(task, alias, nullptr, nullptr, nullptr, 0);
}
-/** \ingroup msg_task_usage
- * \brief Sends a task on a mailbox, with support for matching requests
- *
- * This is a non blocking function: use MSG_comm_wait() or MSG_comm_test() to end the communication.
- *
- * \param task a #msg_task_t to send on another location.
- * \param alias name of the mailbox to sent the task to
- * \param match_fun boolean function which parameters are:
- * - match_data_provided_here
- * - match_data_provided_by_other_side_if_any
- * - the_smx_synchro_describing_the_other_side
- * \param match_data user provided data passed to match_fun
- * \return the msg_comm_t communication created
- */
-msg_comm_t MSG_task_isend_with_matching(msg_task_t task, const char* alias, int (*match_fun)(void*, void*, void*),
- void* match_data)
-{
- return MSG_task_isend_internal(task, alias, match_fun, match_data, nullptr, 0);
-}
-
/** \ingroup msg_task_usage
* \brief Sends a task on a mailbox.
*
return res;
}
-void* recv(MailboxPtr chan) // deprecated
-{
- return chan->get();
-}
-
-void* recv(MailboxPtr chan, double timeout) // deprecated
-{
- return chan->get(timeout);
-}
-
-void send(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
-{
- chan->put(payload, simulatedSize);
-}
-
-void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout) // deprecated
-{
- chan->put(payload, simulatedSize, timeout);
-}
-
-CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
-{
- return chan->put_async(payload, simulatedSize);
-}
-
-CommPtr irecv(MailboxPtr chan, void** data) // deprecated
-{
- return chan->get_async(data);
-}
-
aid_t getPid()
{
return SIMIX_process_self()->pid;