-// FIXME: could cause trouble with multithreaded procs on same host...
-// FIXME: add benchmarking flag?
+void smpi_execute(double duration) {
+ smx_host_t host = SIMIX_host_self();
+ smx_action_t action;
+
+ SIMIX_mutex_lock(smpi_global->execute_mutex);
+
+ action = SIMIX_action_execute(host, "computation", duration * SMPI_DEFAULT_SPEED);
+
+ SIMIX_register_action_to_condition(action, smpi_global->execute_cond);
+ SIMIX_cond_wait(smpi_global->execute_cond, smpi_global->execute_mutex);
+ SIMIX_unregister_action_to_condition(action, smpi_global->execute_cond);
+ SIMIX_action_destroy(action);
+
+ SIMIX_mutex_unlock(smpi_global->execute_mutex);
+
+ return;
+}