Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
turns out %le=%e and %lf=%f ... except on windows
authorAugustin Degomme <degomme@idpann.imag.fr>
Wed, 9 Oct 2013 14:19:16 +0000 (16:19 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Wed, 9 Oct 2013 14:19:21 +0000 (16:19 +0200)
examples/msg/chainsend/chainsend.c
examples/msg/energy/e1/e1.c
examples/msg/energy/e2/e2.c
examples/msg/energy/e3/e3.c
examples/msg/sendrecv/sendrecv.c
src/instr/instr_paje_trace.c

index 8566e71..06e7bea 100644 (file)
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
 
   res = test_all(argv[1], argv[2]);
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
 #ifdef _MSC_VER
   _set_output_format(prev_exponent_format);
index 1f7dae7..74013fb 100644 (file)
@@ -41,7 +41,7 @@ int dvfs(int argc, char *argv[])
   XBT_INFO("Number of Processor states=%d", nb);
 
   double current_peak = MSG_get_host_current_power_peak(host);
-  XBT_INFO("Current power peak=%lf", current_peak);
+  XBT_INFO("Current power peak=%f", current_peak);
 
   // Run a task
   task1 = MSG_task_create ("t1", workload, 0, NULL);
@@ -49,7 +49,7 @@ int dvfs(int argc, char *argv[])
   MSG_task_destroy(task1);
 
   task_time = MSG_get_clock();
-  XBT_INFO("Task1 simulation time: %le", task_time);
+  XBT_INFO("Task1 simulation time: %e", task_time);
 
   // Change power peak
   if ((new_peak_index >= nb) || (new_peak_index < 0))
@@ -59,12 +59,12 @@ int dvfs(int argc, char *argv[])
          }
 
   double peak_at = MSG_get_host_power_peak_at(host, new_peak_index);
-  XBT_INFO("Changing power peak value to %lf (at index %d)", peak_at, new_peak_index);
+  XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_peak_index);
 
   MSG_set_host_power_peak_at(host, new_peak_index);
 
   current_peak = MSG_get_host_current_power_peak(host);
-  XBT_INFO("Current power peak=%lf", current_peak);
+  XBT_INFO("Current power peak=%f", current_peak);
 
   // Run a second task
   task1 = MSG_task_create ("t1", workload, 0, NULL);
@@ -72,7 +72,7 @@ int dvfs(int argc, char *argv[])
   MSG_task_destroy(task1);
 
   task_time = MSG_get_clock() - task_time;
-  XBT_INFO("Task2 simulation time: %le", task_time);
+  XBT_INFO("Task2 simulation time: %e", task_time);
 
 
   // Verify the default pstate is set to 0
@@ -81,7 +81,7 @@ int dvfs(int argc, char *argv[])
   XBT_INFO("Number of Processor states=%d", nb2);
 
   double current_peak2 = MSG_get_host_current_power_peak(host);
-  XBT_INFO("Current power peak=%lf", current_peak2);
+  XBT_INFO("Current power peak=%f", current_peak2);
   return 0;
 }
 
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
 
   res = MSG_main();
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
   if (res == MSG_OK)
     return 0;
index 93db851..d0ea20b 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -28,10 +29,10 @@ int dvfs(int argc, char *argv[])
 
 
   double current_peak = MSG_get_host_current_power_peak(host);
-  XBT_INFO("Current power peak=%lf", current_peak);
+  XBT_INFO("Current power peak=%f", current_peak);
 
   double consumed_energy = MSG_get_host_consumed_energy(host);
-  XBT_INFO("Total energy (Joules): %lf", consumed_energy);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
 
   // Run a task
   task1 = MSG_task_create ("t1", 100E6, 0, NULL);
@@ -39,14 +40,14 @@ int dvfs(int argc, char *argv[])
   MSG_task_destroy(task1);
 
   task_time = MSG_get_clock();
-  XBT_INFO("Task1 simulation time: %le", task_time);
+  XBT_INFO("Task1 simulation time: %e", task_time);
   consumed_energy = MSG_get_host_consumed_energy(host);
-  XBT_INFO("Total energy (Joules): %lf", consumed_energy);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
 
   // ========= Change power peak =========
   int peak_index=2;
   double peak_at = MSG_get_host_power_peak_at(host, peak_index);
-  XBT_INFO("=========Changing power peak value to %lf (at index %d)", peak_at, peak_index);
+  XBT_INFO("=========Changing power peak value to %f (at index %d)", peak_at, peak_index);
 
   MSG_set_host_power_peak_at(host, peak_index);
 
@@ -56,18 +57,18 @@ int dvfs(int argc, char *argv[])
   MSG_task_destroy(task1);
 
   task_time = MSG_get_clock() - task_time;
-  XBT_INFO("Task2 simulation time: %le", task_time);
+  XBT_INFO("Task2 simulation time: %e", task_time);
 
   consumed_energy = MSG_get_host_consumed_energy(host);
