Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a SimDag example (mixtesim) created from an old SG 2.18 example
[simgrid.git] / examples / simdag / mixtesim / include / list_scheduling.h
1 #ifndef LIST_SCHEDULING_H
2 #define LIST_SCHEDULING_H
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7
8 void allocateNodeAttributes(DAG dag);
9 void freeNodeAttributes(DAG dag);
10 void allocateHostAttributes();
11 void freeHostAttributes();
12 void implementSimgridSchedule(DAG dag, Node *list);
13
14 /* Link local_link; */
15
16 #define LIST_SCHEDULING_NOT_SCHEDULED 0
17 #define LIST_SCHEDULING_READY         1
18 #define LIST_SCHEDULING_SCHEDULED     2
19 #define LIST_SCHEDULING_RUNNING       3
20
21
22
23 /**************/
24 /* Attributes */
25 /**************/
26
27 typedef struct _NodeAttribute *NodeAttribute;
28 typedef struct _HostAttribute *HostAttribute;
29
30 struct _NodeAttribute {
31   SD_workstation_t   host;   /* The host on which the node has been scheduled */
32   SD_link_t   link;   /* The link on which the transfer is running */
33   double start;  /* time the task is supposed to start            */
34   double finish; /* time the task is supposed to finish           */
35   int state;     /* scheduled, not scheduled, ready               */
36   double SL;
37   int tag;
38
39   double mean_cost; /* used by heft */
40   double rank_u;    /* used by heft */
41   
42   double data_available;
43 };
44
45 struct _HostAttribute {
46   double first_available;
47   int nb_nodes;
48   int *nodes;
49   int state;
50 };
51
52 #define NODE_ATTR(x) ((NodeAttribute)(x->metadata))
53 #define HOST_ATTR(x) ((HostAttribute)(SD_workstation_get_data(x)))
54
55 #endif