From: Arnaud Giersch Date: Wed, 9 Oct 2013 20:10:33 +0000 (+0200) Subject: Length modifier 'l' is indeed wrong in %l[efg] for printf. X-Git-Tag: v3_9_90~29 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/54d4db7b7c8fa95028c7c279b87abaed1ba6c646 Length modifier 'l' is indeed wrong in %l[efg] for printf. See e.g. http://c-faq.com/stdio/scanfvsprintf.html Change it everywhere. --- diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index 91d63eef52..edb903788e 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -108,7 +108,7 @@ static void action_send(const char *const *action) sprintf(to, "%s_%s", MSG_process_get_name(MSG_process_self()), action[2]); - ACT_DEBUG("Entering Send: %s (size: %lg)", NAME, size); + ACT_DEBUG("Entering Send: %s (size: %g)", NAME, size); if (size < 65536) { action_Isend(action); } else { diff --git a/examples/simdag/goal/goal_test.c b/examples/simdag/goal/goal_test.c index 9fa69f738e..399125681f 100644 --- a/examples/simdag/goal/goal_test.c +++ b/examples/simdag/goal/goal_test.c @@ -99,7 +99,7 @@ int main(int argc, char **argv) { done=SD_simulate(-1); } while(!xbt_dynar_is_empty(done)); xbt_os_cputimer_stop(timer); - printf("exec_time:%lf\n", xbt_os_timer_elapsed(timer) ); + printf("exec_time:%f\n", xbt_os_timer_elapsed(timer) ); xbt_dynar_free(&done); xbt_dynar_free(&reclaimed); diff --git a/examples/smpi/MM/2.5D_MM.c b/examples/smpi/MM/2.5D_MM.c index bf3c9bb6e3..c83548ed8d 100644 --- a/examples/smpi/MM/2.5D_MM.c +++ b/examples/smpi/MM/2.5D_MM.c @@ -240,8 +240,8 @@ double two_dot_five( end_time = MPI_Wtime(); time = end_time - start_time; double reduce_time = end_time_reduce - start_time_reduce; - printf("communication time: %le reduce time: %le seconds, " - "total time: %le seconds\n",communication_time,reduce_time,time); + printf("communication time: %e reduce time: %e seconds, " + "total time: %e seconds\n",communication_time,reduce_time,time); MPI_Barrier(my_world); #if CHECK_25D diff --git a/examples/smpi/MM/Summa.c b/examples/smpi/MM/Summa.c index 0d0bab99f6..a53ac43490 100644 --- a/examples/smpi/MM/Summa.c +++ b/examples/smpi/MM/Summa.c @@ -152,8 +152,8 @@ inline double Summa( end_time = MPI_Wtime(); time = end_time - start_time ; - printf("communication time: %le seconds, " - "computation time: %le seconds\n", + printf("communication time: %e seconds, " + "computation time: %e seconds\n", communication_time, computation_time); diff --git a/examples/smpi/NAS/EP-sampling/ep.c b/examples/smpi/NAS/EP-sampling/ep.c index 04b0c1b396..940c1b98e3 100644 --- a/examples/smpi/NAS/EP-sampling/ep.c +++ b/examples/smpi/NAS/EP-sampling/ep.c @@ -400,7 +400,7 @@ fprintf(stdout,"CPU Time=%d\n",tm); fprintf(stdout,"N = 2^%d\n",m); fprintf(stdout,"No. Gaussain Pairs =%d\n",gc); - fprintf(stdout,"Sum = %lf %ld\n",sx,sy); + fprintf(stdout,"Sum = %f %ld\n",sx,sy); fprintf(stdout,"Count:"); for(i = 0; i < nq; i++) { fprintf(stdout,"%d\t %ld\n",i,q[i]); @@ -414,19 +414,19 @@ fprintf(stdout,"Class = %s\n", _class); fprintf(stdout,"Size = %s\n", size); fprintf(stdout,"Iteration = %d\n", nit); - fprintf(stdout,"Time in seconds = %lf\n",(tm/1000)); + fprintf(stdout,"Time in seconds = %f\n",(tm/1000)); fprintf(stdout,"Total processes = %d\n",no_nodes); - fprintf(stdout,"Mops/s total = %lf\n",Mops); - fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes); + fprintf(stdout,"Mops/s total = %f\n",Mops); + fprintf(stdout,"Mops/s/process = %f\n", Mops/no_nodes); fprintf(stdout,"Operation type = Random number generated\n"); if(verified) { fprintf(stdout,"Verification = SUCCESSFUL\n"); } else { fprintf(stdout,"Verification = UNSUCCESSFUL\n"); } - fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000)); - fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000)); - fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000)); + fprintf(stdout,"Total time: %f\n",(timer_read(1,elapsed)/1000)); + fprintf(stdout,"Gaussian pairs: %f\n",(timer_read(2,elapsed)/1000)); + fprintf(stdout,"Random numbers: %f\n",(timer_read(3,elapsed)/1000)); } #ifdef USE_MPE MPE_Finish_log(argv[0]); diff --git a/examples/smpi/NAS/EP-trace/ep-trace.c b/examples/smpi/NAS/EP-trace/ep-trace.c index 4c5f5a7027..86aba7a7f3 100644 --- a/examples/smpi/NAS/EP-trace/ep-trace.c +++ b/examples/smpi/NAS/EP-trace/ep-trace.c @@ -409,7 +409,7 @@ fprintf(stdout,"CPU Time=%d\n",tm); fprintf(stdout,"N = 2^%d\n",m); fprintf(stdout,"No. Gaussain Pairs =%d\n",gc); - fprintf(stdout,"Sum = %lf %ld\n",sx,sy); + fprintf(stdout,"Sum = %f %ld\n",sx,sy); fprintf(stdout,"Count:"); for(i = 0; i < nq; i++) { fprintf(stdout,"%d\t %ld\n",i,q[i]); @@ -423,19 +423,19 @@ fprintf(stdout,"Class = %s\n", _class); fprintf(stdout,"Size = %s\n", size); fprintf(stdout,"Iteration = %d\n", nit); - fprintf(stdout,"Time in seconds = %lf\n",(tm/1000)); + fprintf(stdout,"Time in seconds = %f\n",(tm/1000)); fprintf(stdout,"Total processes = %d\n",no_nodes); - fprintf(stdout,"Mops/s total = %lf\n",Mops); - fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes); + fprintf(stdout,"Mops/s total = %f\n",Mops); + fprintf(stdout,"Mops/s/process = %f\n", Mops/no_nodes); fprintf(stdout,"Operation type = Random number generated\n"); if(verified) { fprintf(stdout,"Verification = SUCCESSFUL\n"); } else { fprintf(stdout,"Verification = UNSUCCESSFUL\n"); } - fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000)); - fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000)); - fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000)); + fprintf(stdout,"Total time: %f\n",(timer_read(1,elapsed)/1000)); + fprintf(stdout,"Gaussian pairs: %f\n",(timer_read(2,elapsed)/1000)); + fprintf(stdout,"Random numbers: %f\n",(timer_read(3,elapsed)/1000)); } #ifdef USE_MPE MPE_Finish_log(argv[0]); diff --git a/examples/smpi/NAS/EP/ep.c b/examples/smpi/NAS/EP/ep.c index 9c18da4e8d..961422af26 100644 --- a/examples/smpi/NAS/EP/ep.c +++ b/examples/smpi/NAS/EP/ep.c @@ -400,7 +400,7 @@ fprintf(stdout,"CPU Time=%d\n",tm); fprintf(stdout,"N = 2^%d\n",m); fprintf(stdout,"No. Gaussain Pairs =%d\n",gc); - fprintf(stdout,"Sum = %lf %ld\n",sx,sy); + fprintf(stdout,"Sum = %f %ld\n",sx,sy); fprintf(stdout,"Count:"); for(i = 0; i < nq; i++) { fprintf(stdout,"%d\t %ld\n",i,q[i]); @@ -414,19 +414,19 @@ fprintf(stdout,"Class = %s\n", _class); fprintf(stdout,"Size = %s\n", size); fprintf(stdout,"Iteration = %d\n", nit); - fprintf(stdout,"Time in seconds = %lf\n",(tm/1000)); + fprintf(stdout,"Time in seconds = %f\n",(tm/1000)); fprintf(stdout,"Total processes = %d\n",no_nodes); - fprintf(stdout,"Mops/s total = %lf\n",Mops); - fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes); + fprintf(stdout,"Mops/s total = %f\n",Mops); + fprintf(stdout,"Mops/s/process = %f\n", Mops/no_nodes); fprintf(stdout,"Operation type = Random number generated\n"); if(verified) { fprintf(stdout,"Verification = SUCCESSFUL\n"); } else { fprintf(stdout,"Verification = UNSUCCESSFUL\n"); } - fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000)); - fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000)); - fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000)); + fprintf(stdout,"Total time: %f\n",(timer_read(1,elapsed)/1000)); + fprintf(stdout,"Gaussian pairs: %f\n",(timer_read(2,elapsed)/1000)); + fprintf(stdout,"Random numbers: %f\n",(timer_read(3,elapsed)/1000)); } #ifdef USE_MPE MPE_Finish_log(argv[0]); diff --git a/src/simix/smx_context_raw.c b/src/simix/smx_context_raw.c index e42ef76585..829f47e714 100644 --- a/src/simix/smx_context_raw.c +++ b/src/simix/smx_context_raw.c @@ -276,8 +276,8 @@ void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory) static int smx_ctx_raw_factory_finalize(smx_context_factory_t *factory) { #ifdef TIME_BENCH_PER_SR - XBT_CRITICAL("Total wasted time in %u SR: %lf", sr_count, time_wasted_sr); - XBT_CRITICAL("Total wasted time in %u SSR: %lf", ssr_count, time_wasted_ssr); + XBT_CRITICAL("Total wasted time in %u SR: %f", sr_count, time_wasted_sr); + XBT_CRITICAL("Total wasted time in %u SSR: %f", ssr_count, time_wasted_ssr); #endif #ifdef CONTEXT_THREADS @@ -463,7 +463,7 @@ static void smx_ctx_raw_runall_serial(xbt_dynar_t processes) tmax = time_thread_ssr[t]; for(cursor=0; cursor <= t; cursor++){ - XBT_VERB("Time SSR thread %u = %lf (max %lf)", cursor, time_thread_ssr[cursor], tmax); + XBT_VERB("Time SSR thread %u = %f (max %f)", cursor, time_thread_ssr[cursor], tmax); time_wasted_ssr += tmax - time_thread_ssr[cursor]; } } @@ -481,7 +481,7 @@ void smx_ctx_raw_new_sr(void) } for(i=0; i < NUM_THREADS; i++){ - XBT_VERB("Time SR thread %u = %lf (max %lf)", i, time_thread_sr[i], tmax); + XBT_VERB("Time SR thread %u = %f (max %f)", i, time_thread_sr[i], tmax); time_wasted_sr += tmax - time_thread_sr[i]; } diff --git a/src/simix/smx_environment.c b/src/simix/smx_environment.c index 06b29d1ddc..b8655fa60c 100644 --- a/src/simix/smx_environment.c +++ b/src/simix/smx_environment.c @@ -38,7 +38,7 @@ void SIMIX_create_environment(const char *file) start = xbt_os_time(); parse_platform_file(file); end = xbt_os_time(); - XBT_DEBUG("PARSE TIME: %lg", (end - start)); + XBT_DEBUG("PARSE TIME: %g", (end - start)); } diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index 981891b839..48127cbcf4 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -164,7 +164,7 @@ static void SIMIX_clean(void) #ifdef TIME_BENCH_AMDAHL xbt_os_cputimer_stop(simix_global->timer_seq); - XBT_INFO("Amdahl timing informations. Sequential time: %lf; Parallel time: %lf", + XBT_INFO("Amdahl timing informations. Sequential time: %f; Parallel time: %f", xbt_os_timer_elapsed(simix_global->timer_seq), xbt_os_timer_elapsed(simix_global->timer_par)); xbt_os_timer_free(simix_global->timer_seq); diff --git a/src/smpi/colls/smpi_automatic_selector.c b/src/smpi/colls/smpi_automatic_selector.c index 7c42c92df5..a94bd31d32 100644 --- a/src/smpi/colls/smpi_automatic_selector.c +++ b/src/smpi/colls/smpi_automatic_selector.c @@ -50,9 +50,9 @@ }\ }\ if(smpi_comm_rank(comm)==0){\ - XBT_WARN("For rank 0, the quickest was %s : %lf , but global was %s : %lf at max",mpi_coll_##cat##_description[min_coll].name, time_min,mpi_coll_##cat##_description[global_coll].name, max_min);\ + XBT_WARN("For rank 0, the quickest was %s : %f , but global was %s : %f at max",mpi_coll_##cat##_description[min_coll].name, time_min,mpi_coll_##cat##_description[global_coll].name, max_min);\ }else\ - XBT_WARN("The quickest %s was %s on rank %d and took %lf",#cat,mpi_coll_##cat##_description[min_coll].name, smpi_comm_rank(comm), time_min);\ + XBT_WARN("The quickest %s was %s on rank %d and took %f",#cat,mpi_coll_##cat##_description[min_coll].name, smpi_comm_rank(comm), time_min);\ return (min_coll!=-1)?MPI_SUCCESS:MPI_ERR_INTERN;\ }\ diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index eed7b81095..2632bac808 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -129,13 +129,13 @@ static double smpi_os(double size) double current=0.0; xbt_dynar_foreach(smpi_os_values, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("os : %lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("os : %f <= %ld return %f", size, fact.factor, current); return current; }else{ current=fact.values[0]+fact.values[1]*size; } } - XBT_DEBUG("os : %lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("os : %f > %ld return %f", size, fact.factor, current); return current; } @@ -151,13 +151,13 @@ static double smpi_ois(double size) double current=0.0; xbt_dynar_foreach(smpi_ois_values, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("ois : %lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("ois : %f <= %ld return %f", size, fact.factor, current); return current; }else{ current=fact.values[0]+fact.values[1]*size; } } - XBT_DEBUG("ois : %lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("ois : %f > %ld return %f", size, fact.factor, current); return current; } @@ -173,12 +173,12 @@ static double smpi_or(double size) double current=0.0; xbt_dynar_foreach(smpi_or_values, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("or : %lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("or : %f <= %ld return %f", size, fact.factor, current); return current; }else current=fact.values[0]+fact.values[1]*size; } - XBT_DEBUG("or : %lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("or : %f > %ld return %f", size, fact.factor, current); return current; } @@ -335,7 +335,7 @@ void smpi_mpi_start(MPI_Request request) double sleeptime = request->detached ? smpi_or(request->size) : 0.0; if(sleeptime!=0.0){ simcall_process_sleep(sleeptime); - XBT_DEBUG("receiving size of %zu : sleep %lf ", request->size, smpi_or(request->size)); + XBT_DEBUG("receiving size of %zu : sleep %f ", request->size, smpi_or(request->size)); } } else { @@ -388,7 +388,7 @@ void smpi_mpi_start(MPI_Request request) if(sleeptime!=0.0){ simcall_process_sleep(sleeptime); - XBT_DEBUG("sending size of %zu : sleep %lf ", request->size, smpi_os(request->size)); + XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size)); } request->action = diff --git a/src/surf/cpu_cas01.c b/src/surf/cpu_cas01.c index 3430431fc3..15cf9981c3 100644 --- a/src/surf/cpu_cas01.c +++ b/src/surf/cpu_cas01.c @@ -63,7 +63,7 @@ static void *cpu_create_resource(const char *name, xbt_dynar_t power_peak, cpu->energy->power_range_watts_list = cpu_get_watts_range_list(cpu); cpu->energy->last_updated = surf_get_clock(); - XBT_DEBUG("CPU create: peak=%lf, pstate=%d",cpu->power_peak, cpu->pstate); + XBT_DEBUG("CPU create: peak=%f, pstate=%d",cpu->power_peak, cpu->pstate); xbt_assert(cpu->power_peak > 0, "Power has to be >0"); cpu->power_scale = power_scale; @@ -247,8 +247,8 @@ static double cpu_get_current_watts_value(cpu_Cas01_t cpu_model, double cpu_load double current_power = min_power + cpu_load * power_slope; - XBT_DEBUG("[get_current_watts] min_power=%lf, max_power=%lf, slope=%lf", min_power, max_power, power_slope); - XBT_DEBUG("[get_current_watts] Current power (watts) = %lf, load = %lf", current_power, cpu_load); + XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope); + XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load); return current_power; @@ -264,7 +264,7 @@ void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load) double start_time = cpu_model->energy->last_updated; double finish_time = surf_get_clock(); - XBT_DEBUG("[cpu_update_energy] action time interval=(%lf-%lf), current power peak=%lf, current pstate=%d", + XBT_DEBUG("[cpu_update_energy] action time interval=(%f-%f), current power peak=%f, current pstate=%d", start_time, finish_time, cpu_model->power_peak, cpu_model->pstate); double current_energy = cpu_model->energy->total_energy; double action_energy = cpu_get_current_watts_value(cpu_model, cpu_load)*(finish_time-start_time); @@ -272,7 +272,7 @@ void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load) cpu_model->energy->total_energy = current_energy + action_energy; cpu_model->energy->last_updated = finish_time; - XBT_DEBUG("[cpu_update_energy] old_energy_value=%lf, action_energy_value=%lf", current_energy, action_energy); + XBT_DEBUG("[cpu_update_energy] old_energy_value=%f, action_energy_value=%f", current_energy, action_energy); } diff --git a/src/surf/cpu_ti.c b/src/surf/cpu_ti.c index 9a61031cf1..b14ceecb14 100644 --- a/src/surf/cpu_ti.c +++ b/src/surf/cpu_ti.c @@ -111,7 +111,7 @@ static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace, if (!power_trace) { trace->type = TRACE_FIXED; trace->value = value; - XBT_DEBUG("No availability trace. Constant value = %lf", value); + XBT_DEBUG("No availability trace. Constant value = %f", value); return trace; } @@ -135,7 +135,7 @@ static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace, trace->total = surf_cpu_ti_integrate_trace_simple(trace->trace, 0, total_time); - XBT_DEBUG("Total integral %lf, last_time %lf ", + XBT_DEBUG("Total integral %f, last_time %f ", trace->total, trace->last_time); return trace; @@ -169,10 +169,10 @@ static void* cpu_ti_create_resource(const char *name, xbt_dynar_t power_peak, xbt_dynar_free(&power_peak); /* kill memory leak */ //cpu->power_peak = power_peak; cpu->pstate = pstate; - XBT_DEBUG("CPU create: peak=%lf, pstate=%d",cpu->power_peak, cpu->pstate); + XBT_DEBUG("CPU create: peak=%f, pstate=%d",cpu->power_peak, cpu->pstate); xbt_assert(cpu->power_peak > 0, "Power has to be >0"); - XBT_DEBUG("power scale %lf", power_scale); + XBT_DEBUG("power scale %f", power_scale); cpu->power_scale = power_scale; cpu->avail_trace = cpu_ti_parse_trace(power_trace, power_scale); cpu->state_current = state_initial; @@ -332,7 +332,7 @@ static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now) area_total = surf_cpu_ti_integrate_trace(cpu->avail_trace, cpu->last_update, now) * cpu->power_peak; - XBT_DEBUG("Flops total: %lf, Last update %lf", area_total, + XBT_DEBUG("Flops total: %f, Last update %f", area_total, cpu->last_update); xbt_swag_foreach(action, cpu->action_set) { @@ -363,7 +363,7 @@ static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now) double_update(&(generic->remains), area_total / (cpu->sum_priority * generic->priority)); - XBT_DEBUG("Update remaining action(%p) remaining %lf", action, + XBT_DEBUG("Update remaining action(%p) remaining %f", action, generic->remains); } cpu->last_update = now; @@ -449,7 +449,7 @@ static void cpu_ti_update_action_finish_date(cpu_ti_t cpu, double now) xbt_heap_push(cpu_ti_action_heap, action, min_finish); XBT_DEBUG - ("Update finish time: Cpu(%s) Action: %p, Start Time: %lf Finish Time: %lf Max duration %lf", + ("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", cpu->generic_resource.name, action, GENERIC_ACTION(action).start, GENERIC_ACTION(action).finish, GENERIC_ACTION(action).max_duration); @@ -472,7 +472,7 @@ static double cpu_ti_share_resources(double now) if (xbt_heap_size(cpu_ti_action_heap) > 0) min_action_duration = xbt_heap_maxkey(cpu_ti_action_heap) - now; - XBT_DEBUG("Share resources, min next event date: %lf", min_action_duration); + XBT_DEBUG("Share resources, min next event date: %f", min_action_duration); return min_action_duration; } @@ -507,7 +507,7 @@ static void cpu_ti_update_resource_state(void *id, surf_cpu_ti_tgmr_t trace; s_tmgr_event_t val; - XBT_DEBUG("Finish trace date: %lf value %lf date %lf", surf_get_clock(), + XBT_DEBUG("Finish trace date: %f value %f date %f", surf_get_clock(), value, date); /* update remaining of actions and put in modified cpu swag */ cpu_ti_update_remaining_amount(cpu, date); @@ -523,7 +523,7 @@ static void cpu_ti_update_resource_state(void *id, trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1); trace->type = TRACE_FIXED; trace->value = val.value; - XBT_DEBUG("value %lf", val.value); + XBT_DEBUG("value %f", val.value); cpu->avail_trace = trace; @@ -920,7 +920,7 @@ static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t trace->nb_points - 1); integral += trace->integral[ind]; XBT_DEBUG - ("a %lf ind %d integral %lf ind + 1 %lf ind %lf time +1 %lf time %lf", + ("a %f ind %d integral %f ind + 1 %f ind %f time +1 %f time %f", a, ind, integral, trace->integral[ind + 1], trace->integral[ind], trace->time_points[ind + 1], trace->time_points[ind]); double_update(&a_aux, trace->time_points[ind]); @@ -932,7 +932,7 @@ static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t trace-> time_points [ind]); - XBT_DEBUG("Integral a %lf = %lf", a, integral); + XBT_DEBUG("Integral a %f = %f", a, integral); return integral; } @@ -982,14 +982,14 @@ static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a, return (a + (amount / trace->value)); } - XBT_DEBUG("amount %lf total %lf", amount, trace->total); + XBT_DEBUG("amount %f total %f", amount, trace->total); /* Reduce the problem to one where amount <= trace_total */ quotient = (int) (floor(amount / trace->total)); reduced_amount = (trace->total) * ((amount / trace->total) - floor(amount / trace->total)); reduced_a = a - (trace->last_time) * (int) (floor(a / trace->last_time)); - XBT_DEBUG("Quotient: %d reduced_amount: %lf reduced_a: %lf", quotient, + XBT_DEBUG("Quotient: %d reduced_amount: %f reduced_a: %f", quotient, reduced_amount, reduced_a); /* Now solve for new_amount which is <= trace_total */ @@ -1085,7 +1085,7 @@ static int surf_cpu_ti_binary_search(double *array, double a, int low, int mid; do { mid = low + (high - low) / 2; - XBT_DEBUG("a %lf low %d high %d mid %d value %lf", a, low, high, mid, + XBT_DEBUG("a %f low %d high %d mid %d value %f", a, low, high, mid, array[mid]); if (array[mid] > a) diff --git a/src/surf/network.c b/src/surf/network.c index d3d87f7680..d521acfb60 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -126,12 +126,12 @@ static double smpi_bandwidth_factor(double size) double current=1.0; xbt_dynar_foreach(smpi_bw_factor, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current); return current; }else current=fact.value; } - XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f > %ld return %f", size, fact.factor, current); return current; } @@ -147,12 +147,12 @@ static double smpi_latency_factor(double size) double current=1.0; xbt_dynar_foreach(smpi_lat_factor, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current); return current; }else current=fact.value; } - XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f > %ld return %f", size, fact.factor, current); return current; } @@ -379,8 +379,8 @@ static void net_update_resource_state(void *id, double value, double date) { link_CM02_t nw_link = id; - /* printf("[" "%lg" "] Asking to update network card \"%s\" with value " */ - /* "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */ + /* printf("[" "%g" "] Asking to update network card \"%s\" with value " */ + /* "%g" " for event %p\n", surf_get_clock(), nw_link->name, */ /* value, event_type); */ if (event_type == nw_link->lmm_resource.power.event) { diff --git a/src/surf/network_gtnets.c b/src/surf/network_gtnets.c index 4e8396bded..4392bb3330 100644 --- a/src/surf/network_gtnets.c +++ b/src/surf/network_gtnets.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2012. The SimGrid Team. +/* Copyright (c) 2007-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -210,7 +210,7 @@ static double share_resources(double now) XBT_DEBUG("Calling gtnets_get_time_to_next_flow_completion"); time_to_next_flow_completion = gtnets_get_time_to_next_flow_completion(); - XBT_DEBUG("gtnets_get_time_to_next_flow_completion received %lg", + XBT_DEBUG("gtnets_get_time_to_next_flow_completion received %g", time_to_next_flow_completion); return time_to_next_flow_completion; diff --git a/src/surf/surf.c b/src/surf/surf.c index 8c3be87c0d..de54e4373c 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -352,14 +352,14 @@ double generic_share_resources_lazy(double now, surf_model_t model) max_dur_flag = 1; } - XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action, + XBT_DEBUG("Action(%p) Start %f Finish %f Max_duration %f", action, action->generic_action.start, now + value, action->generic_action.max_duration); if (min != -1) { surf_action_lmm_heap_remove(model->model_private->action_heap,action); surf_action_lmm_heap_insert(model->model_private->action_heap,action, min, max_dur_flag ? MAX_DURATION : NORMAL); - XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, + XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min, now); } else DIE_IMPOSSIBLE; } @@ -370,7 +370,7 @@ double generic_share_resources_lazy(double now, surf_model_t model) else min = -1; - XBT_DEBUG("The minimum with the HEAP %lf", min); + XBT_DEBUG("The minimum with the HEAP %f", min); return min; } @@ -625,7 +625,7 @@ double surf_solve(double max_date) } /* update state of model_obj according to new value. Does not touch lmm. It will be modified if needed when updating actions */ - XBT_DEBUG("Calling update_resource_state for resource %s with min %lf", + XBT_DEBUG("Calling update_resource_state for resource %s with min %f", resource->name, min); resource->model->model_private->update_resource_state(resource, diff --git a/src/surf/surf_action.c b/src/surf/surf_action.c index 891a70e2bf..86e752db18 100644 --- a/src/surf/surf_action.c +++ b/src/surf/surf_action.c @@ -314,7 +314,7 @@ void generic_update_action_remaining_lazy( surf_action_lmm_t action, double now) delta = now - action->last_update; if (action->generic_action.remains > 0) { - XBT_DEBUG("Updating action(%p): remains was %lf, last_update was: %lf", action, action->generic_action.remains, action->last_update); + XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", action, action->generic_action.remains, action->last_update); double_update(&(action->generic_action.remains), action->last_value * delta); @@ -331,7 +331,7 @@ void generic_update_action_remaining_lazy( surf_action_lmm_t action, double now) now - action->last_update); } #endif - XBT_DEBUG("Updating action(%p): remains is now %lf", action, + XBT_DEBUG("Updating action(%p): remains is now %f", action, action->generic_action.remains); } diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 3d6a122d19..cae8e45bec 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -54,7 +54,7 @@ double surf_parse_get_double(const char *string) { int ret = sscanf(string, "%lg", &res); if (ret != 1) surf_parse_error("%s is not a double", string); - //printf("Parsed double [%lg] %s\n", res, string); + //printf("Parsed double [%g] %s\n", res, string); return res; } @@ -450,7 +450,7 @@ void ETag_surfxml_host(void) { xbt_str_trim(power_value_str, NULL); power_value = get_cpu_power(power_value_str); xbt_dynar_push_as(host.power_peak, double, power_value); - XBT_DEBUG("Power value: %lf", power_value); + XBT_DEBUG("Power value: %f", power_value); } xbt_dynar_free(&pstate_list); } @@ -602,10 +602,10 @@ void ETag_surfxml_link(void){ link.id = A_surfxml_link_id; link.bandwidth = surf_parse_get_bandwidth(A_surfxml_link_bandwidth); - //printf("Link bandwidth [%lg]\n", link.bandwidth); + //printf("Link bandwidth [%g]\n", link.bandwidth); link.bandwidth_trace = tmgr_trace_new_from_file(A_surfxml_link_bandwidth___file); link.latency = surf_parse_get_time(A_surfxml_link_latency); - //printf("Link latency [%lg]\n", link.latency); + //printf("Link latency [%g]\n", link.latency); link.latency_trace = tmgr_trace_new_from_file(A_surfxml_link_latency___file); switch (A_surfxml_link_state) { diff --git a/src/surf/trace_mgr.c b/src/surf/trace_mgr.c index 3ce034e4b7..db285978ea 100644 --- a/src/surf/trace_mgr.c +++ b/src/surf/trace_mgr.c @@ -269,7 +269,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, } xbt_assert(periodicity >= 0, - "Invalid periodicity %lg (must be positive)", periodicity); + "Invalid periodicity %g (must be positive)", periodicity); trace = xbt_new0(s_tmgr_trace_t, 1); trace->type = e_trace_list; @@ -292,7 +292,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, if (last_event) { if (last_event->delta > event.delta) { xbt_die("%s:%d: Invalid trace: Events must be sorted, " - "but time %lg > time %lg.\n%s", + "but time %g > time %g.\n%s", id, linecount, last_event->delta, event.delta, input); } last_event->delta = event.delta - last_event->delta; diff --git a/src/xbt/config.c b/src/xbt/config.c index 33373be791..7873dd451a 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -795,7 +795,7 @@ void xbt_cfg_setdefault_double(xbt_cfg_t cfg, const char *name, double val) } else XBT_DEBUG - ("Do not override configuration variable '%s' with value '%lf' because it was already set.", + ("Do not override configuration variable '%s' with value '%f' because it was already set.", name, val); } diff --git a/teshsuite/msg/trace/test_trace_integration.c b/teshsuite/msg/trace/test_trace_integration.c index 6627f14ba9..d09b5c5e4a 100644 --- a/teshsuite/msg/trace/test_trace_integration.c +++ b/teshsuite/msg/trace/test_trace_integration.c @@ -32,8 +32,8 @@ int test_trace(int argc, char *argv[]) task_prio = atof(argv[2]); XBT_INFO("Testing the trace integration cpu model: CpuTI"); - XBT_INFO("Task size: %lf", task_comp_size); - XBT_INFO("Task prio: %lf", task_prio); + XBT_INFO("Task size: %f", task_comp_size); + XBT_INFO("Task prio: %f", task_prio); /* Create and execute a single task. */ task = MSG_task_create("proc 0", task_comp_size, 0, NULL); diff --git a/teshsuite/simdag/platforms/Evaluate_get_route_time.c b/teshsuite/simdag/platforms/Evaluate_get_route_time.c index e81c8521d4..14905f20f1 100644 --- a/teshsuite/simdag/platforms/Evaluate_get_route_time.c +++ b/teshsuite/simdag/platforms/Evaluate_get_route_time.c @@ -49,7 +49,7 @@ int main(int argc, char **argv) SD_route_get_list(w1, w2); xbt_os_cputimer_stop(timer); - printf("%lf\n", xbt_os_timer_elapsed(timer) ); + printf("%f\n", xbt_os_timer_elapsed(timer) ); SD_exit(); diff --git a/teshsuite/simdag/platforms/Evaluate_parse_time.c b/teshsuite/simdag/platforms/Evaluate_parse_time.c index 4e88189a30..e93d9727d6 100644 --- a/teshsuite/simdag/platforms/Evaluate_parse_time.c +++ b/teshsuite/simdag/platforms/Evaluate_parse_time.c @@ -27,7 +27,7 @@ int main(int argc, char **argv) xbt_os_cputimer_stop(timer); /* Display the result and exit after cleanup */ - printf( "%lf\n", xbt_os_timer_elapsed(timer) ); + printf( "%f\n", xbt_os_timer_elapsed(timer) ); printf("Workstation number: %d, link number: %d\n", SD_workstation_get_number(), SD_link_get_number()); if(argv[2]){ diff --git a/teshsuite/smpi/barrier.c b/teshsuite/smpi/barrier.c index 0ce9dc3691..1a680de27b 100644 --- a/teshsuite/smpi/barrier.c +++ b/teshsuite/smpi/barrier.c @@ -24,7 +24,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (0 == rank) { printf("... Barrier ....\n"); - //printf("Elapsed=%lf s\n", MPI_Wtime() - start_timer); + //printf("Elapsed=%f s\n", MPI_Wtime() - start_timer); } MPI_Finalize(); diff --git a/teshsuite/smpi/bcast.c b/teshsuite/smpi/bcast.c index 2edf6965b7..0743d23351 100644 --- a/teshsuite/smpi/bcast.c +++ b/teshsuite/smpi/bcast.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2012. The SimGrid Team. +/* Copyright (c) 2009, 2012-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (0 == rank && !quiet) - printf("Elapsed time on rank %d: %lf s\n", rank, + printf("Elapsed time on rank %d: %f s\n", rank, MPI_Wtime() - start_timer); MPI_Finalize(); return 0; diff --git a/teshsuite/smpi/mpich3-test/coll/opmaxloc.c b/teshsuite/smpi/mpich3-test/coll/opmaxloc.c index 0c64ee0fd4..9ea01f60d4 100644 --- a/teshsuite/smpi/mpich3-test/coll/opmaxloc.c +++ b/teshsuite/smpi/mpich3-test/coll/opmaxloc.c @@ -216,7 +216,7 @@ int main( int argc, char *argv[] ) } if (coutbuf[1].val != 0) { errs++; - fprintf( stderr, "double-int MAXLOC(0) test failed, value = %lf, should be zero\n", coutbuf[1].val ); + fprintf( stderr, "double-int MAXLOC(0) test failed, value = %f, should be zero\n", coutbuf[1].val ); } if (coutbuf[1].loc != 0) { errs++; @@ -261,7 +261,7 @@ int main( int argc, char *argv[] ) } if (coutbuf[1].val != 0) { errs++; - fprintf( stderr, "long double-int MAXLOC(0) test failed, value = %lf, should be zero\n", (double)coutbuf[1].val ); + fprintf( stderr, "long double-int MAXLOC(0) test failed, value = %f, should be zero\n", (double)coutbuf[1].val ); } if (coutbuf[1].loc != 0) { errs++; @@ -269,7 +269,7 @@ int main( int argc, char *argv[] ) } if (coutbuf[2].val != size-1) { errs++; - fprintf( stderr, "long double-int MAXLOC(>) test failed, value = %lf, should be %d\n", (double)coutbuf[2].val, size-1 ); + fprintf( stderr, "long double-int MAXLOC(>) test failed, value = %f, should be %d\n", (double)coutbuf[2].val, size-1 ); } if (coutbuf[2].loc != size-1) { errs++; diff --git a/teshsuite/smpi/reduce.c b/teshsuite/smpi/reduce.c index 2946edc930..84203e9a8e 100644 --- a/teshsuite/smpi/reduce.c +++ b/teshsuite/smpi/reduce.c @@ -105,7 +105,7 @@ int main(int argc, char **argv) else printf("failed.\n"); if (!quiet) - printf("Elapsed time=%lf s\n", MPI_Wtime() - start_timer); + printf("Elapsed time=%f s\n", MPI_Wtime() - start_timer); } MPI_Barrier(MPI_COMM_WORLD); diff --git a/teshsuite/smpi/scatter.c b/teshsuite/smpi/scatter.c index 50cec08553..0096064d9c 100644 --- a/teshsuite/smpi/scatter.c +++ b/teshsuite/smpi/scatter.c @@ -97,7 +97,7 @@ static int small_test(int rank, int size) } // verification if ((double) rank != rcvd) { - fprintf(stderr, "[%d] has %lf instead of %d\n", rank, rcvd, rank); + fprintf(stderr, "[%d] has %f instead of %d\n", rank, rcvd, rank); success = 0; } return (success); diff --git a/teshsuite/smpi/struct_test.c b/teshsuite/smpi/struct_test.c index 11827c6fc7..1159b933e3 100644 --- a/teshsuite/smpi/struct_test.c +++ b/teshsuite/smpi/struct_test.c @@ -51,7 +51,7 @@ char **argv; MPI_Bcast( &value, 1, mystruct, 0, MPI_COMM_WORLD ); - printf( "Process %d got %d (-2?) and %lf (8.0?), tab (should be all 0): ", rank, value.a, value.b ); + printf( "Process %d got %d (-2?) and %f (8.0?), tab (should be all 0): ", rank, value.a, value.b ); for(j=0; j<2;j++ ) for(i=0; i<3;i++ ) diff --git a/testsuite/xbt/graphxml_usage.c b/testsuite/xbt/graphxml_usage.c index ab6b3a2ab2..965c1e52eb 100644 --- a/testsuite/xbt/graphxml_usage.c +++ b/testsuite/xbt/graphxml_usage.c @@ -1,6 +1,6 @@ /* A few basic tests for the graphxml library */ -/* Copyright (c) 2006-2012. The SimGrid Team. +/* Copyright (c) 2006-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -79,7 +79,7 @@ void test(char *graph_file) buf = xbt_new0(char, n * 20); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { - sprintf(buf + strlen(buf), "%le\t", adj[i * n + j]); + sprintf(buf + strlen(buf), "%e\t", adj[i * n + j]); } XBT_INFO("%s", buf); buf[0] = '\000'; diff --git a/testsuite/xbt/heap_bench.c b/testsuite/xbt/heap_bench.c index b37c46a0b9..5cca0cb233 100644 --- a/testsuite/xbt/heap_bench.c +++ b/testsuite/xbt/heap_bench.c @@ -1,6 +1,6 @@ /* A few tests for the xbt_heap module */ -/* Copyright (c) 2004-2010, 2012. The SimGrid Team. +/* Copyright (c) 2004-2010, 2012, 2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ void test_heap_validity(int size) qsort(tab, size, sizeof(double), compare_double); for (i = 0; i < size; i++) { - /* printf("%lg" " ", xbt_heap_maxkey(heap)); */ + /* printf("%g" " ", xbt_heap_maxkey(heap)); */ if (xbt_heap_maxkey(heap) != tab[i]) { fprintf(stderr, "Problem !\n"); exit(1);