void smpi_sample_3(int global, const char *file, int line) { char *loc = sample_location(global, file, line); local_data_t *data; xbt_assert(samples, "Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!"); data = xbt_dict_get(samples, loc); XBT_DEBUG("sample3 %s",loc); if (data->benching==0) { THROW_IMPOSSIBLE; } // ok, benchmarking this loop is over xbt_os_timer_stop(smpi_process_timer()); // update the stats double sample, n; data->count++; sample = xbt_os_timer_elapsed(smpi_process_timer()); data->sum += sample; data->sum_pow2 += sample * sample; n = (double)data->count; data->mean = data->sum / n; data->relstderr = sqrt((data->sum_pow2 / n - data->mean * data->mean) / n) / data->mean; if (!sample_enough_benchs(data)) { data->mean = sample; // Still in benching process; We want sample_2 to simulate the exact time of this loop occurrence before leaving, not the mean over the history } XBT_DEBUG("Average mean after %d steps is %f, relative standard error is %f (sample was %f)", data->count, data->mean, data->relstderr, sample); // That's enough for now, prevent sample_2 to run the same code over and over data->benching = 0; }
void smpi_bench_end(void) { xbt_os_timer_t timer = smpi_process_timer(); xbt_os_timer_stop(timer); smpi_execute(xbt_os_timer_elapsed(timer)); }
void smpi_bench_begin(void) { xbt_os_timer_start(smpi_process_timer()); smpi_current_rank = smpi_process_index(); }
void smpi_bench_begin(void) { xbt_os_timer_start(smpi_process_timer()); }