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_sched_ctx.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2010 - 2012 INRIA
4 *
5 * StarPU is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or (at
8 * your option) any later version.
9 *
10 * StarPU is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15 */
16
17 #ifndef __STARPU_SCHED_CTX_H__
18 #define __STARPU_SCHED_CTX_H__
19
20 #include <starpu.h>
21
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26
27 #define STARPU_SCHED_CTX_POLICY_NAME (1<<16)
28 #define STARPU_SCHED_CTX_POLICY_STRUCT (2<<16)
29 #define STARPU_SCHED_CTX_POLICY_MIN_PRIO (3<<16)
30 #define STARPU_SCHED_CTX_POLICY_MAX_PRIO (4<<16)
31
32 unsigned starpu_sched_ctx_create(int *workerids_ctx, int nworkers_ctx, const char *sched_ctx_name, ...);
33
34 unsigned starpu_sched_ctx_create_inside_interval(const char *policy_name, const char *sched_name, int min_ncpus, int max_ncpus, int min_ngpus, int max_ngpus, unsigned allow_overlap);
35
36 void starpu_sched_ctx_register_close_callback(unsigned sched_ctx_id, void (*close_callback)(unsigned sched_ctx_id, void* args), void *args);
37
38 void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
39
40 void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
41
42 void starpu_sched_ctx_delete(unsigned sched_ctx_id);
43
44 void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor);
45
46 void starpu_sched_ctx_set_context(unsigned *sched_ctx_id);
47
48 unsigned starpu_sched_ctx_get_context(void);
49
50 void starpu_sched_ctx_stop_task_submission(void);
51
52 void starpu_sched_ctx_finished_submit(unsigned sched_ctx_id);
53
54 unsigned starpu_sched_ctx_get_workers_list(unsigned sched_ctx_id, int **workerids);
55
56 unsigned starpu_sched_ctx_get_nworkers(unsigned sched_ctx_id);
57
58 unsigned starpu_sched_ctx_get_nshared_workers(unsigned sched_ctx_id, unsigned sched_ctx_id2);
59
60 unsigned starpu_sched_ctx_contains_worker(int workerid, unsigned sched_ctx_id);
61
62 unsigned starpu_sched_ctx_contains_type_of_worker(enum starpu_worker_archtype arch, unsigned sched_ctx_id);
63
64 unsigned starpu_sched_ctx_worker_get_id(unsigned sched_ctx_id);
65
66 unsigned starpu_sched_ctx_overlapping_ctxs_on_worker(int workerid);
67
68 int starpu_sched_get_min_priority(void);
69
70 int starpu_sched_get_max_priority(void);
71
72 int starpu_sched_set_min_priority(int min_prio);
73
74 int starpu_sched_set_max_priority(int max_prio);
75
76 int starpu_sched_ctx_get_min_priority(unsigned sched_ctx_id);
77
78 int starpu_sched_ctx_get_max_priority(unsigned sched_ctx_id);
79
80 int starpu_sched_ctx_set_min_priority(unsigned sched_ctx_id, int min_prio);
81
82 int starpu_sched_ctx_set_max_priority(unsigned sched_ctx_id, int max_prio);
83
84 int starpu_sched_ctx_min_priority_is_set(unsigned sched_ctx_id);
85
86 int starpu_sched_ctx_max_priority_is_set(unsigned sched_ctx_id);
87
88 #define STARPU_MIN_PRIO (starpu_sched_get_min_priority())
89 #define STARPU_MAX_PRIO (starpu_sched_get_max_priority())
90
91 #define STARPU_DEFAULT_PRIO 0
92
93 struct starpu_worker_collection *starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, enum starpu_worker_collection_type type);
94
95 void starpu_sched_ctx_delete_worker_collection(unsigned sched_ctx_id);
96
97 struct starpu_worker_collection *starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id);
98
99 void starpu_sched_ctx_set_policy_data(unsigned sched_ctx_id, void *policy_data);
100
101 void *starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id);
102
103 int starpu_sched_ctx_get_nready_tasks(unsigned sched_ctx_id);
104
105 double starpu_sched_ctx_get_nready_flops(unsigned sched_ctx_id);
106
107 #ifdef STARPU_USE_SC_HYPERVISOR
108 void starpu_sched_ctx_call_pushed_task_cb(int workerid, unsigned sched_ctx_id);
109 #endif /* STARPU_USE_SC_HYPERVISOR */
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif /* __STARPU_SCHED_CTX_H__ */
starpu_sched_ctx_set_inheritor
void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor)
starpu_sched_ctx_set_context
void starpu_sched_ctx_set_context(unsigned *sched_ctx_id)
starpu_sched_ctx_delete
void starpu_sched_ctx_delete(unsigned sched_ctx_id)
starpu_worker_collection
Definition: starpu_worker.h:47
starpu_sched_ctx_remove_workers
void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id)
starpu_sched_ctx_get_worker_collection
struct starpu_worker_collection * starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id)
starpu_sched_ctx_stop_task_submission
void starpu_sched_ctx_stop_task_submission(void)
starpu_sched_ctx_set_min_priority
int starpu_sched_ctx_set_min_priority(unsigned sched_ctx_id, int min_prio)
starpu_sched_ctx_get_nshared_workers
unsigned starpu_sched_ctx_get_nshared_workers(unsigned sched_ctx_id, unsigned sched_ctx_id2)
starpu_sched_ctx_worker_get_id
unsigned starpu_sched_ctx_worker_get_id(unsigned sched_ctx_id)
starpu_worker_archtype
starpu_worker_archtype
Definition: starpu_worker.h:29
starpu_sched_ctx_get_nworkers
unsigned starpu_sched_ctx_get_nworkers(unsigned sched_ctx_id)
starpu_sched_ctx_add_workers
void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id)
starpu_sched_ctx_get_context
unsigned starpu_sched_ctx_get_context(void)
starpu_sched_ctx_contains_worker
unsigned starpu_sched_ctx_contains_worker(int workerid, unsigned sched_ctx_id)
starpu_sched_ctx_finished_submit
void starpu_sched_ctx_finished_submit(unsigned sched_ctx_id)
starpu_sched_ctx_create_worker_collection
struct starpu_worker_collection * starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, enum starpu_worker_collection_type type)
starpu_worker_collection::type
enum starpu_worker_collection_type type
Definition: starpu_worker.h:51
starpu_sched_ctx_get_max_priority
int starpu_sched_ctx_get_max_priority(unsigned sched_ctx_id)
starpu_sched_ctx_get_workers_list
unsigned starpu_sched_ctx_get_workers_list(unsigned sched_ctx_id, int **workerids)
starpu_sched_ctx_call_pushed_task_cb
void starpu_sched_ctx_call_pushed_task_cb(int workerid, unsigned sched_ctx_id)
starpu_sched_ctx_create_inside_interval
unsigned starpu_sched_ctx_create_inside_interval(const char *policy_name, const char *sched_name, int min_ncpus, int max_ncpus, int min_ngpus, int max_ngpus, unsigned allow_overlap)
starpu_sched_ctx_overlapping_ctxs_on_worker
unsigned starpu_sched_ctx_overlapping_ctxs_on_worker(int workerid)
starpu_sched_ctx_get_policy_data
void * starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id)
starpu_sched_set_max_priority
int starpu_sched_set_max_priority(int max_prio)
starpu_sched_ctx_set_max_priority
int starpu_sched_ctx_set_max_priority(unsigned sched_ctx_id, int max_prio)
starpu_sched_get_max_priority
int starpu_sched_get_max_priority(void)
starpu_sched_get_min_priority
int starpu_sched_get_min_priority(void)
starpu_sched_ctx_create
unsigned starpu_sched_ctx_create(int *workerids_ctx, int nworkers_ctx, const char *sched_ctx_name,...)
starpu_sched_ctx_delete_worker_collection
void starpu_sched_ctx_delete_worker_collection(unsigned sched_ctx_id)
starpu_worker_collection_type
starpu_worker_collection_type
Definition: starpu_worker.h:42
starpu.h
starpu_sched_set_min_priority
int starpu_sched_set_min_priority(int min_prio)
starpu_sched_ctx_get_min_priority
int starpu_sched_ctx_get_min_priority(unsigned sched_ctx_id)
starpu_sched_ctx_register_close_callback
void starpu_sched_ctx_register_close_callback(unsigned sched_ctx_id, void(*close_callback)(unsigned sched_ctx_id, void *args), void *args)
starpu_sched_ctx_set_policy_data
void starpu_sched_ctx_set_policy_data(unsigned sched_ctx_id, void *policy_data)