-  XBT_INFO("Total energy (Joules): %lf", consumed_energy);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
 
 
   MSG_process_sleep(3);
 
   task_time = MSG_get_clock() - task_time;
-  XBT_INFO("Task3 (sleep) simulation time: %le", task_time);
+  XBT_INFO("Task3 (sleep) simulation time: %e", task_time);
   consumed_energy = MSG_get_host_consumed_energy(host);
-  XBT_INFO("Total energy (Joules): %lf", consumed_energy);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
 
 
   return 0;
@@ -97,7 +98,7 @@ int main(int argc, char *argv[])
 
   res = MSG_main();
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
   if (res == MSG_OK)
     return 0;
index 5fb0164..4230a8e 100644 (file)
@@ -32,7 +32,7 @@ static int process_code(int argc, char *argv[])
 
          MSG_process_sleep(sleep_task);
          task_time = MSG_get_clock() - task_time;
-         XBT_INFO("Process %s executed task sleep cpu=%lf, duration = %lf",
+         XBT_INFO("Process %s executed task sleep cpu=%f, duration = %f",
                          MSG_process_get_name(MSG_process_self()), 0.0, task_time);
          XBT_INFO("==================================================");
  }
@@ -45,7 +45,7 @@ static int process_code(int argc, char *argv[])
   MSG_task_destroy(task1);
 
   task_time = MSG_get_clock() - task_time;
-  XBT_INFO("Process %s executed task cpu=%lf, duration = %lf",
+  XBT_INFO("Process %s executed task cpu=%f, duration = %f",
                  MSG_process_get_name(MSG_process_self()), cpu_task, task_time);
   XBT_INFO("==================================================");
   return 0;
@@ -60,9 +60,9 @@ static int dvfs(int argc, char *argv[])
 
   double current_peak = MSG_get_host_current_power_peak(host);
 
-  XBT_INFO("Current power peak=%lf", current_peak);
+  XBT_INFO("Current power peak=%f", current_peak);
   double consumed_energy = MSG_get_host_consumed_energy(host);
-  XBT_INFO("Total energy (Joules): %lf", consumed_energy);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
 
   // Process 1 - long CPU task
   int argc1 = 1;
@@ -89,9 +89,9 @@ static int dvfs(int argc, char *argv[])
   MSG_process_sleep(8);
 
   task_time = MSG_get_clock() - task_time;
-  XBT_INFO("Task simulation time: %le", task_time);
+  XBT_INFO("Task simulation time: %e", task_time);
   consumed_energy = MSG_get_host_consumed_energy(host);
-  XBT_INFO("Total energy (Joules): %lf", consumed_energy);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
 
   return 0;
 }
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
 
   res = MSG_main();
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
   if (res == MSG_OK)
     return 0;
index e2e7d3f..1f74408 100644 (file)
@@ -62,7 +62,7 @@ int sender(int argc, char *argv[])
       MSG_task_create(sprintf_buffer_la, 0.0, task_comm_size_lat, NULL);
   task_la->data = xbt_new(double, 1);
   *(double *) task_la->data = time;
-  XBT_INFO("task_la->data = %le", *((double *) task_la->data));
+  XBT_INFO("task_la->data = %e", *((double *) task_la->data));
   MSG_task_send(task_la, argv[1]);
 
   /* Bandwidth */
@@ -72,7 +72,7 @@ int sender(int argc, char *argv[])
       MSG_task_create(sprintf_buffer_bw, 0.0, task_comm_size_bw, NULL);
   task_bw->data = xbt_new(double, 1);
   *(double *) task_bw->data = time;
-  XBT_INFO("task_bw->data = %le", *((double *) task_bw->data));
+  XBT_INFO("task_bw->data = %e", *((double *) task_bw->data));
   MSG_task_send(task_bw, argv[1]);
 
   return 0;
@@ -99,7 +99,7 @@ int receiver(int argc, char *argv[])
     XBT_INFO("Task received : %s", task_la->name);
     xbt_free(task_la->data);
     MSG_task_destroy(task_la);
-    XBT_INFO("Communic. time %le", communication_time);
+    XBT_INFO("Communic. time %e", communication_time);
     XBT_INFO("--- la %f ----", communication_time);
   } else {
     xbt_die("Unexpected behavior");
@@ -115,7 +115,7 @@ int receiver(int argc, char *argv[])
     XBT_INFO("Task received : %s", task_bw->name);
     xbt_free(task_bw->data);
     MSG_task_destroy(task_bw);
-    XBT_INFO("Communic. time %le", communication_time);
+    XBT_INFO("Communic. time %e", communication_time);
     XBT_INFO("--- bw %f ----", task_comm_size_bw / communication_time);
   } else {
     xbt_die("Unexpected behavior");
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
 
   res = test_all(argv[1], argv[2]);
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
 #ifdef _MSC_VER
   _set_output_format(prev_exponent_format);
index 625519d..734496d 100644 (file)
@@ -340,7 +340,7 @@ static void print_pajeCreateContainer(paje_event_t event)
         ((createContainer_t)event->data)->container->father->id,
         ((createContainer_t)event->data)->container->name);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s \"%s\"\n",
