X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/772f8dd3b48f0c9dff20f67a4c2ea1cbbe673f8d..0ffe46c97f312f9af2b6eb0c4068a84d4523fb10:/src/smpi/smpi_bench.cpp diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index f4404d5e1b..891b66338f 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -252,6 +252,7 @@ void smpi_bench_end(void) if (MC_is_active() || MC_record_replay_is_active()) return; + double speedup = 1; xbt_os_timer_t timer = smpi_process_timer(); xbt_os_threadtimer_stop(timer); // smpi_switch_data_segment(smpi_process_count()); @@ -261,9 +262,22 @@ void smpi_bench_end(void) xbt_backtrace_display_current(); xbt_die("Aborting."); } + + if (xbt_cfg_get_string("smpi/comp-adjustment-file")[0] != '\0') { // Maybe we need to artificially speed up or slow + // down our computation based on our statistical analysis. + + smpi_trace_call_location_t* loc = smpi_process_get_call_location(); + std::string key = loc->get_composed_key(); + std::map::const_iterator it = location2speedup.find(key); + if (it != location2speedup.end()) { + speedup = it->second; + } + } + // Simulate the benchmarked computation unless disabled via command-line argument - if (xbt_cfg_get_boolean("smpi/simulate-computation")) - smpi_execute(xbt_os_timer_elapsed(timer)); + if (xbt_cfg_get_boolean("smpi/simulate-computation")) { + smpi_execute(xbt_os_timer_elapsed(timer)/speedup); + } smpi_total_benched_time += xbt_os_timer_elapsed(timer); } @@ -724,15 +738,12 @@ void smpi_destroy_global_memory_segments(){ #endif } -extern "C" { - - smpi_trace_call_location_t trace_call_location; - - smpi_trace_call_location_t* smpi_trace_get_call_location() { - return smpi_process_get_call_location(); - } +smpi_trace_call_location_t* smpi_trace_get_call_location() { + return smpi_process_get_call_location(); +} - void smpi_trace_set_call_location(const char* file, int line) { +extern "C" { /** These functions will be called from the user code **/ + void smpi_trace_set_call_location(const char* file, const int line) { smpi_trace_call_location_t* loc = smpi_process_get_call_location(); loc->previous_filename = loc->filename;