From: Augustin Degomme Date: Wed, 9 Oct 2013 14:19:16 +0000 (+0200) Subject: turns out %le=%e and %lf=%f ... except on windows X-Git-Tag: v3_9_90~30 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cacbedefa249b4825692f730593a3cfbb69de4a4 turns out %le=%e and %lf=%f ... except on windows --- diff --git a/examples/msg/chainsend/chainsend.c b/examples/msg/chainsend/chainsend.c index 8566e712d8..06e7bea47d 100644 --- a/examples/msg/chainsend/chainsend.c +++ b/examples/msg/chainsend/chainsend.c @@ -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); diff --git a/examples/msg/energy/e1/e1.c b/examples/msg/energy/e1/e1.c index 1f7dae7175..74013fbac9 100644 --- a/examples/msg/energy/e1/e1.c +++ b/examples/msg/energy/e1/e1.c @@ -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; diff --git a/examples/msg/energy/e2/e2.c b/examples/msg/energy/e2/e2.c index 93db851ed7..d0ea20bd23 100644 --- a/examples/msg/energy/e2/e2.c +++ b/examples/msg/energy/e2/e2.c @@ -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; diff --git a/examples/msg/energy/e3/e3.c b/examples/msg/energy/e3/e3.c index 5fb0164b17..4230a8e39c 100644 --- a/examples/msg/energy/e3/e3.c +++ b/examples/msg/energy/e3/e3.c @@ -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; diff --git a/examples/msg/sendrecv/sendrecv.c b/examples/msg/sendrecv/sendrecv.c index e2e7d3f5ff..1f74408c2f 100644 --- a/examples/msg/sendrecv/sendrecv.c +++ b/examples/msg/sendrecv/sendrecv.c @@ -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); diff --git a/src/instr/instr_paje_trace.c b/src/instr/instr_paje_trace.c index 625519d8e9..734496d148 100644 --- a/src/instr/instr_paje_trace.c +++ b/src/instr/instr_paje_trace.c @@ -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,