HeMPS  8.0
applications.h
Go to the documentation of this file.
1 
18 #ifndef _APPLICATIONS_H_
19 #define _APPLICATIONS_H_
20 #include "../../include/kernel_pkg.h"
21 
22 //Application status
23 #define RUNNING 1
24 #define FREE 2
25 #define WAITING_RECLUSTERING 3
26 #define READY_TO_LOAD 4
27 
28 //Task status
29 #define REQUESTED 0
30 #define ALLOCATED 1
31 #define TASK_RUNNING 2
32 #define TERMINATED_TASK 3
33 #define MIGRATING 4
34 
35 #define MAX_TASK_DEPENDECES 10
36 
37 
42 typedef struct {
43  int task;
44  int flits;
45 } Dependence;
46 
51 typedef struct {
52  int id;
53  int code_size;
54  int data_size;
55  int bss_size;
60  int status;
62  Dependence dependences[10];
63 } Task;
64 
67 typedef struct {
68  int app_ID;
69  int status;
72  Task tasks[MAX_TASKS_APP];
73 } Application;
74 
75 
77 
79 
81 
82 void set_task_terminated(Application *, int);
83 
84 void set_task_migrating(int);
85 
86 void set_task_migrated(int, int);
87 
88 unsigned int get_app_id_counter();
89 
90 Application * read_and_create_application(unsigned int, volatile unsigned int *);
91 
92 void remove_application(int);
93 
94 void initialize_applications();
95 
96 #endif /* SOFTWARE_INCLUDE_APPLICATIONS_APPLICATIONS_H_ */
This structure stores the communication dependences of a given task This structure is fulfilled by t...
Definition: applications.h:42
void set_task_migrated(int, int)
Definition: applications.c:144
int set_task_allocated(Application *, int)
Definition: applications.c:90
int initial_address
Stores the initial address of task into repository - loaded from repository.
Definition: applications.h:56
int tasks_number
Stores the application task number.
Definition: applications.h:70
int terminated_tasks
Stores the number of task terminated of an application.
Definition: applications.h:71
Application * get_application_ptr(int)
Definition: applications.c:27
int computation_load
Stores the computation load.
Definition: applications.h:58
int dependences_number
Stores number of communicating task, i.e, dependences.
Definition: applications.h:61
int status
Stores the status.
Definition: applications.h:60
void set_task_migrating(int)
Definition: applications.c:129
int bss_size
Stores the BSS memory section size - loaded from repository.
Definition: applications.h:55
int flits
Stores number of flits exchanged between the source task and the communicating task.
Definition: applications.h:44
This structure store variables useful to the kernel master manage an application instance.
Definition: applications.h:67
int borrowed_master
Stores the borrowed master address.
Definition: applications.h:59
int data_size
Stores the DATA memory section size - loaded from repository.
Definition: applications.h:54
void set_task_terminated(Application *, int)
Definition: applications.c:114
int task
Stores the communicating task ID.
Definition: applications.h:43
Application * get_next_pending_app()
Definition: applications.c:64
int app_ID
Stores the application id.
Definition: applications.h:68
int status
Stores the application status.
Definition: applications.h:69
int code_size
Stores the task code size - loaded from repository.
Definition: applications.h:53
int id
Stores the task id.
Definition: applications.h:52
This structure stores variables useful to manage a task from a manager kernel perspective Some of th...
Definition: applications.h:51
int allocated_proc
Stores the allocated processor address of the task.
Definition: applications.h:57