|
StarPU Handbook - StarPU Extensions
|
Data Structures | |
| struct | starpu_codelet_pack_arg_data |
Functions | |
| int | starpu_task_set (struct starpu_task *task, struct starpu_codelet *cl,...) |
| struct starpu_task * | starpu_task_build (struct starpu_codelet *cl,...) |
| int | starpu_task_insert (struct starpu_codelet *cl,...) |
| int | starpu_insert_task (struct starpu_codelet *cl,...) |
| void | starpu_task_insert_data_make_room (struct starpu_codelet *cl, struct starpu_task *task, int *allocated_buffers, int current_buffer, int room) |
| void | starpu_task_insert_data_process_arg (struct starpu_codelet *cl, struct starpu_task *task, int *allocated_buffers, int *current_buffer, int arg_type, starpu_data_handle_t handle) |
| void | starpu_task_insert_data_process_array_arg (struct starpu_codelet *cl, struct starpu_task *task, int *allocated_buffers, int *current_buffer, int nb_handles, starpu_data_handle_t *handles) |
| void | starpu_task_insert_data_process_mode_array_arg (struct starpu_codelet *cl, struct starpu_task *task, int *allocated_buffers, int *current_buffer, int nb_descrs, struct starpu_data_descr *descrs) |
| void | starpu_codelet_pack_args (void **arg_buffer, size_t *arg_buffer_size,...) |
| void | starpu_codelet_pack_arg_init (struct starpu_codelet_pack_arg_data *state) |
| void | starpu_codelet_pack_arg (struct starpu_codelet_pack_arg_data *state, const void *ptr, size_t ptr_size) |
| void | starpu_codelet_pack_arg_fini (struct starpu_codelet_pack_arg_data *state, void **cl_arg, size_t *cl_arg_size) |
| void | starpu_codelet_unpack_args (void *cl_arg,...) |
| void | starpu_codelet_unpack_arg_init (struct starpu_codelet_pack_arg_data *state, void *cl_arg, size_t cl_arg_size) |
| void | starpu_codelet_unpack_arg (struct starpu_codelet_pack_arg_data *state, void *ptr, size_t size) |
| void | starpu_codelet_dup_arg (struct starpu_codelet_pack_arg_data *state, void **ptr, size_t *size) |
| void | starpu_codelet_pick_arg (struct starpu_codelet_pack_arg_data *state, void **ptr, size_t *size) |
| void | starpu_codelet_unpack_arg_fini (struct starpu_codelet_pack_arg_data *state) |
| void | starpu_codelet_unpack_discard_arg (struct starpu_codelet_pack_arg_data *state) |
| void | starpu_codelet_unpack_args_and_copyleft (void *cl_arg, void *buffer, size_t buffer_size,...) |
| struct starpu_codelet_pack_arg_data |
Structure to be used for starpu_codelet_pack_arg_init() & co, and starpu_codelet_unpack_arg_init() & co. The contents is public, however users should not directly access it, but only use as a parameter to the appropriate functions.
| Data Fields | ||
|---|---|---|
| char * | arg_buffer | |
| size_t | arg_buffer_size | |
| size_t | arg_buffer_used | |
| size_t | current_offset | |
| int | nargs | |
| #define STARPU_VALUE |
Used when calling starpu_task_insert(), must be followed by a pointer to a constant value and the size of the constant
| #define STARPU_CALLBACK |
Used when calling starpu_task_insert(), must be followed by a pointer to a callback function
| #define STARPU_CALLBACK_WITH_ARG |
Used when calling starpu_task_insert(), must be followed by two pointers: one to a callback function, and the other to be given as an argument to the callback function; this is equivalent to using both STARPU_CALLBACK and STARPU_CALLBACK_ARG.
| #define STARPU_CALLBACK_ARG |
Used when calling starpu_task_insert(), must be followed by a pointer to be given as an argument to the callback function
| #define STARPU_PRIORITY |
Used when calling starpu_task_insert(), must be followed by a integer defining a priority level
| #define STARPU_DATA_ARRAY |
Used when calling starpu_task_insert(), must be followed by an array of handles and the number of elements in the array (as int). This is equivalent to passing the handles as separate parameters with STARPU_R, STARPU_W or STARPU_RW.
| #define STARPU_DATA_MODE_ARRAY |
Used when calling starpu_task_insert(), must be followed by an array of struct starpu_data_descr and the number of elements in the array (as int). This is equivalent to passing the handles with the corresponding modes.
| #define STARPU_TAG |
Used when calling starpu_task_insert(), must be followed by a tag.
| #define STARPU_HYPERVISOR_TAG |
Used when calling starpu_task_insert(), must be followed by a tag.
| #define STARPU_FLOPS |
Used when calling starpu_task_insert(), must be followed by an amount of floating point operations, as a double. Users MUST explicitly cast into double, otherwise parameter passing will not work.
| #define STARPU_SCHED_CTX |
Used when calling starpu_task_insert(), must be followed by the id of the scheduling context to which to submit the task to.
| #define STARPU_PROLOGUE_CALLBACK |
Used when calling starpu_task_insert(), must be followed by a pointer to a prologue callback function
| #define STARPU_PROLOGUE_CALLBACK_ARG |
Used when calling starpu_task_insert(), must be followed by a pointer to be given as an argument to the prologue callback function
| #define STARPU_PROLOGUE_CALLBACK_POP |
Used when calling starpu_task_insert(), must be followed by a pointer to a prologue callback pop function
| #define STARPU_PROLOGUE_CALLBACK_POP_ARG |
Used when calling starpu_task_insert(), must be followed by a pointer to be given as an argument to the prologue callback pop function
| #define STARPU_EXECUTE_ON_WORKER |
Used when calling starpu_task_insert(), must be followed by an integer value specifying the worker on which to execute the task (as specified by starpu_task::execute_on_a_specific_worker)
| #define STARPU_EXECUTE_WHERE |
Used when calling starpu_task_insert(), must be followed by an unsigned long long value specifying the mask of worker on which to execute the task (as specified by starpu_task::where)
| #define STARPU_TAG_ONLY |
Used when calling starpu_task_insert(), must be followed by a tag stored in starpu_task::tag_id. Leave starpu_task::use_tag as 0.
| #define STARPU_POSSIBLY_PARALLEL |
Used when calling starpu_task_insert(), must be followed by an unsigned stored in starpu_task::possibly_parallel.
| #define STARPU_WORKER_ORDER |
used when calling starpu_task_insert(), must be followed by an integer value specifying the worker order in which to execute the tasks (as specified by starpu_task::workerorder)
| #define STARPU_NAME |
Used when calling starpu_task_insert(), must be followed by a char * stored in starpu_task::name.
| #define STARPU_CL_ARGS |
Used when calling starpu_task_insert(), must be followed by a memory buffer containing the arguments to be given to the task, and by the size of the arguments. The memory buffer should be the result of a previous call to starpu_codelet_pack_args(), and will be freed (i.e. starpu_task::cl_arg_free will be set to 1)
| #define STARPU_CL_ARGS_NFREE |
Used when calling starpu_task_insert(), similarly to STARPU_CL_ARGS, must be followed by a memory buffer containing the arguments to be given to the task, and by the size of the arguments. The memory buffer should be the result of a previous call to starpu_codelet_pack_args(), and will NOT be freed (i.e. starpu_task::cl_arg_free will be set to 0)
| #define STARPU_TASK_DEPS_ARRAY |
Used when calling starpu_task_insert(), must be followed by a number of tasks as int, and an array containing these tasks. The function starpu_task_declare_deps_array() will be called with the given values.
| #define STARPU_TASK_COLOR |
Used when calling starpu_task_insert(), must be followed by an integer representing a color
| #define STARPU_HANDLES_SEQUENTIAL_CONSISTENCY |
Used when calling starpu_task_insert(), must be followed by an array of characters representing the sequential consistency for each buffer of the task.
| #define STARPU_TASK_SYNCHRONOUS |
Used when calling starpu_task_insert(), must be followed by an integer stating if the task is synchronous or not
| #define STARPU_TASK_END_DEPS_ARRAY |
Used when calling starpu_task_insert(), must be followed by a number of tasks as int, and an array containing these tasks. The function starpu_task_declare_end_deps_array() will be called with the given values.
| #define STARPU_TASK_END_DEP |
Used when calling starpu_task_insert(), must be followed by an integer which will be given to starpu_task_end_dep_add()
| #define STARPU_TASK_WORKERIDS |
Used when calling starpu_task_insert(), must be followed by an unsigned being a number of workers, and an array of bits which size is the number of workers, the array indicates the set of workers which are allowed to execute the task.
| #define STARPU_SEQUENTIAL_CONSISTENCY |
Used when calling starpu_task_insert(), must be followed by an unsigned which sets the sequential consistency for the data parameters of the task.
| #define STARPU_TASK_PROFILING_INFO |
Used when calling starpu_task_insert() and alike, must be followed by a pointer to a struct starpu_profiling_task_info
| #define STARPU_TASK_NO_SUBMITORDER |
Used when calling starpu_task_insert() and alike, must be followed by an unsigned specifying not to allocate a submitorder id for the task
| #define STARPU_CALLBACK_ARG_NFREE |
Used when calling starpu_task_insert(), similarly to STARPU_CALLBACK_ARG, must be followed by a pointer to be given as an argument to the callback function, the argument will not be freed, i.e starpu_task::callback_arg_free will be set to 0
| #define STARPU_CALLBACK_WITH_ARG_NFREE |
Used when calling starpu_task_insert(), similarly to STARPU_CALLBACK_WITH_ARG, must be followed by two pointers: one to a callback function, and the other to be given as an argument to the callback function; this is equivalent to using both STARPU_CALLBACK and STARPU_CALLBACK_ARG_NFREE.
| #define STARPU_PROLOGUE_CALLBACK_ARG_NFREE |
Used when calling starpu_task_insert(), similarly to STARPU_PROLOGUE_CALLBACK_ARG, must be followed by a pointer to be given as an argument to the prologue callback function, the argument will not be freed, i.e starpu_task::prologue_callback_arg_free will be set to 0
| #define STARPU_PROLOGUE_CALLBACK_POP_ARG_NFREE |
Used when calling starpu_task_insert(), similarly to STARPU_PROLOGUE_CALLBACK_POP_ARG, must be followed by a pointer to be given as an argument to the prologue callback pop function, the argument will not be freed, i.e starpu_task::prologue_callback_pop_arg_free will be set to 0
| #define STARPU_TASK_SCHED_DATA |
Used when calling starpu_task_insert() and alike, must be followed by a void* specifying the value to be set in starpu_task::sched_data
| #define STARPU_TRANSACTION |
Used when calling starpu_task_insert() and alike, must be followed by a struct starpu_transaction * specifying the value to be set in the transaction field of the task.
| #define STARPU_TASK_FILE |
Used when calling starpu_task_insert(), must be followed by a char * stored in starpu_task::file.
This is automatically set when FXT is enabled.
| #define STARPU_TASK_LINE |
Used when calling starpu_task_insert(), must be followed by an int stored in starpu_task::line.
This is automatically set when FXT is enabled.
| #define STARPU_EPILOGUE_CALLBACK |
Used when calling starpu_task_insert(), must be followed by a pointer to a epilogue callback function
| #define STARPU_EPILOGUE_CALLBACK_ARG |
Used when calling starpu_task_insert(), must be followed by a pointer to be given as an argument to the epilogue callback function
| #define STARPU_SHIFTED_MODE_MAX |
This has to be the last mode value plus 1
| int starpu_task_set | ( | struct starpu_task * | task, |
| struct starpu_codelet * | cl, | ||
| ... | |||
| ) |
Set the given task corresponding to cl with the following arguments. The argument list must be zero-terminated. The arguments following the codelet are the same as the ones for the function starpu_task_insert(). If some arguments of type STARPU_VALUE are given, the parameter starpu_task::cl_arg_free will be set to 1. See OtherTaskUtility for more details.
| struct starpu_task * starpu_task_build | ( | struct starpu_codelet * | cl, |
| ... | |||
| ) |
Create a task corresponding to cl with the following arguments. The argument list must be zero-terminated. The arguments following the codelet are the same as the ones for the function starpu_task_insert(). If some arguments of type STARPU_VALUE are given, the parameter starpu_task::cl_arg_free will be set to 1. See OtherTaskUtility for more details.
| int starpu_task_insert | ( | struct starpu_codelet * | cl, |
| ... | |||
| ) |
Create and submit a task corresponding to cl with the following given arguments. The argument list must be zero-terminated.
The arguments following the codelet can be of the following types:
When using STARPU_DATA_ARRAY, the access mode of the data handles is not defined, it will be taken from the codelet starpu_codelet::modes or starpu_codelet::dyn_modes field. One should use STARPU_DATA_MODE_ARRAY to define the data handles along with the access modes.
Parameters to be passed to the codelet implementation are defined through the type STARPU_VALUE. The function starpu_codelet_unpack_args() must be called within the codelet implementation to retrieve them.
See InsertTaskUtility for more details.
| int starpu_insert_task | ( | struct starpu_codelet * | cl, |
| ... | |||
| ) |
Identical to starpu_task_insert(). Kept to avoid breaking old codes.
| void starpu_task_insert_data_make_room | ( | struct starpu_codelet * | cl, |
| struct starpu_task * | task, | ||
| int * | allocated_buffers, | ||
| int | current_buffer, | ||
| int | room | ||
| ) |
Assuming that there are already current_buffer data handles passed to the task, and if *allocated_buffers is not 0, the task->dyn_handles array has size *allocated_buffers, this function makes room for room other data handles, allocating or reallocating task->dyn_handles as necessary and updating allocated_buffers accordingly. One can thus start with allocated_buffers equal to 0 and current_buffer equal to 0, then make room by calling this function, then store handles with STARPU_TASK_SET_HANDLE(), make room again with this function, store yet more handles, etc. See OtherTaskUtility for more details.
| void starpu_task_insert_data_process_arg | ( | struct starpu_codelet * | cl, |
| struct starpu_task * | task, | ||
| int * | allocated_buffers, | ||
| int * | current_buffer, | ||
| int | arg_type, | ||
| starpu_data_handle_t | handle | ||
| ) |
Store data handle handle into task task with mode arg_type, updating *allocated_buffers and *current_buffer accordingly. See OtherTaskUtility for more details.
| void starpu_task_insert_data_process_array_arg | ( | struct starpu_codelet * | cl, |
| struct starpu_task * | task, | ||
| int * | allocated_buffers, | ||
| int * | current_buffer, | ||
| int | nb_handles, | ||
| starpu_data_handle_t * | handles | ||
| ) |
Store nb_handles data handles handles into task task, updating *allocated_buffers and *current_buffer accordingly. See OtherTaskUtility for more details.
| void starpu_task_insert_data_process_mode_array_arg | ( | struct starpu_codelet * | cl, |
| struct starpu_task * | task, | ||
| int * | allocated_buffers, | ||
| int * | current_buffer, | ||
| int | nb_descrs, | ||
| struct starpu_data_descr * | descrs | ||
| ) |
Store nb_descrs data handles described by descrs into task task, updating *allocated_buffers and *current_buffer accordingly. See OtherTaskUtility for more details.
| void starpu_codelet_pack_args | ( | void ** | arg_buffer, |
| size_t * | arg_buffer_size, | ||
| ... | |||
| ) |
Pack arguments of type STARPU_VALUE into a buffer which can be given to a codelet and later unpacked with the function starpu_codelet_unpack_args().
Instead of calling starpu_codelet_pack_args(), one can also call starpu_codelet_pack_arg_init(), then starpu_codelet_pack_arg() for each data, then starpu_codelet_pack_arg_fini().
See InsertTaskUtility for more details.
| void starpu_codelet_pack_arg_init | ( | struct starpu_codelet_pack_arg_data * | state | ) |
Initialize struct starpu_codelet_pack_arg before calling starpu_codelet_pack_arg() and starpu_codelet_pack_arg_fini(). This will simply initialize the content of the structure. See InsertTaskUtility for more details.
| void starpu_codelet_pack_arg | ( | struct starpu_codelet_pack_arg_data * | state, |
| const void * | ptr, | ||
| size_t | ptr_size | ||
| ) |
Pack one argument into struct starpu_codelet_pack_arg state. That structure has to be initialized before with starpu_codelet_pack_arg_init(), and after all starpu_codelet_pack_arg() calls performed, starpu_codelet_pack_arg_fini() has to be used to get the cl_arg and cl_arg_size to be put in the task. See InsertTaskUtility for more details.
| void starpu_codelet_pack_arg_fini | ( | struct starpu_codelet_pack_arg_data * | state, |
| void ** | cl_arg, | ||
| size_t * | cl_arg_size | ||
| ) |
Finish packing data, after calling starpu_codelet_pack_arg_init() once and starpu_codelet_pack_arg() several times. See InsertTaskUtility for more details.
| void starpu_codelet_unpack_args | ( | void * | cl_arg, |
| ... | |||
| ) |
Retrieve the arguments of type STARPU_VALUE associated to a task automatically created using the function starpu_task_insert(). If any parameter's value is 0, unpacking will stop there and ignore the remaining parameters. See InsertTaskUtility for more details.
| void starpu_codelet_unpack_arg_init | ( | struct starpu_codelet_pack_arg_data * | state, |
| void * | cl_arg, | ||
| size_t | cl_arg_size | ||
| ) |
Initialize state with cl_arg and cl_arg_size. This has to be called before calling starpu_codelet_unpack_arg(). See InsertTaskUtility for more details.
| void starpu_codelet_unpack_arg | ( | struct starpu_codelet_pack_arg_data * | state, |
| void * | ptr, | ||
| size_t | size | ||
| ) |
Unpack the next argument of size size from state into ptr with a copy. state has to be initialized before with starpu_codelet_unpack_arg_init(). See InsertTaskUtility for more details.
| void starpu_codelet_dup_arg | ( | struct starpu_codelet_pack_arg_data * | state, |
| void ** | ptr, | ||
| size_t * | size | ||
| ) |
Unpack the next argument of unknown size from state into ptr with a copy. ptr is allocated before copying in it the value of the argument. The size of the argument is returned in size. has to be initialized before with starpu_codelet_unpack_arg_init(). See InsertTaskUtility for more details.
| void starpu_codelet_pick_arg | ( | struct starpu_codelet_pack_arg_data * | state, |
| void ** | ptr, | ||
| size_t * | size | ||
| ) |
Unpack the next argument of unknown size from state into ptr. ptr will be a pointer to the memory of the argument. The size of the argument is returned in size. has to be initialized before with starpu_codelet_unpack_arg_init(). See InsertTaskUtility for more details.
| void starpu_codelet_unpack_arg_fini | ( | struct starpu_codelet_pack_arg_data * | state | ) |
Finish unpacking data, after calling starpu_codelet_unpack_arg_init() once and starpu_codelet_unpack_arg() or starpu_codelet_dup_arg() or starpu_codelet_pick_arg() several times. See InsertTaskUtility for more details.
| void starpu_codelet_unpack_discard_arg | ( | struct starpu_codelet_pack_arg_data * | state | ) |
Call this function during unpacking to skip saving the argument in ptr. See InsertTaskUtility for more details.
| void starpu_codelet_unpack_args_and_copyleft | ( | void * | cl_arg, |
| void * | buffer, | ||
| size_t | buffer_size, | ||
| ... | |||
| ) |
Similar to starpu_codelet_unpack_args(), but if any parameter is 0, copy the part of cl_arg that has not been read in buffer which can then be used in a later call to one of the unpack functions. See InsertTaskUtility for more details.