X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8476066e41d514872e88d00fcd92c5d4ea2129b0..cd8852187f491f7fa8049414d7ac2d0193518e23:/src/smpi/smpi_bench.c diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index 5a830aa991..7ab58fa992 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -7,6 +7,7 @@ #include "private.h" #include "xbt/dict.h" #include "xbt/sysdep.h" +#include "surf/surf.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (benchmarking)"); @@ -38,30 +39,17 @@ void smpi_bench_destroy(void) static void smpi_execute_flops(double flops) { - smx_host_t host; smx_action_t action; - smx_mutex_t mutex; - smx_cond_t cond; - e_surf_action_state_t state; - + smx_host_t host; host = SIMIX_host_self(); - mutex = SIMIX_mutex_init(); - cond = SIMIX_cond_init(); + DEBUG1("Handle real computation time: %f flops", flops); - action = SIMIX_action_execute(host, "computation", flops); - SIMIX_mutex_lock(mutex); - SIMIX_register_action_to_condition(action, cond); - for (state = SIMIX_action_get_state(action); - state == SURF_ACTION_READY || - state == SURF_ACTION_RUNNING; - state = SIMIX_action_get_state(action)) { - SIMIX_cond_wait(cond, mutex); - } - SIMIX_unregister_action_to_condition(action, cond); - SIMIX_mutex_unlock(mutex); - SIMIX_action_destroy(action); - SIMIX_cond_destroy(cond); - SIMIX_mutex_destroy(mutex); + action = SIMIX_req_host_execute("computation", host, flops); +#ifdef HAVE_TRACING + SIMIX_req_set_category (action, TRACE_internal_smpi_get_category()); +#endif + SIMIX_req_host_execution_wait(action); + SIMIX_req_host_execution_destroy(action); } static void smpi_execute(double duration)