double rate);
XBT_PUBLIC(void) simcall_execution_destroy(smx_synchro_t execution);
XBT_PUBLIC(void) simcall_execution_cancel(smx_synchro_t execution);
-XBT_PUBLIC(double) simcall_execution_get_remains(smx_synchro_t execution);
-XBT_PUBLIC(e_smx_state_t) simcall_execution_get_state(smx_synchro_t execution);
XBT_PUBLIC(void) simcall_execution_set_priority(smx_synchro_t execution, double priority);
XBT_PUBLIC(void) simcall_execution_set_bound(smx_synchro_t execution, double bound);
XBT_PUBLIC(void) simcall_execution_set_affinity(smx_synchro_t execution, sg_host_t host, unsigned long mask);
*/
double MSG_task_get_flops_amount(msg_task_t task) {
if (task->simdata->compute) {
- return simcall_execution_get_remains(task->simdata->compute);
+ return task->simdata->compute->remains();
} else {
return task->simdata->flops_amount;
}
if (surf_exec)
surf_exec->resume();
}
+
+double simgrid::simix::Exec::remains()
+{
+ if (state == SIMIX_RUNNING)
+ return surf_exec->getRemains();
+
+ return 0;
+}
public:
void suspend();
void resume();
+ double remains();
sg_host_t host; /* The host where the execution takes place */
surf_action_t surf_exec; /* The Surf execution action encapsulated */
simcall_BODY_execution_cancel(execution);
}
-/**
- * \ingroup simix_process_management
- * \brief Returns how much of an execution synchro remains to be done.
- *
- * \param execution The execution synchro
- * \return The remaining amount
- */
-double simcall_execution_get_remains(smx_synchro_t execution)
-{
- return simcall_BODY_execution_get_remains(execution);
-}
-
-/**
- * \ingroup simix_process_management
- * \brief Returns the state of an execution synchro.
- *
- * \param execution The execution synchro
- * \return The state
- */
-e_smx_state_t simcall_execution_get_state(smx_synchro_t execution)
-{
- return simcall_BODY_execution_get_state(execution);
-}
-
/**
* \ingroup simix_process_management
* \brief Changes the priority of an execution synchro.
simcall->args[0].dp = arg;
}
-static inline smx_synchro_t simcall_execution_get_remains__get__execution(smx_simcall_t simcall) {
- return (smx_synchro_t) simcall->args[0].dp;
-}
-static inline void simcall_execution_get_remains__set__execution(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline double simcall_execution_get_remains__get__result(smx_simcall_t simcall){
- return simcall->result.d;
-}
-static inline void simcall_execution_get_remains__set__result(smx_simcall_t simcall, double result){
- simcall->result.d = result;
-}
-
-static inline smx_synchro_t simcall_execution_get_state__get__execution(smx_simcall_t simcall) {
- return (smx_synchro_t) simcall->args[0].dp;
-}
-static inline void simcall_execution_get_state__set__execution(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline e_smx_state_t simcall_execution_get_state__get__result(smx_simcall_t simcall){
- return (e_smx_state_t) simcall->result.i;
-}
-static inline void simcall_execution_get_state__set__result(smx_simcall_t simcall, int result){
- simcall->result.i = result;
-}
-
static inline smx_synchro_t simcall_execution_set_priority__get__execution(smx_simcall_t simcall) {
return (smx_synchro_t) simcall->args[0].dp;
}
}
-inline static double simcall_BODY_execution_get_remains(smx_synchro_t execution) {
- smx_process_t self = SIMIX_process_self();
-
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_execution_get_remains(execution);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_EXECUTION_GET_REMAINS;
- memset(&self->simcall.result, 0, sizeof(self->simcall.result));
- memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) execution;
- if (self != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
- SIMIX_process_yield(self);
- } else {
- SIMIX_simcall_handle(&self->simcall, 0);
- }
- return (double) self->simcall.result.d;
- }
-
-inline static e_smx_state_t simcall_BODY_execution_get_state(smx_synchro_t execution) {
- smx_process_t self = SIMIX_process_self();
-
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_execution_get_state(execution);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_EXECUTION_GET_STATE;
- memset(&self->simcall.result, 0, sizeof(self->simcall.result));
- memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) execution;
- if (self != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
- SIMIX_process_yield(self);
- } else {
- SIMIX_simcall_handle(&self->simcall, 0);
- }
- return (e_smx_state_t) self->simcall.result.i;
- }
-
inline static void simcall_BODY_execution_set_priority(smx_synchro_t execution, double priority) {
smx_process_t self = SIMIX_process_self();
SIMCALL_EXECUTION_PARALLEL_START,
SIMCALL_EXECUTION_DESTROY,
SIMCALL_EXECUTION_CANCEL,
- SIMCALL_EXECUTION_GET_REMAINS,
- SIMCALL_EXECUTION_GET_STATE,
SIMCALL_EXECUTION_SET_PRIORITY,
SIMCALL_EXECUTION_SET_BOUND,
SIMCALL_EXECUTION_SET_AFFINITY,
"SIMCALL_EXECUTION_PARALLEL_START",
"SIMCALL_EXECUTION_DESTROY",
"SIMCALL_EXECUTION_CANCEL",
- "SIMCALL_EXECUTION_GET_REMAINS",
- "SIMCALL_EXECUTION_GET_STATE",
"SIMCALL_EXECUTION_SET_PRIORITY",
"SIMCALL_EXECUTION_SET_BOUND",
"SIMCALL_EXECUTION_SET_AFFINITY",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_EXECUTION_GET_REMAINS:
- simcall->result.d = SIMIX_execution_get_remains((smx_synchro_t) simcall->args[0].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
-case SIMCALL_EXECUTION_GET_STATE:
- simcall->result.i = SIMIX_execution_get_state((smx_synchro_t) simcall->args[0].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_EXECUTION_SET_PRIORITY:
SIMIX_execution_set_priority((smx_synchro_t) simcall->args[0].dp, simcall->args[1].d);
SIMIX_simcall_answer(simcall);
Func - execution_parallel_start (void*, smx_synchro_t) (name, const char*) (host_nb, int) (host_list, void*, sg_host_t*) (flops_amount, void*, double*) (bytes_amount, void*, double*) (amount, double) (rate, double)
Proc - execution_destroy (void) (execution, void*, smx_synchro_t)
Proc - execution_cancel (void) (execution, void*, smx_synchro_t)
-Func - execution_get_remains (double) (execution, void*, smx_synchro_t)
-Func - execution_get_state (int, e_smx_state_t) (execution, void*, smx_synchro_t)
Proc - execution_set_priority (void) (execution, void*, smx_synchro_t) (priority, double)
Proc - execution_set_bound (void) (execution, void*, smx_synchro_t) (bound, double)
Proc - execution_set_affinity (void) (execution, void*, smx_synchro_t) (ws, void*, sg_host_t) (mask, unsigned long)
exec->surf_exec->cancel();
}
-double SIMIX_execution_get_remains(smx_synchro_t synchro)
-{
- double result = 0.0;
- simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
-
- if (synchro->state == SIMIX_RUNNING)
- result = exec->surf_exec->getRemains();
-
- return result;
-}
-
-e_smx_state_t SIMIX_execution_get_state(smx_synchro_t synchro)
-{
- return synchro->state;
-}
-
void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority)
{
simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
double amount, double rate);
XBT_PRIVATE void SIMIX_execution_destroy(smx_synchro_t synchro);
XBT_PRIVATE void SIMIX_execution_cancel(smx_synchro_t synchro);
-XBT_PRIVATE double SIMIX_execution_get_remains(smx_synchro_t synchro);
-XBT_PRIVATE e_smx_state_t SIMIX_execution_get_state(smx_synchro_t synchro);
XBT_PRIVATE void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority);
XBT_PRIVATE void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound);
XBT_PRIVATE void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);