Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Type casting. Bug solved.
[simgrid.git] / examples / gras / all2all / all2all.c
index 5c029da..df7ada5 100644 (file)
@@ -53,7 +53,7 @@ int receiver (int argc,char *argv[]) {
        todo);
   while (todo>0) {
      gras_msg_wait(60 /* wait up to one minute */,
-                  gras_msgtype_by_name("data"),
+                  "data",
                   &expeditor,
                   &data);
      todo--;
@@ -110,15 +110,19 @@ int sender (int argc,char *argv[]) {
 
 
   /* Wait for receivers to startup */
-  gras_os_sleep(1);
+  gras_os_sleep(.01);
 
   /* write 'em */
   xbt_dynar_foreach(peers,i,h) {
      
      peer = gras_socket_client(h->name,h->port);
-     gras_msg_send(peer,gras_msgtype_by_name("data"),&data);
-     INFO2("  Sent Data from %s to %s",
-          gras_os_myname(),h->name);
+     gras_msg_send(peer,"data",&data);
+     if (gras_if_SG()) {
+       INFO2("  Sent Data from %s to %s", gras_os_myname(),h->name);
+     } else {
+       INFO0("  Sent Data");
+     }     
+      
      gras_socket_close(peer);
   }