Loading...
Searching...
No Matches
sc_hypervisor_policy.h
Go to the documentation of this file.
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2010-2023 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
*
* StarPU is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* StarPU is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU Lesser General Public License in COPYING.LGPL for more details.
*/
#ifndef SC_HYPERVISOR_POLICY_H
#define SC_HYPERVISOR_POLICY_H
#include <sc_hypervisor.h>
#ifdef __cplusplus
extern "C" {
#endif
#define HYPERVISOR_REDIM_SAMPLE 0.02
#define HYPERVISOR_START_REDIM_SAMPLE 0.1
#define SC_NOTHING 0
#define SC_IDLE 1
#define SC_SPEED 2
struct types_of_workers
{
unsigned ncpus;
unsigned ncuda;
unsigned nw;
};
struct sc_hypervisor_policy_task_pool
{
struct starpu_codelet *cl;
uint32_t footprint;
unsigned sched_ctx_id;
unsigned long n;
size_t data_size;
struct sc_hypervisor_policy_task_pool *next;
};
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);
void sc_hypervisor_policy_remove_task_from_pool(struct starpu_task *task, uint32_t footprint, struct sc_hypervisor_policy_task_pool **task_pools);
struct sc_hypervisor_policy_task_pool *sc_hypervisor_policy_clone_task_pool(struct sc_hypervisor_policy_task_pool *tp);
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_find_lowest_prio_sched_ctx(unsigned req_sched_ctx, int nworkers_to_move);
int *sc_hypervisor_get_idlest_workers(unsigned sched_ctx, int *nworkers, enum starpu_worker_archtype arch);
int *sc_hypervisor_get_idlest_workers_in_list(int *start, int *workers, int nall_workers, int *nworkers, enum starpu_worker_archtype arch);
int sc_hypervisor_get_movable_nworkers(struct sc_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_worker_archtype arch);
int sc_hypervisor_compute_nworkers_to_move(unsigned req_sched_ctx);
unsigned sc_hypervisor_policy_resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigned force_resize, unsigned now);
unsigned sc_hypervisor_policy_resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now);
double sc_hypervisor_get_ctx_speed(struct sc_hypervisor_wrapper *sc_w);
double sc_hypervisor_get_slowest_ctx_exec_time(void);
double sc_hypervisor_get_fastest_ctx_exec_time(void);
double sc_hypervisor_get_speed_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker);
double sc_hypervisor_get_speed_per_worker_type(struct sc_hypervisor_wrapper *sc_w, enum starpu_worker_archtype arch);
double sc_hypervisor_get_ref_speed_per_worker_type(struct sc_hypervisor_wrapper *sc_w, enum starpu_worker_archtype arch);
double sc_hypervisor_get_avg_speed(enum starpu_worker_archtype arch);
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);
enum starpu_worker_archtype sc_hypervisor_get_arch_for_index(unsigned w, struct types_of_workers *tw);
unsigned sc_hypervisor_get_index_for_arch(enum starpu_worker_archtype arch, struct types_of_workers *tw);
unsigned sc_hypervisor_criteria_fulfilled(unsigned sched_ctx, int worker);
unsigned sc_hypervisor_check_idle(unsigned sched_ctx, int worker);
unsigned sc_hypervisor_check_speed_gap_btw_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
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);
unsigned sc_hypervisor_get_resize_criteria(void);
struct types_of_workers *sc_hypervisor_get_types_of_workers(int *workers, unsigned nworkers);
#ifdef __cplusplus
}
#endif
#endif
starpu_codelet
Definition starpu_task.h:338
starpu_task
Definition starpu_task.h:688
sc_hypervisor_policy_task_pool::next
struct sc_hypervisor_policy_task_pool * next
Definition sc_hypervisor_policy.h:78
sc_hypervisor_policy_task_pool::sched_ctx_id
unsigned sched_ctx_id
Definition sc_hypervisor_policy.h:63
sc_hypervisor_policy_task_pool::footprint
uint32_t footprint
Definition sc_hypervisor_policy.h:58
sc_hypervisor_policy_task_pool::data_size
size_t data_size
Definition sc_hypervisor_policy.h:73
sc_hypervisor_policy_task_pool::cl
struct starpu_codelet * cl
Definition sc_hypervisor_policy.h:53
sc_hypervisor_policy_task_pool::n
unsigned long n
Definition sc_hypervisor_policy.h:68
sc_hypervisor_get_types_of_workers
struct types_of_workers * sc_hypervisor_get_types_of_workers(int *workers, unsigned nworkers)
sc_hypervisor_criteria_fulfilled
unsigned sc_hypervisor_criteria_fulfilled(unsigned sched_ctx, int worker)
sc_hypervisor_get_idlest_workers
int * sc_hypervisor_get_idlest_workers(unsigned sched_ctx, int *nworkers, enum starpu_worker_archtype arch)
sc_hypervisor_get_slowest_ctx_exec_time
double sc_hypervisor_get_slowest_ctx_exec_time(void)
sc_hypervisor_get_speed_per_worker_type
double sc_hypervisor_get_speed_per_worker_type(struct sc_hypervisor_wrapper *sc_w, enum starpu_worker_archtype arch)
sc_hypervisor_get_index_for_arch
unsigned sc_hypervisor_get_index_for_arch(enum starpu_worker_archtype arch, struct types_of_workers *tw)
sc_hypervisor_check_if_consider_max
void sc_hypervisor_check_if_consider_max(struct types_of_workers *tw)
sc_hypervisor_group_workers_by_type
void sc_hypervisor_group_workers_by_type(struct types_of_workers *tw, int *total_nw)
sc_hypervisor_find_lowest_prio_sched_ctx
unsigned sc_hypervisor_find_lowest_prio_sched_ctx(unsigned req_sched_ctx, int nworkers_to_move)
sc_hypervisor_get_movable_nworkers
int sc_hypervisor_get_movable_nworkers(struct sc_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_worker_archtype arch)
sc_hypervisor_policy_add_task_to_pool
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)
sc_hypervisor_get_avg_speed
double sc_hypervisor_get_avg_speed(enum starpu_worker_archtype arch)
sc_hypervisor_get_arch_for_index
enum starpu_worker_archtype sc_hypervisor_get_arch_for_index(unsigned w, struct types_of_workers *tw)
sc_hypervisor_get_resize_criteria
unsigned sc_hypervisor_get_resize_criteria(void)
sc_hypervisor_check_speed_gap_btw_ctxs
unsigned sc_hypervisor_check_speed_gap_btw_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
sc_hypervisor_policy_resize
unsigned sc_hypervisor_policy_resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigned force_resize, unsigned now)
sc_hypervisor_get_ctx_speed
double sc_hypervisor_get_ctx_speed(struct sc_hypervisor_wrapper *sc_w)
sc_hypervisor_check_speed_gap_btw_ctxs_on_level
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)
sc_hypervisor_get_idlest_workers_in_list
int * sc_hypervisor_get_idlest_workers_in_list(int *start, int *workers, int nall_workers, int *nworkers, enum starpu_worker_archtype arch)
sc_hypervisor_get_ref_speed_per_worker_type
double sc_hypervisor_get_ref_speed_per_worker_type(struct sc_hypervisor_wrapper *sc_w, enum starpu_worker_archtype arch)
sc_hypervisor_policy_clone_task_pool
struct sc_hypervisor_policy_task_pool * sc_hypervisor_policy_clone_task_pool(struct sc_hypervisor_policy_task_pool *tp)
sc_hypervisor_get_speed_per_worker
double sc_hypervisor_get_speed_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker)
sc_hypervisor_policy_remove_task_from_pool
void sc_hypervisor_policy_remove_task_from_pool(struct starpu_task *task, uint32_t footprint, struct sc_hypervisor_policy_task_pool **task_pools)
sc_hypervisor_get_fastest_ctx_exec_time
double sc_hypervisor_get_fastest_ctx_exec_time(void)
sc_hypervisor_policy_resize_to_unknown_receiver
unsigned sc_hypervisor_policy_resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now)
sc_hypervisor_get_tasks_times
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)
sc_hypervisor_check_idle
unsigned sc_hypervisor_check_idle(unsigned sched_ctx, int worker)
sc_hypervisor_compute_nworkers_to_move
int sc_hypervisor_compute_nworkers_to_move(unsigned req_sched_ctx)
sc_hypervisor_policy_task_pool
Definition sc_hypervisor_policy.h:49
types_of_workers
Definition sc_hypervisor_policy.h:38
starpu_worker_archtype
starpu_worker_archtype
Definition starpu_worker.h:66
sc_hypervisor.h
sc_hypervisor_policy_config
Definition sc_hypervisor_config.h:140
sc_hypervisor_wrapper
Definition sc_hypervisor_monitoring.h:68