+    fprintf(tracing_file, "%d %f %s %s %s \"%s\"\n",
         (int)event->event_type,
         event->timestamp,
         ((createContainer_t)event->data)->container->id,
@@ -359,7 +359,7 @@ static void print_pajeDestroyContainer(paje_event_t event)
         ((destroyContainer_t)event->data)->container->type->id,
         ((destroyContainer_t)event->data)->container->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((destroyContainer_t)event->data)->container->type->id,
@@ -377,7 +377,7 @@ static void print_pajeSetVariable(paje_event_t event)
         ((setVariable_t)event->data)->container->id,
         ((setVariable_t)event->data)->value);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %f\n",
+    fprintf(tracing_file, "%d %f %s %s %f\n",
         (int)event->event_type,
         event->timestamp,
         ((setVariable_t)event->data)->type->id,
@@ -396,7 +396,7 @@ static void print_pajeAddVariable(paje_event_t event)
         ((addVariable_t)event->data)->container->id,
         ((addVariable_t)event->data)->value);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %f\n",
+    fprintf(tracing_file, "%d %f %s %s %f\n",
         (int)event->event_type,
         event->timestamp,
         ((addVariable_t)event->data)->type->id,
@@ -415,7 +415,7 @@ static void print_pajeSubVariable(paje_event_t event)
         ((subVariable_t)event->data)->container->id,
         ((subVariable_t)event->data)->value);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %f\n",
+    fprintf(tracing_file, "%d %f %s %s %f\n",
         (int)event->event_type,
         event->timestamp,
         ((subVariable_t)event->data)->type->id,
@@ -434,7 +434,7 @@ static void print_pajeSetState(paje_event_t event)
         ((setState_t)event->data)->container->id,
         ((setState_t)event->data)->value->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((setState_t)event->data)->type->id,
@@ -454,7 +454,7 @@ static void print_pajePushState(paje_event_t event)
           ((pushState_t)event->data)->container->id,
           ((pushState_t)event->data)->value->id);
     }else{
-      fprintf(tracing_file, "%d %lf %s %s %s\n",
+      fprintf(tracing_file, "%d %f %s %s %s\n",
           (int)event->event_type,
           event->timestamp,
           ((pushState_t)event->data)->type->id,
@@ -470,7 +470,7 @@ static void print_pajePushState(paje_event_t event)
           ((pushState_t)event->data)->value->id,
           ((pushState_t)event->data)->size);
     }else{
-      fprintf(tracing_file, "%d %lf %s %s %s %d\n",
+      fprintf(tracing_file, "%d %f %s %s %s %d\n",
           (int)event->event_type,
           event->timestamp,
           ((pushState_t)event->data)->type->id,
@@ -491,7 +491,7 @@ static void print_pajePopState(paje_event_t event)
         ((popState_t)event->data)->type->id,
         ((popState_t)event->data)->container->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((popState_t)event->data)->type->id,
@@ -508,7 +508,7 @@ static void print_pajeResetState(paje_event_t event)
         ((resetState_t)event->data)->type->id,
         ((resetState_t)event->data)->container->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((resetState_t)event->data)->type->id,
@@ -528,7 +528,7 @@ static void print_pajeStartLink(paje_event_t event)
           ((startLink_t)event->data)->sourceContainer->id,
           ((startLink_t)event->data)->key);
     }else {
-      fprintf(tracing_file, "%d %lf %s %s %s %s %s\n",
+      fprintf(tracing_file, "%d %f %s %s %s %s %s\n",
           (int)event->event_type,
           event->timestamp,
           ((startLink_t)event->data)->type->id,
@@ -549,7 +549,7 @@ static void print_pajeStartLink(paje_event_t event)
           ((startLink_t)event->data)->key,
           ((startLink_t)event->data)->size);
     }else {
-      fprintf(tracing_file, "%d %lf %s %s %s %s %s %d\n",
+      fprintf(tracing_file, "%d %f %s %s %s %s %s %d\n",
           (int)event->event_type,
           event->timestamp,
           ((startLink_t)event->data)->type->id,
@@ -574,7 +574,7 @@ static void print_pajeEndLink(paje_event_t event)
         ((endLink_t)event->data)->destContainer->id,
         ((endLink_t)event->data)->key);
   }else {
-    fprintf(tracing_file, "%d %lf %s %s %s %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s %s %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((endLink_t)event->data)->type->id,
@@ -595,7 +595,7 @@ static void print_pajeNewEvent (paje_event_t event)
         ((newEvent_t)event->data)->container->id,
         ((newEvent_t)event->data)->value->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((newEvent_t)event->data)->type->id,