X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/470b276614f45ce71f58dad1c2ab118aa3e4d1bb..c6eefaa5a3198ebff98651ac72501367e4195ded:/src/msg/gos.c diff --git a/src/msg/gos.c b/src/msg/gos.c index 943df6371d..a1266eb648 100644 --- a/src/msg/gos.c +++ b/src/msg/gos.c @@ -466,10 +466,22 @@ msg_comm_t MSG_task_irecv(m_task_t * task, const char *alias) { /* Try to receive it by calling SIMIX network layer */ return SIMIX_network_irecv(rdv, task, &size); } + int MSG_comm_test(msg_comm_t comm) { return SIMIX_network_test(comm); } +/* After received TRUE to MSG_comm_test() function we have to destroy the communication */ +void MSG_comm_destroy(msg_comm_t comm) { + if(!(comm->src_proc == SIMIX_process_self())) + { + m_task_t task; + task = (m_task_t) SIMIX_communication_get_src_buf(comm); + task->simdata->refcount--; + } + SIMIX_communication_destroy(comm); +} + MSG_error_t MSG_comm_wait(msg_comm_t comm, double timeout) { xbt_ex_t e; MSG_error_t res = MSG_OK; @@ -503,6 +515,32 @@ MSG_error_t MSG_comm_wait(msg_comm_t comm, double timeout) { return res; } + +/* This function is called by a sender and permit to wait for each communication + * + * Param: + * - msg_comm_t *comm a vector of communication + * - int nb_elem is th esize of the comm vector + * - timeout for each call of MSG_comm_wait + */ + +void MSG_comm_waitall(msg_comm_t *comm,int nb_elem, double timeout) { + int i=0; + for(i=0; i