SimGrid
|
This section describes the task structure of MSG (m_task_t) and the functions for managing it. More...
Functions | |
m_task_t | MSG_parallel_task_create (const char *name, int host_nb, const m_host_t *host_list, double *computation_amount, double *communication_amount, void *data) |
Creates a new m_task_t (a parallel one....). | |
m_task_t | MSG_task_create (const char *name, double compute_duration, double message_size, void *data) |
Creates a new m_task_t. | |
void * | MSG_task_get_data (m_task_t task) |
Return the user data of a m_task_t. | |
void | MSG_task_set_data (m_task_t task, void *data) |
Sets the user data of a m_task_t. | |
m_process_t | MSG_task_get_sender (m_task_t task) |
Return the sender of a m_task_t. | |
m_host_t | MSG_task_get_source (m_task_t task) |
Return the source of a m_task_t. | |
const char * | MSG_task_get_name (m_task_t task) |
Return the name of a m_task_t. | |
void | MSG_task_set_name (m_task_t task, const char *name) |
Return the name of a m_task_t. | |
MSG_error_t | MSG_task_destroy (m_task_t task) |
Destroy a m_task_t. | |
MSG_error_t | MSG_task_cancel (m_task_t task) |
Cancel a m_task_t. | |
double | MSG_task_get_compute_duration (m_task_t task) |
Returns the computation amount needed to process a task m_task_t. Once a task has been processed, this amount is thus set to 0... | |
void | MSG_task_set_compute_duration (m_task_t task, double computation_amount) |
set the computation amount needed to process a task m_task_t. | |
double | MSG_task_get_remaining_computation (m_task_t task) |
Returns the remaining computation amount of a task m_task_t. | |
double | MSG_task_get_remaining_communication (m_task_t task) |
Returns the total amount received by a task m_task_t. If the communication does not exist it will return 0. So, if the communication has FINISHED or FAILED it returns zero. | |
double | MSG_task_get_data_size (m_task_t task) |
Returns the size of the data attached to a task m_task_t. | |
void | MSG_task_set_priority (m_task_t task, double priority) |
Changes the priority of a computation task. This priority doesn't affect the transfer rate. A priority of 2 will make a task receive two times more cpu power than the other ones. |
This section describes the task structure of MSG (m_task_t) and the functions for managing it.
Since most scheduling algorithms rely on a concept of task that can be either computed locally or transferred on another processor, it seems to be the right level of abstraction for our purposes. A task may then be defined by a computing amount, a message size and some private data.
m_task_t MSG_parallel_task_create | ( | const char * | name, |
int | host_nb, | ||
const m_host_t * | host_list, | ||
double * | computation_amount, | ||
double * | communication_amount, | ||
void * | data | ||
) |
Creates a new m_task_t (a parallel one....).
A constructor for m_task_t taking six arguments and returning the corresponding object.
name | a name for the object. It is for user-level information and can be NULL. |
host_nb | the number of hosts implied in the parallel task. |
host_list | an array of host_nb m_host_t. |
computation_amount | an array of host_nb doubles. computation_amount[i] is the total number of operations that have to be performed on host_list[i]. |
communication_amount | an array of host_nb* host_nb doubles. |
data | a pointer to any data may want to attach to the new object. It is for user-level information and can be NULL. It can be retrieved with the function MSG_task_get_data. |
m_task_t MSG_task_create | ( | const char * | name, |
double | compute_duration, | ||
double | message_size, | ||
void * | data | ||
) |
Creates a new m_task_t.
A constructor for m_task_t taking four arguments and returning the corresponding object.
name | a name for the object. It is for user-level information and can be NULL. |
compute_duration | a value of the processing amount (in flop) needed to process this new task. If 0, then it cannot be executed with MSG_task_execute(). This value has to be >=0. |
message_size | a value of the amount of data (in bytes) needed to transfer this new task. If 0, then it cannot be transfered with MSG_task_get() and MSG_task_put(). This value has to be >=0. |
data | a pointer to any data may want to attach to the new object. It is for user-level information and can be NULL. It can be retrieved with the function MSG_task_get_data. |
void* MSG_task_get_data | ( | m_task_t | task | ) |
Return the user data of a m_task_t.
This function checks whether task is a valid pointer or not and return the user data associated to task if it is possible.
void MSG_task_set_data | ( | m_task_t | task, |
void * | data | ||
) |
Sets the user data of a m_task_t.
This function allows to associate a new pointer to the user data associated of task.
m_process_t MSG_task_get_sender | ( | m_task_t | task | ) |
Return the sender of a m_task_t.
This functions returns the m_process_t which sent this task
const char* MSG_task_get_name | ( | m_task_t | task | ) |
void MSG_task_set_name | ( | m_task_t | task, |
const char * | name | ||
) |
Return the name of a m_task_t.
This functions allows to associate a name to a task
MSG_error_t MSG_task_destroy | ( | m_task_t | task | ) |
MSG_error_t MSG_task_cancel | ( | m_task_t | task | ) |
Cancel a m_task_t.
task | the taskt to cancel. If it was executed or transfered, it stops the process that were working on it. |
Back to the main Simgrid Documentation page |
The version of Simgrid documented here is v3.6.1. Documentation of other versions can be found in their respective archive files (directory doc/html). |
Generated for SimGridAPI by
![]() |