Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
revalidate the 64bits test outputs after the listener modification
[simgrid.git] / examples / gras / timer / timer.c
index 8de543f..b46d388 100644 (file)
@@ -26,7 +26,7 @@ static void repetitive_action(void) {
    
    /* Stop if nothing to do yet */
    if (globals->still_to_do <= 0) {
    
    /* Stop if nothing to do yet */
    if (globals->still_to_do <= 0) {
-     INFO1("[%.0f] Repetitive_action has nothing to do yet",gras_os_time());
+     INFO0("Repetitive_action has nothing to do yet");
      return;
    }
    
      return;
    }
    
@@ -35,7 +35,7 @@ static void repetitive_action(void) {
       gras_timer_cancel_repeat(REPEAT_INTERVAL,repetitive_action);
    }
 
       gras_timer_cancel_repeat(REPEAT_INTERVAL,repetitive_action);
    }
 
-   INFO2("[%.0f] repetitive_action decrementing globals->still_to_do. New value: %d",gras_os_time(),
+   INFO1("repetitive_action decrementing globals->still_to_do. New value: %d",
         globals->still_to_do-1);
    
    globals->still_to_do--; /* should be the last line of the action since value=0 stops the program */
         globals->still_to_do-1);
    
    globals->still_to_do--; /* should be the last line of the action since value=0 stops the program */
@@ -44,41 +44,37 @@ static void repetitive_action(void) {
 static void delayed_action(void) {
    my_globals *globals=(my_globals*)gras_userdata_get();
    
 static void delayed_action(void) {
    my_globals *globals=(my_globals*)gras_userdata_get();
    
-   INFO2("[%.0f] delayed_action setting globals->still_to_do to %d",
-        gras_os_time(),LOOP_COUNT);
+   INFO1("delayed_action setting globals->still_to_do to %d",LOOP_COUNT);
 
    globals->still_to_do = LOOP_COUNT;
 } /* end_of_delayed_action */
 
 int client(int argc,char *argv[]) {
 
    globals->still_to_do = LOOP_COUNT;
 } /* end_of_delayed_action */
 
 int client(int argc,char *argv[]) {
-  xbt_error_t errcode;
-  int cpt;
   my_globals *globals;
 
   gras_init(&argc,argv);
   globals=gras_userdata_new(my_globals);
   globals->still_to_do = -1;
 
   my_globals *globals;
 
   gras_init(&argc,argv);
   globals=gras_userdata_new(my_globals);
   globals->still_to_do = -1;
 
-  INFO2("[%.0f] Programming the repetitive_action with a frequency of %f sec", gras_os_time(), REPEAT_INTERVAL);
+  INFO1("Programming the repetitive_action with a frequency of %f sec", REPEAT_INTERVAL);
   gras_timer_repeat(REPEAT_INTERVAL,repetitive_action);
    
   gras_timer_repeat(REPEAT_INTERVAL,repetitive_action);
    
-  INFO2("[%.0f] Programming the delayed_action for after %f sec", gras_os_time(), DELAY_INTERVAL);
+  INFO1("Programming the delayed_action for after %f sec", DELAY_INTERVAL);
   gras_timer_delay(REPEAT_INTERVAL,delayed_action);
 
   gras_timer_delay(REPEAT_INTERVAL,delayed_action);
 
-  INFO1("[%.0f] Have a rest", gras_os_time());  
+  INFO0("Have a rest");  
   gras_os_sleep(DELAY_INTERVAL / 2.0);
    
   gras_os_sleep(DELAY_INTERVAL / 2.0);
    
-  INFO1("[%.0f] Canceling the delayed_action.",gras_os_time());
+  INFO0("Canceling the delayed_action.");
   gras_timer_cancel_delay(REPEAT_INTERVAL,delayed_action);
 
   gras_timer_cancel_delay(REPEAT_INTERVAL,delayed_action);
 
-  INFO2("[%.0f] Re-programming the delayed_action for after %f sec", gras_os_time(),DELAY_INTERVAL);
+  INFO1("Re-programming the delayed_action for after %f sec",DELAY_INTERVAL);
   gras_timer_delay(REPEAT_INTERVAL,delayed_action);
 
   while (globals->still_to_do == -1 ||  /* Before delayed action runs */
         globals->still_to_do > 0 /* after delayed_action, and not enough repetitive_action */) {
 
   gras_timer_delay(REPEAT_INTERVAL,delayed_action);
 
   while (globals->still_to_do == -1 ||  /* Before delayed action runs */
         globals->still_to_do > 0 /* after delayed_action, and not enough repetitive_action */) {
 
-     DEBUG2("[%.0f] Prepare to handle messages for 5 sec (still_to_do=%d)",
-           gras_os_time(), globals->still_to_do);
+     DEBUG1("Prepare to handle messages for 5 sec (still_to_do=%d)", globals->still_to_do);
      gras_msg_handle(5.0);
   }
   gras_exit();
      gras_msg_handle(5.0);
   }
   gras_exit();