1 #ifndef MIXTESIM_DATASTRUCTURES_H
2 #define MIXTESIM_DATASTRUCTURES_H
4 #include "simdag/simdag.h"
5 #include "mixtesim_types.h"
9 /* nodes that must complete before this node can start */
11 Node *parents; /* array of size nb_parents */
13 /* nodes that cannot start until this node has completed */
15 Node *children; /* array of size nb_children */
17 /* index of this node in the DAG->nodes array */
20 node_t type; /* node type: TRANSFER or COMMUNICATION */
22 double cost; /* cost of the computation */
23 /* or file transfer on a resource */
25 /* Pointer to the SIMGRID Task that will
26 * be used for the simulation. The abstract task should
27 * be created upon creation of this node, and will be
28 * de-allocated when SG_shutdown() is called
32 void *metadata; /* For use by the scheduling algorithms */
35 Node newNode(); /* Allocates memory for a node */
36 void freeNode(); /* Free memory for a node */
37 void printNode(DAG dag, Node node); /* print node info */
41 Node root; /* first node */
42 Node end; /* last node */
44 /* Array of nodes, for direct access */
46 Node *nodes; /* array of size nb_nodes */
49 DAG parseDAGFile(char *filename); /* Construct a DAG from a */
50 /* DAG description file */
51 DAG newDAG(); /* allocate memory for a DAG, called by parseDAGFile() */
52 void freeDAG(DAG dag); /* free memory for a DAG */
53 void printDAG(DAG dag); /* prints DAG info */
55 /* /\* HOST structure *\/ */
57 /* /\* index in the Grid->hosts array *\/ */
58 /* int global_index; */
60 /* /\* in which cluster this host is *\/ */
63 /* /\* relative speed of the host *\/ */
64 /* double rel_speed; */
65 /* /\* Pointer to the SIMGRID Resource that will be used */
66 /* * for the simulation. The resource should be created upon */
67 /* * creation of this host, and will be de-allocated when */
68 /* * SG_shutdown() is called */
70 /* /\* char *cpu_trace;*\/ */
74 /* /\* SG_resourcesharing_t mode;*\/ */
76 /* SD_workstation_t sd_host; */
79 /* Host newHost(); /\* Allocate memory for a host *\/ */
80 /* void freeHost(Host h); /\* free memory for a host *\/ */
83 /* /\* LINK structure *\/ */
85 /* /\* index of this link in the Grid->links array *\/ */
86 /* int global_index; */
87 /* /\* Pointer to the SIMGRID Resource that will be used */
88 /* * for the simulation. The resource shouild be created upon */
89 /* * creation of this host, and will be de-allocated when */
90 /* * SG_shutdown() is called */
92 /* /\* char *latency_trace; */
93 /* char *bandwidth_trace;*\/ */
95 /* /\* SG_resourcesharing_t mode;*\/ */
97 /* SD_link_t sd_link; */
100 /* Link newLink(); /\* Allocate memory for a link *\/ */
101 /* void freeLink(Link l); /\* free memory for a link *\/ */
105 /* int nb_hosts; /\* Number of hosts in the Grid *\/ */
106 /* Host *hosts; /\* array of size nb_hosts *\/ */
107 /* int nb_links; /\* Number of links in the Grid *\/ */
108 /* Link *links; /\* array of size nb_links *\/ */
110 /* /\* connection matrix. connections[i][j] is a pointer */
111 /* * to the network link that connects hosts of */
112 /* * global_index i and j, that is grid->hosts[i] */
113 /* * and grid->hosts[j]. This matrix is likely to */
114 /* * be symetric since we probably assume that links */
115 /* * behave the same way in both directions. Note that */
116 /* * simulating non-bi-directional performance characteristics */
117 /* * would not be trivial as two separate links would not */
118 /* * model any contention between traffic going both ways */
120 /* /\* SG_Resource **routes;*\/ */
121 /* /\* SD_link_t **connections;*\/ */
124 /* Grid parseGridFile(char *filename); /\* Creates a Grid from a *\/ */
125 /* /\* Grid description file *\/ */
126 /* Grid newGrid(); /\* Allocates memory for a Grid *\/ */
127 /* void freeGrid(); /\* frees memory of a Grid. free Hosts and Links *\/ */
128 /* void printGrid(Grid grid); /\* print Grid info *\/ */
131 #endif /* MIXTESIM_DATA_STRUCTURES */