StarPU Handbook

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
starpu_scheduler.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2010-2014 Université de Bordeaux 1
4 * Copyright (C) 2011 Télécom-SudParis
5 *
6 * StarPU is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or (at
9 * your option) any later version.
10 *
11 * StarPU is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 *
15 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16 */
17
18 #ifndef __STARPU_SCHEDULER_H__
19 #define __STARPU_SCHEDULER_H__
20
21 #include <starpu.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 struct starpu_task;
29
30 struct starpu_sched_policy
31 {
32 void (*init_sched)(unsigned sched_ctx_id);
33 void (*deinit_sched)(unsigned sched_ctx_id);
34
35 int (*push_task)(struct starpu_task *);
36 void (*push_task_notify)(struct starpu_task *, int workerid, int perf_workerid, unsigned sched_ctx_id);
37 struct starpu_task *(*pop_task)(unsigned sched_ctx_id);
38 struct starpu_task *(*pop_every_task)(unsigned sched_ctx_id);
39
40 void (*pre_exec_hook)(struct starpu_task *);
41 void (*post_exec_hook)(struct starpu_task *);
42
43 void (*add_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
44 void (*remove_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
45
46 const char *policy_name;
47 const char *policy_description;
48 };
49
50 struct starpu_sched_policy **starpu_sched_get_predefined_policies();
51
52 void starpu_worker_get_sched_condition(int workerid, starpu_pthread_mutex_t **sched_mutex, starpu_pthread_cond_t **sched_cond);
53
54 /* This function must be called to wake up a worker that is sleeping on the cond.
55 * It returns 0 whenever the worker is not in a sleeping state */
56 int starpu_wakeup_worker(int workerid, starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex);
57
58 int starpu_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl);
59
60 int starpu_push_local_task(int workerid, struct starpu_task *task, int back);
61
62 int starpu_push_task_end(struct starpu_task *task);
63
64 int starpu_combined_worker_assign_workerid(int nworkers, int workerid_array[]);
65 int starpu_combined_worker_get_description(int workerid, int *worker_size, int **combined_workerid);
66 int starpu_combined_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl);
67
68 int starpu_get_prefetch_flag(void);
69 int starpu_prefetch_task_input_on_node(struct starpu_task *task, unsigned node);
70
71 uint32_t starpu_task_footprint(struct starpu_perfmodel *model, struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl);
72 double starpu_task_expected_length(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl);
73 double starpu_worker_get_relative_speedup(enum starpu_perfmodel_archtype perf_archtype);
74 double starpu_task_expected_data_transfer_time(unsigned memory_node, struct starpu_task *task);
75 double starpu_data_expected_transfer_time(starpu_data_handle_t handle, unsigned memory_node, enum starpu_data_access_mode mode);
76 double starpu_task_expected_power(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl);
77 double starpu_task_expected_conversion_time(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl);
78
79 double starpu_task_bundle_expected_length(starpu_task_bundle_t bundle, enum starpu_perfmodel_archtype arch, unsigned nimpl);
80 double starpu_task_bundle_expected_data_transfer_time(starpu_task_bundle_t bundle, unsigned memory_node);
81 double starpu_task_bundle_expected_power(starpu_task_bundle_t bundle, enum starpu_perfmodel_archtype arch, unsigned nimpl);
82
83 void starpu_sched_ctx_worker_shares_tasks_lists(int workerid, int sched_ctx_id);
84 #ifdef __cplusplus
85 }
86 #endif
87
88 #endif /* __STARPU_SCHEDULER_H__ */
starpu_task_expected_data_transfer_time
double starpu_task_expected_data_transfer_time(unsigned memory_node, struct starpu_task *task)
starpu_task_bundle_expected_data_transfer_time
double starpu_task_bundle_expected_data_transfer_time(starpu_task_bundle_t bundle, unsigned memory_node)
starpu_sched_policy::post_exec_hook
void(* post_exec_hook)(struct starpu_task *)
Definition: starpu_scheduler.h:41
starpu_task_expected_conversion_time
double starpu_task_expected_conversion_time(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
starpu_combined_worker_get_description
int starpu_combined_worker_get_description(int workerid, int *worker_size, int **combined_workerid)
starpu_push_local_task
int starpu_push_local_task(int workerid, struct starpu_task *task, int back)
starpu_sched_policy::add_workers
void(* add_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
Definition: starpu_scheduler.h:43
starpu_worker_get_sched_condition
void starpu_worker_get_sched_condition(int workerid, starpu_pthread_mutex_t **sched_mutex, starpu_pthread_cond_t **sched_cond)
starpu_combined_worker_can_execute_task
int starpu_combined_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl)
starpu_sched_policy::pre_exec_hook
void(* pre_exec_hook)(struct starpu_task *)
Definition: starpu_scheduler.h:40
starpu_sched_policy::deinit_sched
void(* deinit_sched)(unsigned sched_ctx_id)
Definition: starpu_scheduler.h:33
starpu_get_prefetch_flag
int starpu_get_prefetch_flag(void)
starpu_sched_policy::push_task_notify
void(* push_task_notify)(struct starpu_task *, int workerid, int perf_workerid, unsigned sched_ctx_id)
Definition: starpu_scheduler.h:36
starpu_sched_policy::push_task
int(* push_task)(struct starpu_task *)
Definition: starpu_scheduler.h:35
starpu_sched_policy::init_sched
void(* init_sched)(unsigned sched_ctx_id)
Definition: starpu_scheduler.h:32
starpu_sched_policy::remove_workers
void(* remove_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
Definition: starpu_scheduler.h:44
starpu_task_bundle_t
struct _starpu_task_bundle * starpu_task_bundle_t
Definition: starpu_task_bundle.h:29
starpu_task
Definition: starpu_task.h:104
starpu_task_expected_power
double starpu_task_expected_power(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
starpu_task::workerid
unsigned workerid
Definition: starpu_task.h:139
starpu_sched_policy::policy_description
const char * policy_description
Definition: starpu_scheduler.h:47
starpu_task_footprint
uint32_t starpu_task_footprint(struct starpu_perfmodel *model, struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
starpu_sched_policy::policy_name
const char * policy_name
Definition: starpu_scheduler.h:46
starpu_data_expected_transfer_time
double starpu_data_expected_transfer_time(starpu_data_handle_t handle, unsigned memory_node, enum starpu_data_access_mode mode)
starpu_task_bundle_expected_length
double starpu_task_bundle_expected_length(starpu_task_bundle_t bundle, enum starpu_perfmodel_archtype arch, unsigned nimpl)
starpu_worker_get_relative_speedup
double starpu_worker_get_relative_speedup(enum starpu_perfmodel_archtype perf_archtype)
starpu_worker_can_execute_task
int starpu_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl)
starpu_sched_ctx_worker_shares_tasks_lists
void starpu_sched_ctx_worker_shares_tasks_lists(int workerid, int sched_ctx_id)
starpu_perfmodel
Definition: starpu_perfmodel.h:130
starpu_perfmodel_archtype
starpu_perfmodel_archtype
Definition: starpu_perfmodel.h:35
starpu_sched_get_predefined_policies
struct starpu_sched_policy ** starpu_sched_get_predefined_policies()
starpu_sched_policy
Definition: starpu_scheduler.h:30
starpu_prefetch_task_input_on_node
int starpu_prefetch_task_input_on_node(struct starpu_task *task, unsigned node)
starpu_combined_worker_assign_workerid
int starpu_combined_worker_assign_workerid(int nworkers, int workerid_array[])
starpu_task_bundle_expected_power
double starpu_task_bundle_expected_power(starpu_task_bundle_t bundle, enum starpu_perfmodel_archtype arch, unsigned nimpl)
starpu_task_expected_length
double starpu_task_expected_length(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
starpu_data_access_mode
starpu_data_access_mode
Definition: starpu_data.h:31
starpu_data_handle_t
struct _starpu_data_state * starpu_data_handle_t
Definition: starpu_data.h:29
starpu.h
starpu_push_task_end
int starpu_push_task_end(struct starpu_task *task)