StarPU Handbook

Functions
Scheduling Context Hypervisor - Linear Programming

## Functions
double | sc_hypervisor_lp_get_nworkers_per_ctx (int nsched_ctxs, int ntypes_of_workers, double res[nsched_ctxs][ntypes_of_workers], int total_nw[ntypes_of_workers], struct types_of_workers *tw, unsigned *in_sched_ctxs)
double | sc_hypervisor_lp_get_tmax (int nw, int *workers)
void | sc_hypervisor_lp_round_double_to_int (int ns, int nw, double res[ns][nw], int res_rounded[ns][nw])
void | sc_hypervisor_lp_redistribute_resources_in_ctxs (int ns, int nw, int res_rounded[ns][nw], double res[ns][nw], unsigned *sched_ctxs, struct types_of_workers *tw)
void | sc_hypervisor_lp_distribute_resources_in_ctxs (unsigned *sched_ctxs, int ns, int nw, int res_rounded[ns][nw], double res[ns][nw], int *workers, int nworkers, struct types_of_workers *tw)
void | sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs (unsigned *sched_ctxs, int ns, int nw, double res[ns][nw], int *workers, int nworkers, struct types_of_workers *tw)
void | sc_hypervisor_lp_place_resources_in_ctx (int ns, int nw, double w_in_s[ns][nw], unsigned *sched_ctxs, int *workers, unsigned do_size, struct types_of_workers *tw)
void | sc_hypervisor_lp_share_remaining_resources (int ns, unsigned *sched_ctxs, int nworkers, int *workers)
double | sc_hypervisor_lp_find_tmax (double t1, double t2)
unsigned | sc_hypervisor_lp_execute_dichotomy (int ns, int nw, double w_in_s[ns][nw], unsigned solve_lp_integer, void *specific_data, double tmin, double tmax, double smallest_tmax, double(*lp_estimated_distrib_func)(int ns, int nw, double draft_w_in_s[ns][nw], unsigned is_integer, double tmax, void *specifc_data))
double | sc_hypervisor_lp_simulate_distrib_flops (int nsched_ctxs, int ntypes_of_workers, double speed[nsched_ctxs][ntypes_of_workers], double flops[nsched_ctxs], double res[nsched_ctxs][ntypes_of_workers], int total_nw[ntypes_of_workers], unsigned sched_ctxs[nsched_ctxs], double vmax)
double | sc_hypervisor_lp_simulate_distrib_tasks (int ns, int nw, int nt, double w_in_s[ns][nw], double tasks[nw][nt], double times[nw][nt], unsigned is_integer, double tmax, unsigned *in_sched_ctxs, struct sc_hypervisor_policy_task_pool *tmp_task_pools)
double | sc_hypervisor_lp_simulate_distrib_flops_on_sample (int ns, int nw, double final_w_in_s[ns][nw], unsigned is_integer, double tmax, double **speed, double flops[ns], double **final_flops_on_w)

## Detailed Description

## Function Documentation

## ◆ sc_hypervisor_lp_get_nworkers_per_ctx()

double sc_hypervisor_lp_get_nworkers_per_ctx | ( | int | nsched_ctxs,
|  | int | ntypes_of_workers,
|  | double | res[nsched_ctxs][ntypes_of_workers],
|  | int | total_nw[ntypes_of_workers],
|  | struct types_of_workers * | tw,
|  | unsigned * | in_sched_ctxs
| ) |  |

return tmax, and compute in table res the nr of workers needed by each context st the system ends up in the smallest tma

## ◆ sc_hypervisor_lp_get_tmax()

double sc_hypervisor_lp_get_tmax | ( | int | nw,
|  | int * | workers
| ) |  |

return tmax of the system

## ◆ sc_hypervisor_lp_round_double_to_int()

void sc_hypervisor_lp_round_double_to_int | ( | int | ns,
|  | int | nw,
|  | double | res[ns][nw],
|  | int | res_rounded[ns][nw]
| ) |  |

the linear programme determins a rational number of ressources for each ctx, we round them depending on the type of ressource

## ◆ sc_hypervisor_lp_redistribute_resources_in_ctxs()

void sc_hypervisor_lp_redistribute_resources_in_ctxs | ( | int | ns,
|  | int | nw,
|  | int | res_rounded[ns][nw],
|  | double | res[ns][nw],
|  | unsigned * | sched_ctxs,
|  | struct types_of_workers * | tw
| ) |  |

