Loading...
Searching...
No Matches
sc_hypervisor.h
Go to the documentation of this file.
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2011-2025 University of 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_H
#define SC_HYPERVISOR_H
#include <starpu.h>
#include <starpu_sched_ctx_hypervisor.h>
#include <sc_hypervisor_config.h>
#include <sc_hypervisor_monitoring.h>
#include <math.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sc_hypervisor_policy
{
const char *name;
unsigned custom;
void (*size_ctxs)(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
void (*resize_ctxs)(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
void (*handle_idle_cycle)(unsigned sched_ctx, int worker);
void (*handle_pushed_task)(unsigned sched_ctx, int worker);
void (*handle_poped_task)(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint);
void (*handle_idle_end)(unsigned sched_ctx, int worker);
void (*handle_post_exec_hook)(unsigned sched_ctx, int task_tag);
void (*handle_submitted_job)(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint, size_t data_size);
void (*end_ctx)(unsigned sched_ctx);
void (*start_ctx)(unsigned sched_ctx);
void (*init_worker)(int workerid, unsigned sched_ctx);
};
extern starpu_pthread_mutex_t act_hypervisor_mutex;
void *sc_hypervisor_init(struct sc_hypervisor_policy *policy);
void sc_hypervisor_shutdown(void);
void sc_hypervisor_register_ctx(unsigned sched_ctx, double total_flops);
void sc_hypervisor_unregister_ctx(unsigned sched_ctx);
void sc_hypervisor_post_resize_request(unsigned sched_ctx, int task_tag);
void sc_hypervisor_resize_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
void sc_hypervisor_stop_resize(unsigned sched_ctx);
void sc_hypervisor_start_resize(unsigned sched_ctx);
const char *sc_hypervisor_get_policy(void);
void sc_hypervisor_add_workers_to_sched_ctx(int *workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx);
void sc_hypervisor_remove_workers_from_sched_ctx(int *workers_to_remove, unsigned nworkers_to_remove, unsigned sched_ctx, unsigned now);
void sc_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int *workers_to_move, unsigned nworkers_to_move, unsigned now);
void sc_hypervisor_size_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
unsigned sc_hypervisor_get_size_req(unsigned **sched_ctxs, int *nsched_ctxs, int **workers, int *nworkers);
void sc_hypervisor_save_size_req(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
void sc_hypervisor_free_size_req(void);
unsigned sc_hypervisor_can_resize(unsigned sched_ctx);
void sc_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint, size_t data_size);
void sc_hypervisor_update_diff_total_flops(unsigned sched_ctx, double diff_total_flops);
void sc_hypervisor_update_diff_elapsed_flops(unsigned sched_ctx, double diff_task_flops);
void sc_hypervisor_update_resize_interval(unsigned *sched_ctxs, int nsched_ctxs, int max_nworkers);
void sc_hypervisor_get_ctxs_on_level(unsigned **sched_ctxs, int *nsched_ctxs, unsigned hierarchy_level, unsigned father_sched_ctx_id);
unsigned sc_hypervisor_get_nhierarchy_levels(void);
void sc_hypervisor_get_leaves(unsigned *sched_ctxs, int nsched_ctxs, unsigned *leaves, int *nleaves);
double sc_hypervisor_get_nready_flops_of_all_sons_of_sched_ctx(unsigned sched_ctx);
void sc_hypervisor_print_overhead(void);
void sc_hypervisor_init_worker(int workerid, unsigned sched_ctx);
#ifdef __cplusplus
}
#endif
#endif
starpu_codelet
Definition starpu_task.h:339
starpu_task
Definition starpu_task.h:689
sc_hypervisor_get_leaves
void sc_hypervisor_get_leaves(unsigned *sched_ctxs, int nsched_ctxs, unsigned *leaves, int *nleaves)
sc_hypervisor_shutdown
void sc_hypervisor_shutdown(void)
sc_hypervisor_unregister_ctx
void sc_hypervisor_unregister_ctx(unsigned sched_ctx)
sc_hypervisor_get_nhierarchy_levels
unsigned sc_hypervisor_get_nhierarchy_levels(void)
sc_hypervisor_get_size_req
unsigned sc_hypervisor_get_size_req(unsigned **sched_ctxs, int *nsched_ctxs, int **workers, int *nworkers)
sc_hypervisor_init
void * sc_hypervisor_init(struct sc_hypervisor_policy *policy)
sc_hypervisor_remove_workers_from_sched_ctx
void sc_hypervisor_remove_workers_from_sched_ctx(int *workers_to_remove, unsigned nworkers_to_remove, unsigned sched_ctx, unsigned now)
sc_hypervisor_register_ctx
void sc_hypervisor_register_ctx(unsigned sched_ctx, double total_flops)
sc_hypervisor_update_diff_total_flops
void sc_hypervisor_update_diff_total_flops(unsigned sched_ctx, double diff_total_flops)
sc_hypervisor_post_resize_request
void sc_hypervisor_post_resize_request(unsigned sched_ctx, int task_tag)
sc_hypervisor_free_size_req
void sc_hypervisor_free_size_req(void)
sc_hypervisor_set_type_of_task
void sc_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint, size_t data_size)
sc_hypervisor_resize_ctxs
void sc_hypervisor_resize_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
sc_hypervisor_update_resize_interval
void sc_hypervisor_update_resize_interval(unsigned *sched_ctxs, int nsched_ctxs, int max_nworkers)
sc_hypervisor_get_nready_flops_of_all_sons_of_sched_ctx
double sc_hypervisor_get_nready_flops_of_all_sons_of_sched_ctx(unsigned sched_ctx)
sc_hypervisor_add_workers_to_sched_ctx
void sc_hypervisor_add_workers_to_sched_ctx(int *workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx)
sc_hypervisor_save_size_req
void sc_hypervisor_save_size_req(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
sc_hypervisor_stop_resize
void sc_hypervisor_stop_resize(unsigned sched_ctx)
sc_hypervisor_get_ctxs_on_level
void sc_hypervisor_get_ctxs_on_level(unsigned **sched_ctxs, int *nsched_ctxs, unsigned hierarchy_level, unsigned father_sched_ctx_id)
sc_hypervisor_update_diff_elapsed_flops
void sc_hypervisor_update_diff_elapsed_flops(unsigned sched_ctx, double diff_task_flops)
sc_hypervisor_move_workers
void sc_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int *workers_to_move, unsigned nworkers_to_move, unsigned now)
sc_hypervisor_size_ctxs
void sc_hypervisor_size_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
sc_hypervisor_can_resize
unsigned sc_hypervisor_can_resize(unsigned sched_ctx)
sc_hypervisor_start_resize
void sc_hypervisor_start_resize(unsigned sched_ctx)
sc_hypervisor_get_policy
const char * sc_hypervisor_get_policy(void)
act_hypervisor_mutex
starpu_pthread_mutex_t act_hypervisor_mutex
sc_hypervisor_policy::handle_post_exec_hook
void(* handle_post_exec_hook)(unsigned sched_ctx, int task_tag)
Definition sc_hypervisor.h:87
sc_hypervisor_policy::handle_idle_cycle
void(* handle_idle_cycle)(unsigned sched_ctx, int worker)
Definition sc_hypervisor.h:63
sc_hypervisor_policy::init_worker
void(* init_worker)(int workerid, unsigned sched_ctx)
Definition sc_hypervisor.h:110
sc_hypervisor_policy::handle_pushed_task
void(* handle_pushed_task)(unsigned sched_ctx, int worker)
Definition sc_hypervisor.h:69
sc_hypervisor_policy::resize_ctxs
void(* resize_ctxs)(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
Definition sc_hypervisor.h:57
sc_hypervisor_policy::size_ctxs
void(* size_ctxs)(unsigned *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
Definition sc_hypervisor.h:52
sc_hypervisor_policy::handle_idle_end
void(* handle_idle_end)(unsigned sched_ctx, int worker)
Definition sc_hypervisor.h:81
sc_hypervisor_policy::handle_poped_task
void(* handle_poped_task)(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
Definition sc_hypervisor.h:75
sc_hypervisor_policy::end_ctx
void(* end_ctx)(unsigned sched_ctx)
Definition sc_hypervisor.h:99
sc_hypervisor_policy::name
const char * name
Definition sc_hypervisor.h:41
sc_hypervisor_policy::custom
unsigned custom
Definition sc_hypervisor.h:46
sc_hypervisor_policy::handle_submitted_job
void(* handle_submitted_job)(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint, size_t data_size)
Definition sc_hypervisor.h:93
sc_hypervisor_policy::start_ctx
void(* start_ctx)(unsigned sched_ctx)
Definition sc_hypervisor.h:105
sc_hypervisor_policy
Definition sc_hypervisor.h:35
sc_hypervisor_config.h
sc_hypervisor_monitoring.h
starpu.h
starpu_sched_ctx_hypervisor.h