StarPU Handbook - StarPU Language Bindings
|
Data Structures | |
struct | starpu_sched_component |
struct | starpu_sched_tree |
struct | starpu_sched_component_fifo_data |
struct | starpu_sched_component_prio_data |
struct | starpu_sched_component_mct_data |
struct | starpu_sched_component_heteroprio_data |
struct | starpu_sched_component_perfmodel_select_data |
struct | starpu_sched_component_specs |
Macros | |
#define | STARPU_SCHED_COMPONENT_IS_HOMOGENEOUS(component) |
#define | STARPU_SCHED_COMPONENT_IS_SINGLE_MEMORY_NODE(component) |
#define | STARPU_COMPONENT_MUTEX_LOCK(m) |
#define | STARPU_COMPONENT_MUTEX_TRYLOCK(m) |
#define | STARPU_COMPONENT_MUTEX_UNLOCK(m) |
Enumerations | |
enum | starpu_sched_component_properties { STARPU_SCHED_COMPONENT_HOMOGENEOUS , STARPU_SCHED_COMPONENT_SINGLE_MEMORY_NODE } |
Worker Component API | |
struct starpu_sched_component * | starpu_sched_component_worker_get (unsigned sched_ctx, int workerid) |
struct starpu_sched_component * | starpu_sched_component_worker_new (unsigned sched_ctx, int workerid) |
struct starpu_sched_component * | starpu_sched_component_parallel_worker_create (struct starpu_sched_tree *tree, unsigned nworkers, unsigned *workers) |
int | starpu_sched_component_worker_get_workerid (struct starpu_sched_component *worker_component) |
int | starpu_sched_component_is_worker (struct starpu_sched_component *component) |
int | starpu_sched_component_is_simple_worker (struct starpu_sched_component *component) |
int | starpu_sched_component_is_combined_worker (struct starpu_sched_component *component) |
void | starpu_sched_component_worker_pre_exec_hook (struct starpu_task *task, unsigned sched_ctx_id) |
void | starpu_sched_component_worker_post_exec_hook (struct starpu_task *task, unsigned sched_ctx_id) |
Flow-control Prio Component API | |
struct starpu_sched_component * | starpu_sched_component_prio_create (struct starpu_sched_tree *tree, struct starpu_sched_component_prio_data *prio_data) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_prio (struct starpu_sched_component *component) |
Resource-mapping Work-Stealing Component API | |
struct starpu_sched_component * | starpu_sched_component_work_stealing_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_work_stealing (struct starpu_sched_component *component) |
int | starpu_sched_tree_work_stealing_push_task (struct starpu_task *task) |
Resource-mapping Random Component API | |
struct starpu_sched_component * | starpu_sched_component_random_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_random (struct starpu_sched_component *) |
Resource-mapping Eager Component API | |
struct starpu_sched_component * | starpu_sched_component_eager_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_eager (struct starpu_sched_component *) |
Resource-mapping Eager Prio Component API | |
struct starpu_sched_component * | starpu_sched_component_eager_prio_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_eager_prio (struct starpu_sched_component *) |
Resource-mapping Eager-Calibration Component API | |
struct starpu_sched_component * | starpu_sched_component_eager_calibration_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_eager_calibration (struct starpu_sched_component *) |
Resource-mapping MCT Component API | |
struct starpu_sched_component * | starpu_sched_component_mct_create (struct starpu_sched_tree *tree, struct starpu_sched_component_mct_data *mct_data) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_mct (struct starpu_sched_component *component) |
Resource-mapping Heft Component API | |
struct starpu_sched_component * | starpu_sched_component_heft_create (struct starpu_sched_tree *tree, struct starpu_sched_component_mct_data *mct_data) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_heft (struct starpu_sched_component *component) |
Resource-mapping Heteroprio Component API | |
struct starpu_sched_component * | starpu_sched_component_heteroprio_create (struct starpu_sched_tree *tree, struct starpu_sched_component_heteroprio_data *params) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_heteroprio (struct starpu_sched_component *component) |
Special-purpose Best_Implementation Component API | |
struct starpu_sched_component * | starpu_sched_component_best_implementation_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
Special-purpose Perfmodel_Select Component API | |
struct starpu_sched_component * | starpu_sched_component_perfmodel_select_create (struct starpu_sched_tree *tree, struct starpu_sched_component_perfmodel_select_data *perfmodel_select_data) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_perfmodel_select (struct starpu_sched_component *component) |
Staged pull Component API | |
struct starpu_sched_component * | starpu_sched_component_stage_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_stage (struct starpu_sched_component *component) |
User-choice push Component API | |
struct starpu_sched_component * | starpu_sched_component_userchoice_create (struct starpu_sched_tree *tree, void *arg) STARPU_ATTRIBUTE_MALLOC |
int | starpu_sched_component_is_userchoice (struct starpu_sched_component *component) |
Recipe Component API | |
struct starpu_sched_component_composed_recipe * | starpu_sched_component_composed_recipe_create (void) STARPU_ATTRIBUTE_MALLOC |
struct starpu_sched_component_composed_recipe * | starpu_sched_component_composed_recipe_create_singleton (struct starpu_sched_component *(*create_component)(struct starpu_sched_tree *tree, void *arg), void *arg) STARPU_ATTRIBUTE_MALLOC |
void | starpu_sched_component_composed_recipe_add (struct starpu_sched_component_composed_recipe *recipe, struct starpu_sched_component *(*create_component)(struct starpu_sched_tree *tree, void *arg), void *arg) |
void | starpu_sched_component_composed_recipe_destroy (struct starpu_sched_component_composed_recipe *) |
struct starpu_sched_component * | starpu_sched_component_composed_component_create (struct starpu_sched_tree *tree, struct starpu_sched_component_composed_recipe *recipe) STARPU_ATTRIBUTE_MALLOC |
struct starpu_sched_tree * | starpu_sched_component_make_scheduler (unsigned sched_ctx_id, struct starpu_sched_component_specs s) |
Basic API | |
void | starpu_sched_component_initialize_simple_scheduler (starpu_sched_component_create_t create_decision_component, void *data, unsigned flags, unsigned sched_ctx_id) |
void | starpu_sched_component_initialize_simple_schedulers (unsigned sched_ctx_id, unsigned ndecisions,...) |
#define | STARPU_SCHED_SIMPLE_DECIDE_MASK |
#define | STARPU_SCHED_SIMPLE_DECIDE_WORKERS |
#define | STARPU_SCHED_SIMPLE_DECIDE_MEMNODES |
#define | STARPU_SCHED_SIMPLE_DECIDE_ARCHS |
#define | STARPU_SCHED_SIMPLE_DECIDE_ALWAYS |
#define | STARPU_SCHED_SIMPLE_PERFMODEL |
#define | STARPU_SCHED_SIMPLE_IMPL |
#define | STARPU_SCHED_SIMPLE_FIFO_ABOVE |
#define | STARPU_SCHED_SIMPLE_FIFO_ABOVE_PRIO |
#define | STARPU_SCHED_SIMPLE_FIFOS_BELOW |
#define | STARPU_SCHED_SIMPLE_FIFOS_BELOW_PRIO |
#define | STARPU_SCHED_SIMPLE_FIFOS_BELOW_READY |
#define | STARPU_SCHED_SIMPLE_WS_BELOW |
#define | STARPU_SCHED_SIMPLE_COMBINED_WORKERS |
#define | STARPU_SCHED_SIMPLE_FIFOS_BELOW_EXP |
#define | STARPU_SCHED_SIMPLE_PRE_DECISION |
struct starpu_sched_component |
Structure for a scheduler module. A scheduler is a tree-like structure of them, some parts of scheduler can be shared by several contexes to perform some local optimisations, so, for all components, a list of parent is defined by sched_ctx_id
. They embed there specialised method in a pseudo object-style, so calls are like component->push_task(component,task)
struct starpu_sched_tree* starpu_sched_component::tree |
The tree containing the component
struct starpu_bitmap starpu_sched_component::workers |
set of underlying workers
struct starpu_bitmap starpu_sched_component::workers_in_ctx |
subset of starpu_sched_component::workers that is currently available in the context The push method should take this value into account, it is set with: component->workers UNION tree->workers UNION component->child[i]->workers_in_ctx iff exist x such as component->children[i]->parents[x] == component
void* starpu_sched_component::data |
private data
unsigned starpu_sched_component::nchildren |
number of compoments's children
struct starpu_sched_component** starpu_sched_component::children |
vector of component's children
unsigned starpu_sched_component::nparents |
number of component's parents
struct starpu_sched_component** starpu_sched_component::parents |
vector of component's parents
void(* starpu_sched_component::add_child) (struct starpu_sched_component *component, struct starpu_sched_component *child) |
add a child to component
void(* starpu_sched_component::remove_child) (struct starpu_sched_component *component, struct starpu_sched_component *child) |
remove a child from component
int(* starpu_sched_component::push_task) (struct starpu_sched_component *, struct starpu_task *) |
push a task in the scheduler module. this function is called to push a task on component subtree, this can either perform a recursive call on a child or store the task in the component, then it will be returned by a further pull_task call. the caller must ensure that component is able to execute task. This method must either return 0 if it the task was properly stored or passed over to a child component, or return a value different from 0 if the task could not be consumed (e.g. the queue is full).
struct starpu_task *(* starpu_sched_component::pull_task) (struct starpu_sched_component *from, struct starpu_sched_component *to) |
pop a task from the scheduler module. this function is called by workers to get a task from their parents. this function should first return a locally stored task or perform a recursive call on the parents. the task returned by this function should be executable by the caller
int(* starpu_sched_component::can_push) (struct starpu_sched_component *from, struct starpu_sched_component *to) |
This function is called by a component which implements a queue, allowing it to signify to its parents that an empty slot is available in its queue. This should return 1 if some tasks could be pushed The basic implementation of this function is a recursive call to its parents, the user has to specify a personally-made function to catch those calls.
int(* starpu_sched_component::can_pull) (struct starpu_sched_component *component) |
This function allow a component to wake up a worker. It is currently called by component which implements a queue, to signify to its children that a task have been pushed in its local queue, and is available to be popped by a worker, for example. This should return 1 if some some container or worker could (or will) pull some tasks. The basic implementation of this function is a recursive call to its children, until at least one worker have been woken up.
void(* starpu_sched_component::do_schedule) (struct starpu_sched_component *component) |
This function is called when starpu_do_schedule() is called by the application.
double(* starpu_sched_component::estimated_load) (struct starpu_sched_component *component) |
heuristic to compute load of scheduler module. Basically the number of tasks divided by the sum of relatives speedup of workers available in context. estimated_load(component) = sum(estimated_load(component_children)) + nb_local_tasks / average(relative_speedup(underlying_worker))
double(* starpu_sched_component::estimated_end) (struct starpu_sched_component *component) |
return the time when a worker will enter in starvation. This function is relevant only if the task->predicted member has been set.
void(* starpu_sched_component::deinit_data) (struct starpu_sched_component *component) |
called by starpu_sched_component_destroy. Should free data allocated during creation
void(* starpu_sched_component::notify_change_workers) (struct starpu_sched_component *component) |
this function is called for each component when workers are added or removed from a context
hwloc_obj_t starpu_sched_component::obj |
the hwloc object associated to scheduler module. points to the part of topology that is binded to this component, eg: a numa node for a ws component that would balance load between underlying sockets
struct starpu_sched_tree |
The actual scheduler
Data Fields | ||
---|---|---|
struct starpu_sched_component * | root |
entry module of the scheduler |
struct starpu_bitmap | workers |
set of workers available in this context, this value is used to mask workers in modules |
unsigned | sched_ctx_id |
context id of the scheduler |
starpu_pthread_mutex_t | lock |
lock used to protect the scheduler, it is taken in read mode pushing a task and in write mode for adding or removing workers |
struct starpu_sched_component_fifo_data |
struct starpu_sched_component_prio_data |
struct starpu_sched_component_mct_data |
struct starpu_sched_component_heteroprio_data |
todo
Data Fields | ||
---|---|---|
struct starpu_sched_component_mct_data * | mct | |
unsigned | batch |
struct starpu_sched_component_perfmodel_select_data |
todo
Data Fields | ||
---|---|---|
struct starpu_sched_component * | calibrator_component | |
struct starpu_sched_component * | no_perfmodel_component | |
struct starpu_sched_component * | perfmodel_component |
struct starpu_sched_component_specs |
Define how build a scheduler according to topology. Each level (except for hwloc_machine_composed_sched_component) can be NULL
, then the level is just skipped. Bugs everywhere, do not rely on.
Data Fields | |
struct starpu_sched_component_composed_recipe * | hwloc_machine_composed_sched_component |
struct starpu_sched_component_composed_recipe * | hwloc_component_composed_sched_component |
struct starpu_sched_component_composed_recipe * | hwloc_socket_composed_sched_component |
struct starpu_sched_component_composed_recipe * | hwloc_cache_composed_sched_component |
struct starpu_sched_component_composed_recipe *(* | worker_composed_sched_component )(enum starpu_worker_archtype archtype) |
int | mix_heterogeneous_workers |
struct starpu_sched_component_composed_recipe* starpu_sched_component_specs::hwloc_machine_composed_sched_component |
the composed component to put on the top of the scheduler this member must not be NULL
as it is the root of the topology
struct starpu_sched_component_composed_recipe* starpu_sched_component_specs::hwloc_component_composed_sched_component |
the composed component to put for each memory component
struct starpu_sched_component_composed_recipe* starpu_sched_component_specs::hwloc_socket_composed_sched_component |
the composed component to put for each socket
struct starpu_sched_component_composed_recipe* starpu_sched_component_specs::hwloc_cache_composed_sched_component |
the composed component to put for each cache
struct starpu_sched_component_composed_recipe *(* starpu_sched_component_specs::worker_composed_sched_component) (enum starpu_worker_archtype archtype) |
a function that return a starpu_sched_component_composed_recipe to put on top of a worker of type archtype
. NULL
is a valid return value, then no component will be added on top
int starpu_sched_component_specs::mix_heterogeneous_workers |
this flag is a dirty hack because of the poor expressivity of this interface. As example, if you want to build a heft component with a fifo component per numa component, and you also have GPUs, if this flag is set, GPUs will share those fifos. If this flag is not set, a new fifo will be built for each of them (if they have the same starpu_perf_arch and the same numa component it will be shared. it indicates if heterogeneous workers should be brothers or cousins, as example, if a gpu and a cpu should share or not there numa node
#define STARPU_SCHED_COMPONENT_IS_HOMOGENEOUS | ( | component | ) |
indicate if component is homogeneous
#define STARPU_SCHED_COMPONENT_IS_SINGLE_MEMORY_NODE | ( | component | ) |
indicate if all workers have the same memory component
#define STARPU_SCHED_SIMPLE_DECIDE_WORKERS |
Request to create downstream queues per worker, i.e. the scheduling decision-making component will choose exactly which workers tasks should got to.
#define STARPU_SCHED_SIMPLE_DECIDE_MEMNODES |
Request to create downstream queues per memory nodes, i.e. the scheduling decision-making component will choose which memory node tasks will go to.
#define STARPU_SCHED_SIMPLE_DECIDE_ARCHS |
Request to create downstream queues per computation arch, i.e. the scheduling decision-making component will choose whether tasks go to CPUs, or CUDA, or OpenCL, etc.
#define STARPU_SCHED_SIMPLE_DECIDE_ALWAYS |
Request to create the scheduling decision-making component even if there is only one available choice. This is useful for instance when the decision-making component will store tasks itself (and not use STARPU_SCHED_SIMPLE_FIFO_ABOVE) to decide in which order tasks should be passed below.
#define STARPU_SCHED_SIMPLE_PERFMODEL |
Request to add a perfmodel selector above the scheduling decision-making component. That way, only tasks with a calibrated performance model will be given to the component, other tasks will go to an eager branch that will distributed tasks so that their performance models will get calibrated. In other words, this is needed when using a component which needs performance models for tasks.
#define STARPU_SCHED_SIMPLE_IMPL |
Request that a component be added just above workers, that chooses the best task implementation.
#define STARPU_SCHED_SIMPLE_FIFO_ABOVE |
Request to create a fifo above the scheduling decision-making component, otherwise tasks will be pushed directly to the component.
This is useful to store tasks if there is a fifo below which limits the number of tasks to be scheduld in advance. The scheduling decision-making component can also store tasks itself, in which case this flag is not useful.
#define STARPU_SCHED_SIMPLE_FIFO_ABOVE_PRIO |
Request that the fifo above be sorted by priorities
#define STARPU_SCHED_SIMPLE_FIFOS_BELOW |
Request to create fifos below the scheduling decision-making component, otherwise tasks will be pulled directly from workers.
This is useful to be able to schedule a (tunable) small number of tasks in advance only.
#define STARPU_SCHED_SIMPLE_FIFOS_BELOW_PRIO |
Request that the fifos below be sorted by priorities
#define STARPU_SCHED_SIMPLE_FIFOS_BELOW_READY |
Request that the fifos below be pulled rather ready tasks
#define STARPU_SCHED_SIMPLE_WS_BELOW |
Request that work between workers using the same fifo below be distributed using a work stealing component.
#define STARPU_SCHED_SIMPLE_COMBINED_WORKERS |
Request to not only choose between simple workers, but also choose between combined workers.
#define STARPU_SCHED_SIMPLE_FIFOS_BELOW_EXP |
Request that the fifos below keep track of expected duration, start and end time of theirs elements
#define STARPU_SCHED_SIMPLE_PRE_DECISION |
Request to prepend a component before the decision component. This should be used alone and followed by the component creation function pointer and its data.
struct starpu_sched_tree * starpu_sched_tree_create | ( | unsigned | sched_ctx_id | ) |
create a empty initialized starpu_sched_tree. See ImplementAModularizedScheduler for more details.
void starpu_sched_tree_destroy | ( | struct starpu_sched_tree * | tree | ) |
destroy tree and free all non shared component in it. See ImplementAModularizedScheduler for more details.
void starpu_sched_tree_deinitialize | ( | unsigned | sched_ctx_id | ) |
calls starpu_sched_tree_destroy, ready for use for starpu_sched_policy::deinit_sched field. See ImplementAModularizedScheduler for more details.
struct starpu_sched_tree * starpu_sched_tree_get | ( | unsigned | sched_ctx_id | ) |
See ImplementAModularizedScheduler for more details.
void starpu_sched_tree_update_workers | ( | struct starpu_sched_tree * | t | ) |
recursively set all starpu_sched_component::workers, do not take into account shared parts (except workers). See ImplementAModularizedScheduler for more details.
void starpu_sched_tree_update_workers_in_ctx | ( | struct starpu_sched_tree * | t | ) |
recursively set all starpu_sched_component::workers_in_ctx, do not take into account shared parts (except workers) See ImplementAModularizedScheduler for more details.
int starpu_sched_tree_push_task | ( | struct starpu_task * | task | ) |
compatibility with starpu_sched_policy interface. See ImplementAModularizedScheduler for more details.
struct starpu_task * starpu_sched_tree_pop_task | ( | unsigned | sched_ctx | ) |
compatibility with starpu_sched_policy interface. See ImplementAModularizedScheduler for more details.
int starpu_sched_component_push_task | ( | struct starpu_sched_component * | from, |
struct starpu_sched_component * | to, | ||
struct starpu_task * | task | ||
) |
Push a task to a component. This is a helper for component->push_task(component, task)
plus tracing.
struct starpu_task * starpu_sched_component_pull_task | ( | struct starpu_sched_component * | from, |
struct starpu_sched_component * | to | ||
) |
Pull a task from a component. This is a helper for component->pull_task(component)
plus tracing.
void starpu_sched_tree_add_workers | ( | unsigned | sched_ctx_id, |
int * | workerids, | ||
unsigned | nworkers | ||
) |
compatibility with starpu_sched_policy interface
void starpu_sched_tree_remove_workers | ( | unsigned | sched_ctx_id, |
int * | workerids, | ||
unsigned | nworkers | ||
) |
compatibility with starpu_sched_policy interface
void starpu_sched_tree_do_schedule | ( | unsigned | sched_ctx_id | ) |
Run the do_schedule method of the components. This is a helper for starpu_sched_policy::do_schedule.
void starpu_sched_component_connect | ( | struct starpu_sched_component * | parent, |
struct starpu_sched_component * | child | ||
) |
Attach component child
to parent parent
. Some component may accept only one child, others accept several (e.g. MCT)
struct starpu_sched_component * starpu_sched_component_create | ( | struct starpu_sched_tree * | tree, |
const char * | name | ||
) |
allocate and initialize component field with defaults values : .pop_task make recursive call on father .estimated_load compute relative speedup and tasks in sub tree .estimated_end return the minimum of recursive call on children .add_child is starpu_sched_component_add_child .remove_child is starpu_sched_component_remove_child .notify_change_workers does nothing .deinit_data does nothing
void starpu_sched_component_destroy | ( | struct starpu_sched_component * | component | ) |
free data allocated by starpu_sched_component_create and call component->deinit_data(component) set to NULL
the member starpu_sched_component::fathers[sched_ctx_id] of all child if its equal to component
void starpu_sched_component_destroy_rec | ( | struct starpu_sched_component * | component | ) |
recursively destroy non shared parts of a component
's tree
int starpu_sched_component_can_execute_task | ( | struct starpu_sched_component * | component, |
struct starpu_task * | task | ||
) |
return true iff component
can execute task
, this function take into account the workers available in the scheduling context
int starpu_sched_component_execute_preds | ( | struct starpu_sched_component * | component, |
struct starpu_task * | task, | ||
double * | length | ||
) |
return a non NULL
value if component
can execute task
. write the execution prediction length for the best implementation of the best worker available and write this at length
address. this result is more relevant if starpu_sched_component::is_homogeneous is non NULL
. if a worker need to be calibrated for an implementation, nan is set to length
.
double starpu_sched_component_transfer_length | ( | struct starpu_sched_component * | component, |
struct starpu_task * | task | ||
) |
return the average time to transfer task
data to underlying component
workers.
struct starpu_sched_component * starpu_sched_component_worker_get | ( | unsigned | sched_ctx, |
int | workerid | ||
) |
return the struct starpu_sched_component corresponding to workerid
. Undefined if workerid
is not a valid workerid
struct starpu_sched_component * starpu_sched_component_parallel_worker_create | ( | struct starpu_sched_tree * | tree, |
unsigned | nworkers, | ||
unsigned * | workers | ||
) |
Create a combined worker that pushes tasks in parallel to workers workers
(size nworkers
).
int starpu_sched_component_worker_get_workerid | ( | struct starpu_sched_component * | worker_component | ) |
return the workerid of worker_component
, undefined if starpu_sched_component_is_worker(worker_component) == 0
int starpu_sched_component_is_worker | ( | struct starpu_sched_component * | component | ) |
return true iff component
is a worker component
int starpu_sched_component_is_simple_worker | ( | struct starpu_sched_component * | component | ) |
return true iff component
is a simple worker component
int starpu_sched_component_is_combined_worker | ( | struct starpu_sched_component * | component | ) |
return true iff component
is a combined worker component
void starpu_sched_component_worker_pre_exec_hook | ( | struct starpu_task * | task, |
unsigned | sched_ctx_id | ||
) |
compatibility with starpu_sched_policy interface update predictions for workers
void starpu_sched_component_worker_post_exec_hook | ( | struct starpu_task * | task, |
unsigned | sched_ctx_id | ||
) |
compatibility with starpu_sched_policy interface
struct starpu_task * starpu_sched_component_parents_pull_task | ( | struct starpu_sched_component * | component, |
struct starpu_sched_component * | to | ||
) |
default function for the pull component method, just call pull of parents until one of them returns a task
int starpu_sched_component_can_push | ( | struct starpu_sched_component * | component, |
struct starpu_sched_component * | to | ||
) |
default function for the can_push component method, just call can_push of parents until one of them returns non-zero
int starpu_sched_component_can_pull | ( | struct starpu_sched_component * | component | ) |
default function for the can_pull component method, just call can_pull of children until one of them returns non-zero
int starpu_sched_component_can_pull_all | ( | struct starpu_sched_component * | component | ) |
function for the can_pull component method, call can_pull of all children
double starpu_sched_component_estimated_load | ( | struct starpu_sched_component * | component | ) |
default function for the estimated_load component method, just sum up the loads of the children of the component.
double starpu_sched_component_estimated_end_min | ( | struct starpu_sched_component * | component | ) |
function that can be used for the estimated_end component method, compute the minimum completion time of the children.
double starpu_sched_component_estimated_end_min_add | ( | struct starpu_sched_component * | component, |
double | exp_len | ||
) |
function that can be used for the estimated_end component method, compute the minimum completion time of the children, and add to it an estimation of how existing queued work, plus the exp_len work, can be completed. This is typically used instead of starpu_sched_component_estimated_end_min when the component contains a queue of tasks, which thus needs to be added to the estimations.
double starpu_sched_component_estimated_end_average | ( | struct starpu_sched_component * | component | ) |
default function for the estimated_end component method, compute the average completion time of the children.
struct starpu_sched_component * starpu_sched_component_fifo_create | ( | struct starpu_sched_tree * | tree, |
struct starpu_sched_component_fifo_data * | fifo_data | ||
) |
Return a struct starpu_sched_component with a fifo. A stable sort is performed according to tasks priorities. A push_task call on this component does not perform recursive calls, underlying components will have to call pop_task to get it. starpu_sched_component::estimated_end function compute the estimated length by dividing the sequential length by the number of underlying workers.
int starpu_sched_component_is_fifo | ( | struct starpu_sched_component * | component | ) |
return true iff component
is a fifo component
struct starpu_sched_component * starpu_sched_component_work_stealing_create | ( | struct starpu_sched_tree * | tree, |
void * | arg | ||
) |
return a component that perform a work stealing scheduling. Tasks are pushed in a round robin way. estimated_end return the average of expected length of fifos, starting at the average of the expected_end of his children. When a worker have to steal a task, it steal a task in a round robin way, and get the last pushed task of the higher priority.
int starpu_sched_component_is_work_stealing | ( | struct starpu_sched_component * | component | ) |
return true iff component
is a work stealing component
int starpu_sched_tree_work_stealing_push_task | ( | struct starpu_task * | task | ) |
undefined if there is no work stealing component in the scheduler. If any, task
is pushed in a default way if the caller is the application, and in the caller's fifo if its a worker.
struct starpu_sched_component * starpu_sched_component_random_create | ( | struct starpu_sched_tree * | tree, |
void * | arg | ||
) |
create a component that perform a random scheduling
int starpu_sched_component_is_random | ( | struct starpu_sched_component * | ) |
return true iff component
is a random component
struct starpu_sched_component * starpu_sched_component_mct_create | ( | struct starpu_sched_tree * | tree, |
struct starpu_sched_component_mct_data * | mct_data | ||
) |
create a component with mct_data parameters. the mct component does not do anything but pushing tasks on no_perf_model_component and calibrating_component
struct starpu_sched_component * starpu_sched_component_best_implementation_create | ( | struct starpu_sched_tree * | tree, |
void * | arg | ||
) |
Select the implementation that offer the shortest computation length for the first worker that can execute the task. Or an implementation that need to be calibrated. Also set starpu_task::predicted and starpu_task::predicted_transfer for memory component of the first suitable workerid. If starpu_sched_component::push method is called and starpu_sched_component::nchild > 1 the result is undefined.
struct starpu_sched_component_composed_recipe * starpu_sched_component_composed_recipe_create | ( | void | ) |
return an empty recipe for a composed component, it should not be used without modification. See ImplementAModularizedScheduler for more details.
struct starpu_sched_component_composed_recipe * starpu_sched_component_composed_recipe_create_singleton | ( | struct starpu_sched_component *(*)(struct starpu_sched_tree *tree, void *arg) | create_component, |
void * | arg | ||
) |
return a recipe to build a composed component with a create_component
void starpu_sched_component_composed_recipe_add | ( | struct starpu_sched_component_composed_recipe * | recipe, |
struct starpu_sched_component *(*)(struct starpu_sched_tree *tree, void *arg) | create_component, | ||
void * | arg | ||
) |
add create_component
under all previous components in recipe
void starpu_sched_component_composed_recipe_destroy | ( | struct starpu_sched_component_composed_recipe * | ) |
destroy composed_sched_component, this should be done after starpu_sched_component_composed_component_create was called
struct starpu_sched_component * starpu_sched_component_composed_component_create | ( | struct starpu_sched_tree * | tree, |
struct starpu_sched_component_composed_recipe * | recipe | ||
) |
create a component that behave as all component of recipe where linked. Except that you can not use starpu_sched_component_is_foo function if recipe contain a single create_foo arg_foo pair, create_foo(arg_foo) is returned instead of a composed component
struct starpu_sched_tree * starpu_sched_component_make_scheduler | ( | unsigned | sched_ctx_id, |
struct starpu_sched_component_specs | s | ||
) |
build a scheduler for sched_ctx_id
according to s
and the hwloc topology of the machine.
void starpu_sched_component_initialize_simple_scheduler | ( | starpu_sched_component_create_t | create_decision_component, |
void * | data, | ||
unsigned | flags, | ||
unsigned | sched_ctx_id | ||
) |
Create a simple modular scheduler tree around a scheduling decision-making component component
. The details of what should be built around component
is described by flags
. The different STARPU_SCHED_SIMPL_DECIDE_* flags are mutually exclusive. data
is passed to the create_decision_component
function when creating the decision component. See ImplementAModularizedScheduler for more details.
void starpu_sched_component_initialize_simple_schedulers | ( | unsigned | sched_ctx_id, |
unsigned | ndecisions, | ||
... | |||
) |
Create a simple modular scheduler tree around several scheduling decision-making components. The parameters are similar to starpu_sched_component_initialize_simple_scheduler, but per scheduling decision, for instance:
starpu_sched_component_initialize_simple_schedulers(sched_ctx_id, 2, create1, data1, flags1, create2, data2, flags2);
The different flags parameters must be coherent: same decision flags. They must not include the perfmodel flag (not supported yet).