redistribute the ressource in contexts by assigning the first x available ressources to each one

## ◆ sc_hypervisor_lp_distribute_resources_in_ctxs()

void sc_hypervisor_lp_distribute_resources_in_ctxs | ( | unsigned * | sched_ctxs,
|  | int | ns,
|  | int | nw,
|  | int | res_rounded[ns][nw],
|  | double | res[ns][nw],
|  | int * | workers,
|  | int | nworkers,
|  | struct types_of_workers * | tw
| ) |  |

make the first distribution of ressource in contexts by assigning the first x available ressources to each one

## ◆ sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs()

void sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs | ( | unsigned * | sched_ctxs,
|  | int | ns,
|  | int | nw,
|  | double | res[ns][nw],
|  | int * | workers,
|  | int | nworkers,
|  | struct types_of_workers * | tw
| ) |  |

make the first distribution of ressource in contexts by assigning the first x available ressources to each one, share not integer no of workers

## ◆ sc_hypervisor_lp_place_resources_in_ctx()

void sc_hypervisor_lp_place_resources_in_ctx | ( | int | ns,
|  | int | nw,
|  | double | w_in_s[ns][nw],
|  | unsigned * | sched_ctxs,
|  | int * | workers,
|  | unsigned | do_size,
|  | struct types_of_workers * | tw
| ) |  |

place resources in contexts dependig on whether they already have workers or not

## ◆ sc_hypervisor_lp_share_remaining_resources()

void sc_hypervisor_lp_share_remaining_resources | ( | int | ns,
|  | unsigned * | sched_ctxs,
|  | int | nworkers,
|  | int * | workers
| ) |  |

not used resources are shared between all contexts

## ◆ sc_hypervisor_lp_find_tmax()

double sc_hypervisor_lp_find_tmax | ( | double | t1,
|  | double | t2
| ) |  |

dichotomy btw t1 & t2

## ◆ sc_hypervisor_lp_execute_dichotomy()

unsigned sc_hypervisor_lp_execute_dichotomy | ( | int | ns,
|  | int | nw,
|  | double | w_in_s[ns][nw],
|  | unsigned | solve_lp_integer,
|  | void * | specific_data,
|  | double | tmin,
|  | double | tmax,
|  | double | smallest_tmax,
|  | double(*)(int ns, int nw, double draft_w_in_s[ns][nw], unsigned is_integer, double tmax, void *specifc_data) | lp_estimated_distrib_func
| ) |  |

execute the lp trough dichotomy

## ◆ sc_hypervisor_lp_simulate_distrib_flops()

double sc_hypervisor_lp_simulate_distrib_flops | ( | int | nsched_ctxs,
|  | int | ntypes_of_workers,
|  | double | speed[nsched_ctxs][ntypes_of_workers],
|  | double | flops[nsched_ctxs],
|  | double | res[nsched_ctxs][ntypes_of_workers],
|  | int | total_nw[ntypes_of_workers],
|  | unsigned | sched_ctxs[nsched_ctxs],
|  | double | vmax
| ) |  |

linear program that returns 1/tmax, and computes in table res the nr of workers needed by each context st the system ends up in the smallest tmax

## ◆ sc_hypervisor_lp_simulate_distrib_tasks()

double sc_hypervisor_lp_simulate_distrib_tasks | ( | int | ns,
|  | int | nw,
|  | int | nt,
|  | double | w_in_s[ns][nw],
|  | double | tasks[nw][nt],
|  | double | times[nw][nt],
|  | unsigned | is_integer,
|  | double | tmax,
|  | unsigned * | in_sched_ctxs,
|  | struct sc_hypervisor_policy_task_pool * | tmp_task_pools
| ) |  |

linear program that simulates a distribution of tasks that minimises the execution time of the tasks in the pool

## ◆ sc_hypervisor_lp_simulate_distrib_flops_on_sample()

double sc_hypervisor_lp_simulate_distrib_flops_on_sample | ( | int | ns,
|  | int | nw,
|  | double | final_w_in_s[ns][nw],
|  | unsigned | is_integer,
|  | double | tmax,
|  | double ** | speed,
|  | double | flops[ns],
|  | double ** | final_flops_on_w
| ) |  |

linear program that simulates a distribution of flops over the workers on particular sample of the execution of the application such that the entire sample would finish in a minimum amount of time