Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce amount of login for the new default loop count
[simgrid.git] / examples / gras / tokenS / tokenS.c
index 69b6327..d22444c 100644 (file)
@@ -11,8 +11,7 @@
  
 #include "gras.h"
  
-//#define NBLOOPS 10
-#define NBLOOPS 1000
+#define NBLOOPS 100
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(Token,"Messages specific to this example");
 
@@ -55,7 +54,7 @@ static int node_cb_stoken_handler(gras_socket_t  expeditor,
   int supersteps = 1;
   if (NBLOOPS >= 1000) {
     supersteps = 100;
-  } else if (NBLOOPS > 100) {
+  } else if (NBLOOPS >= 100) {
     supersteps = 10;
   } 
   if (globals->create && (! (globals->remaining_loop % supersteps))) {
@@ -110,17 +109,20 @@ int node (int argc,char *argv[]) {
   xbt_error_t errcode;
   node_data_t *globals;
   
+  const char *host;
+  int   myport;
+  int   peerport;
   
   /* 1. Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc,argv, NULL);
+  gras_init(&argc,argv);
   globals=gras_userdata_new(node_data_t);
   
   
   /* 2. Get the successor's address. The command line overrides
         defaults when specified */
-  const char *host = "127.0.0.1";
-  int   myport = 4000;
-  int   peerport = 4000;
+  host = "127.0.0.1";
+  myport = 4000;
+  peerport = 4000;
   if (argc >= 4) {
     myport=atoi(argv[1]);
     host=argv[2];
@@ -209,6 +211,5 @@ int node (int argc,char *argv[]) {
   free(globals);
   gras_exit();
   
-  INFO0("Done");
   return no_error;
 } /* end_of_node */