XBT_PUBLIC(msg_comm_t) MSG_task_isend(m_task_t task, const char *alias);
XBT_PUBLIC(msg_comm_t) MSG_task_irecv(m_task_t * task, const char *alias);
XBT_PUBLIC(int) MSG_comm_test(msg_comm_t comm);
+XBT_PUBLIC(int) MSG_comm_testany(xbt_dynar_t comms);
XBT_PUBLIC(void) MSG_comm_destroy(msg_comm_t comm);
XBT_PUBLIC(MSG_error_t) MSG_comm_wait(msg_comm_t comm, double timeout);
XBT_PUBLIC(void) MSG_comm_waitall(msg_comm_t * comm, int nb_elem,
XBT_PUBLIC(unsigned int) SIMIX_req_comm_waitany(xbt_dynar_t comms);
XBT_PUBLIC(void) SIMIX_req_comm_wait(smx_action_t comm, double timeout);
XBT_PUBLIC(int) SIMIX_req_comm_test(smx_action_t comm);
+XBT_PUBLIC(int) SIMIX_req_comm_testany(xbt_dynar_t comms);
/* Getters and setters */
XBT_PUBLIC(double) SIMIX_req_comm_get_remains(smx_action_t comm);
return SIMIX_req_comm_waitany(comms);
}
+/** \ingroup msg_gos_functions
+* \brief This function wait for the first completed communication
+*
+* It takes on parameter.
+* \param comms a vector of communication
+* \return the position of the completed communication, if any, or -1 if none was completed
+*/
+int MSG_comm_testany(xbt_dynar_t comms)
+{
+ return SIMIX_req_comm_testany(comms);
+}
+
m_task_t MSG_comm_get_task(msg_comm_t comm)
{
xbt_assert0(comm, "Invalid parameters");
#include "private.h"
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
/**
* \brief Returns a host given its name.
*
return req.comm_waitany.result;
}
+int SIMIX_req_comm_testany(xbt_dynar_t comms)
+{
+ s_smx_req_t req;
+ if (xbt_dynar_length(comms)==0)
+ return -1;
+
+ WARN0("SIMIX_comm_testany is not implemented yet. Using waitany instead. This changes the semantic...");
+ req.call = REQ_COMM_WAITANY;
+ req.comm_waitany.comms = comms;
+
+ SIMIX_request_push(&req);
+ return req.comm_waitany.result;
+}
+
void SIMIX_req_comm_wait(smx_action_t comm, double timeout)
{
s_smx_req_t req;