StarPU Handbook
sc_hypervisor_policy.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2010-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), 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 SC_HYPERVISOR_POLICY_H
18 #define SC_HYPERVISOR_POLICY_H
19 
20 #include <sc_hypervisor.h>
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
32 #define HYPERVISOR_REDIM_SAMPLE 0.02
33 #define HYPERVISOR_START_REDIM_SAMPLE 0.1
34 #define SC_NOTHING 0
35 #define SC_IDLE 1
36 #define SC_SPEED 2
37 
39 {
40  unsigned ncpus;
41  unsigned ncuda;
42  unsigned nw;
43 };
44 
50 {
54  struct starpu_codelet *cl;
55 
59  uint32_t footprint;
60 
64  unsigned sched_ctx_id;
65 
69  unsigned long n;
70 
74  size_t data_size;
75 
80 };
81 
85 void sc_hypervisor_policy_add_task_to_pool(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint, struct sc_hypervisor_policy_task_pool **task_pools, size_t data_size);
86 
91 
96 
100 void sc_hypervisor_get_tasks_times(int nw, int nt, double times[nw][nt], int *workers, unsigned size_ctxs, struct sc_hypervisor_policy_task_pool *task_pools);
101 
105 unsigned sc_hypervisor_find_lowest_prio_sched_ctx(unsigned req_sched_ctx, int nworkers_to_move);
106 
110 int* sc_hypervisor_get_idlest_workers(unsigned sched_ctx, int *nworkers, enum starpu_worker_archtype arch);
111 
115 int* sc_hypervisor_get_idlest_workers_in_list(int *start, int *workers, int nall_workers, int *nworkers, enum starpu_worker_archtype arch);
116 
121 
125 int sc_hypervisor_compute_nworkers_to_move(unsigned req_sched_ctx);
126 
130 unsigned sc_hypervisor_policy_resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigned force_resize, unsigned now);
131 
135 unsigned sc_hypervisor_policy_resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now);
136 
141 
146 
151 
155 double sc_hypervisor_get_speed_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker);
156 
161 
166 
171 
176 
181 
186 
191 
195 unsigned sc_hypervisor_criteria_fulfilled(unsigned sched_ctx, int worker);
196 
200 unsigned sc_hypervisor_check_idle(unsigned sched_ctx, int worker);
201 
205 unsigned sc_hypervisor_check_speed_gap_btw_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
206 
210 unsigned sc_hypervisor_check_speed_gap_btw_ctxs_on_level(int level, int *workers_in, int nworkers_in, unsigned father_sched_ctx_id, unsigned **sched_ctxs, int *nsched_ctxs);
211 
216 
220 struct types_of_workers* sc_hypervisor_get_types_of_workers(int *workers, unsigned nworkers);
221 
224 #ifdef __cplusplus
225 }
226 #endif
227 
228 #endif
Definition: starpu_task.h:250
Definition: starpu_task.h:567
struct sc_hypervisor_policy_task_pool * next
Definition: sc_hypervisor_policy.h:79
unsigned sched_ctx_id
Definition: sc_hypervisor_policy.h:64
uint32_t footprint
Definition: sc_hypervisor_policy.h:59
size_t data_size
Definition: sc_hypervisor_policy.h:74
struct starpu_codelet * cl
Definition: sc_hypervisor_policy.h:54
unsigned long n
Definition: sc_hypervisor_policy.h:69
unsigned sc_hypervisor_criteria_fulfilled(unsigned sched_ctx, int worker)
struct sc_hypervisor_policy_task_pool * sc_hypervisor_policy_clone_task_pool(struct sc_hypervisor_policy_task_pool *tp)
double sc_hypervisor_get_slowest_ctx_exec_time(void)
double sc_hypervisor_get_speed_per_worker_type(struct sc_hypervisor_wrapper *sc_w, enum starpu_worker_archtype arch)
unsigned sc_hypervisor_get_index_for_arch(enum starpu_worker_archtype arch, struct types_of_workers *tw)
void sc_hypervisor_check_if_consider_max(struct types_of_workers *tw)
void sc_hypervisor_group_workers_by_type(struct types_of_workers *tw, int *total_nw)
unsigned sc_hypervisor_find_lowest_prio_sched_ctx(unsigned req_sched_ctx, int nworkers_to_move)
int sc_hypervisor_get_movable_nworkers(struct sc_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_worker_archtype arch)
void sc_hypervisor_policy_add_task_to_pool(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint, struct sc_hypervisor_policy_task_pool **task_pools, size_t data_size)
double sc_hypervisor_get_avg_speed(enum starpu_worker_archtype arch)
unsigned sc_hypervisor_get_resize_criteria()
enum starpu_worker_archtype sc_hypervisor_get_arch_for_index(unsigned w, struct types_of_workers *tw)
unsigned sc_hypervisor_check_speed_gap_btw_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
unsigned sc_hypervisor_policy_resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigned force_resize, unsigned now)
double sc_hypervisor_get_ctx_speed(struct sc_hypervisor_wrapper *sc_w)
int * sc_hypervisor_get_idlest_workers(unsigned sched_ctx, int *nworkers, enum starpu_worker_archtype arch)
unsigned sc_hypervisor_check_speed_gap_btw_ctxs_on_level(int level, int *workers_in, int nworkers_in, unsigned father_sched_ctx_id, unsigned **sched_ctxs, int *nsched_ctxs)
double sc_hypervisor_get_ref_speed_per_worker_type(struct sc_hypervisor_wrapper *sc_w, enum starpu_worker_archtype arch)
struct types_of_workers * sc_hypervisor_get_types_of_workers(int *workers, unsigned nworkers)
double sc_hypervisor_get_speed_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker)
int * sc_hypervisor_get_idlest_workers_in_list(int *start, int *workers, int nall_workers, int *nworkers, enum starpu_worker_archtype arch)
void sc_hypervisor_policy_remove_task_from_pool(struct starpu_task *task, uint32_t footprint, struct sc_hypervisor_policy_task_pool **task_pools)
double sc_hypervisor_get_fastest_ctx_exec_time(void)
unsigned sc_hypervisor_policy_resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now)
void sc_hypervisor_get_tasks_times(int nw, int nt, double times[nw][nt], int *workers, unsigned size_ctxs, struct sc_hypervisor_policy_task_pool *task_pools)
unsigned sc_hypervisor_check_idle(unsigned sched_ctx, int worker)
int sc_hypervisor_compute_nworkers_to_move(unsigned req_sched_ctx)
Definition: sc_hypervisor_policy.h:50
Definition: sc_hypervisor_policy.h:39
starpu_worker_archtype
Definition: starpu_worker.h:63
Definition: sc_hypervisor_config.h:141
Definition: sc_hypervisor_monitoring.h:69