HeMPS  8.0
Functions
cluster_scheduler.h File Reference

This module defines the function relative to mapping a new app and a new task into a given slave processor. This module is only used by manager kernel. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void allocate_cluster_resource (int, int)
 
void release_cluster_resources (int, int)
 
void page_used (int, int, int)
 
void page_released (int, int, int)
 
int map_task (int)
 
int application_mapping (int, int)
 
int SearchCluster (int, int)
 

Detailed Description

This module defines the function relative to mapping a new app and a new task into a given slave processor. This module is only used by manager kernel.

HEMPS VERSION - 8.0 - support for RT applications

Distribution: June 2016

Created by: Marcelo Ruaro - contact: marce.nosp@m.lo.r.nosp@m.uaro@.nosp@m.acad.nosp@m..pucr.nosp@m.s.br

Research group: GAPH-PUCRS - contact: ferna.nosp@m.ndo..nosp@m.morae.nosp@m.s@pu.nosp@m.crs.b.nosp@m.r

Function Documentation

void allocate_cluster_resource ( int  cluster_index,
int  nro_resources 
)
inline

Allocate resources to a Cluster by decrementing the number of free resources. If the number of resources is higher than free_resources, then free_resourcers receives zero, and the remaining of resources are allocated by reclustering

Parameters
cluster_indexIndex of cluster to allocate the resources
nro_resourcesNumber of resource to allocated. Normally is the number of task of an application
int application_mapping ( int  cluster_id,
int  app_id 
)

This heuristic maps all task of an application Note that some task can not be mapped due the cluster is full or the processors not satisfies the task requiriments. In this case, the reclustering will be used after the application_mapping funcion calling into the kernel_master.c source file Clearly the tasks that need reclustering are those one that have he allocated_processor equal to -1

Parameters
cluster_idID of the cluster where the application will be mapped
app_idID of the application to be mapped
Returns
1 if mapping OK, 0 if there are no available resources
int map_task ( int  task_id)

Maps a task into a cluster processor. This function only selects the processor not modifying any management structure The mapping heuristic is based on the processor's utilization (slack time) and the number of free_pages

Parameters
task_idID of the task to be mapped
Returns
Address of the selected processor
void page_released ( int  cluster_id,
int  proc_address,
int  task_ID 
)

This function is called by manager inside it own code and in the modules: reclustering and cluster_scheduler. It is called even when a task is removed from a processor. Automatically, this function update the Processors structure by calling the remove_task function

Parameters
cluster_idIndex of cluster to remove the page
proc_addressAddress of the processor that is removing the task
task_IDID of the removed task
void page_used ( int  cluster_id,
int  proc_address,
int  task_ID 
)

This function is called by kernel manager inside it own code and in the modules: reclustering and cluster_scheduler. It is called even when a task is mapped into a processor, by normal task mapping or reclustering. Automatically, this function update the Processors structure by calling the add_task function

Parameters
cluster_idIndex of cluster to allocate the page
proc_addressAddress of the processor that is receiving the task
task_IDID of the allocated task
void release_cluster_resources ( int  cluster_index,
int  nro_resources 
)
inline

Release resources of a Cluster by incrementing the number of free resources according to the nro of resources by reclustering

Parameters
cluster_indexIndex of cluster to allocate the resources
nro_resourcesNumber of resource to release. Normally is the number of task of an application
int SearchCluster ( int  GM_cluster_id,
int  app_task_number 
)

Selects a cluster to insert an application

Parameters
GM_cluster_idcluster ID of the global manager processor
app_task_numberNumber of task of requered application
Returns
> 0 if mapping OK, -1 if there is not resources available