Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add MPI_File* bindings to SMPI, even if they are unimplemented.
[simgrid.git] / examples / msg / chainsend / common.c
1 /* Copyright (c) 2012-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "common.h"
8
9 int process_pending_connections(xbt_dynar_t q)
10 {
11   unsigned int iter;
12   int status;
13   int empty = 0;
14   msg_comm_t comm;
15
16   xbt_dynar_foreach(q, iter, comm) {
17     empty = 1;
18     if (MSG_comm_test(comm)) {
19       status = MSG_comm_get_status(comm);
20       MSG_comm_destroy(comm);
21       xbt_assert(status == MSG_OK, "process_pending_connections() failed");
22       xbt_dynar_cursor_rm(q, &iter);
23       empty = 0;
24     }
25   }
26   return empty;
27 }