-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* Simulator Data specific to parallel tasks */
simdata->host_nb = host_nb;
- simdata->host_list = xbt_new0(smx_host_t, host_nb);
+ simdata->host_list = xbt_new0(sg_host_t, host_nb);
simdata->flops_parallel_amount = flops_amount;
simdata->bytes_parallel_amount = bytes_amount;
action = task->simdata->compute;
if (action)
- simcall_host_execution_destroy(action);
+ simcall_process_execution_destroy(action);
/* parallel tasks only */
xbt_free(task->simdata->host_list);
xbt_assert((task != NULL), "Cannot cancel a NULL task");
if (task->simdata->compute) {
- simcall_host_execution_cancel(task->simdata->compute);
+ simcall_process_execution_cancel(task->simdata->compute);
}
else if (task->simdata->comm) {
simdata_task_t simdata = task->simdata;
}
/** \ingroup m_task_management
- * \brief Returns the computation amount needed to process a task #msg_task_t.
+ * \brief Returns the remaining amount of flops needed to execute a task #msg_task_t.
*
* Once a task has been processed, this amount is set to 0. If you want, you
* can reset this value with #MSG_task_set_flops_amount before restarting the task.
*/
-double MSG_task_get_compute_duration(msg_task_t task)
-{
- xbt_assert((task != NULL)
- && (task->simdata != NULL), "Invalid parameter");
+double MSG_task_get_flops_amount(msg_task_t task) {
- return task->simdata->flops_amount;
+ if (task->simdata->compute) {
+ return simcall_process_execution_get_remains(task->simdata->compute);
+ } else {
+ return task->simdata->flops_amount;
+ }
}
}
-
-/** \ingroup m_task_management
- * \brief Returns the remaining computation amount of a task #msg_task_t.
- *
- * If the task is ongoing, this call retrieves the remaining amount of work.
- * If it is not ongoing, it returns the total amount of work that will be
- * executed when the task starts.
- */
-double MSG_task_get_remaining_computation(msg_task_t task)
-{
- xbt_assert((task != NULL)
- && (task->simdata != NULL), "Invalid parameter");
-
- if (task->simdata->compute) {
- return simcall_host_execution_get_remains(task->simdata->compute);
- } else {
- return task->simdata->flops_amount;
- }
-}
-
/** \ingroup m_task_management
* \brief Returns the total amount received by a task #msg_task_t.
* If the communication does not exist it will return 0.
task->simdata->priority = 1 / priority;
if (task->simdata->compute)
- simcall_host_execution_set_priority(task->simdata->compute,
+ simcall_process_execution_set_priority(task->simdata->compute,
task->simdata->priority);
}
task->simdata->bound = bound;
if (task->simdata->compute)
- simcall_host_execution_set_bound(task->simdata->compute,
+ simcall_process_execution_set_bound(task->simdata->compute,
task->simdata->bound);
}
xbt_dict_remove_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(host));
}
} else
- xbt_dict_set_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(host), (void *) mask, NULL);
+ xbt_dict_set_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(host), (void *)(uintptr_t) mask, NULL);
/* We set affinity data of this task. If the task is being executed, we
* actually change the affinity setting of the task. Otherwise, this change
/* task is being executed on this host. so change the affinity now */
{
/* check it works. remove me if it works. */
- xbt_assert((unsigned long) xbt_dict_get_or_null_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(msg_host_t)) == mask);
+ xbt_assert((unsigned long)(uintptr_t) xbt_dict_get_or_null_ext(task->simdata->affinity_mask_db, (char *) host, sizeof(msg_host_t)) == mask);
}
XBT_INFO("set affinity(0x%04lx@%s) for %s", mask, MSG_host_get_name(host), MSG_task_get_name(task));
- simcall_host_execution_set_affinity(task->simdata->compute, host, mask);
+ simcall_process_execution_set_affinity(task->simdata->compute, host, mask);
}
}