Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Comment unused parameters.
[simgrid.git] / src / surf / network_gtnets.hpp
1 #include "network.hpp"
2
3 #ifndef NETWORK_GTNETS_HPP_
4 #define NETWORK_GTNETS_HPP_
5
6 #include "simulator.h"          // Definitions for the Simulator Object
7 #include "node.h"               // Definitions for the Node Object
8 #include "linkp2p.h"            // Definitions for point-to-point link objects
9 #include "ratetimeparse.h"      // Definitions for Rate and Time objects
10 #include "application-tcpserver.h"      // Definitions for TCPServer application
11 #include "application-tcpsend.h"        // Definitions for TCP Sending application
12 #include "tcp-tahoe.h"          // Definitions for TCP Tahoe
13 #include "tcp-reno.h"
14 #include "tcp-newreno.h"
15 #include "event.h"
16 #include "routing-manual.h"
17 #include "red.h"
18
19 xbt_dict_t network_card_ids;
20
21 /***********
22  * Classes *
23  ***********/
24 class NetworkGTNetsModel;
25 typedef NetworkGTNetsModel *NetworkGTNetsModelPtr;
26
27 class NetworkGTNetsLink;
28 typedef NetworkGTNetsLink *NetworkGTNetsLinkPtr;
29
30 class NetworkGTNetsAction;
31 typedef NetworkGTNetsAction *NetworkGTNetsActionPtr;
32
33 class NetworkGTNetsActionLmm;
34 typedef NetworkGTNetsActionLmm *NetworkGTNetsActionLmmPtr;
35
36 /*********
37  * Model *
38  *********/
39 class NetworkGTNetsModel : public NetworkCm02Model {
40 public:
41   NetworkGTNetsModel() : NetworkCm02Model("constant time network") {};
42   int addLink(int id, double bandwidth, double latency);
43   int addOnehop_route(int src, int dst, int link);
44   int addRoute(int src, int dst, int *links, int nlink);
45   int addRouter(int id);
46   int createFlow(int src, int dst, long datasize, void *metadata);
47   double getTimeToNextFlowCompletion();
48   int runUntilNextFlowCompletion(void ***metadata,
49                                      int *number_of_flows);
50   int run(double deltat);
51   // returns the total received by the TCPServer peer of the given action
52   double gtNetsGetFlowRx(void *metadata);
53   void createGTNetsTopology();
54   void printTopology();
55   void setJitter(double);
56   void setJitterSeed(int);
57 private:
58   void addNodes();
59   void nodeConnect();
60
61   bool nodeInclude(int);
62   bool linkInclude(int);
63   Simulator *p_sim;
64   GTNETS_Topology *p_topo;
65   RoutingManual *p_rm;
66   REDQueue *p_redQueue;
67   int m_nnode;
68   int m_isTopology;
69   int m_nflow;
70   double m_jitter;
71   int m_jitterSeed;
72    map<int, Uniform*> p_uniformJitterGenerator;
73
74    map<int, TCPServer*> p_gtnetsServers;
75    map<int, TCPSend*> p_gtnetsClients;
76    map<int, Linkp2p*> p_gtnetsLinks_;
77    map<int, Node*> p_gtnetsNodes;
78    map<void*, int> p_gtnetsActionToFlow;
79
80    map <int, void*> p_gtnetsMetadata;
81
82    // From Topology
83    int m_nodeID;
84    map<int, GTNETS_Link*> p_links;
85    vector<GTNETS_Node*> p_nodes;
86    map<int, int> p_hosts;      //hostid->nodeid
87    set<int > p_routers;
88 };
89
90 /************
91  * Resource *
92  ************/
93 class NetworkGTNetsLink : public NetworkCm02Link {
94 public:
95   NetworkGTNetsLink(NetworkGTNetsModelPtr model, const char* name, double bw, double lat, xbt_dict_t properties);
96   /* Using this object with the public part of
97   model does not make sense */
98   double m_bwCurrent;
99   double m_latCurrent;
100   int m_id;
101 };
102
103 /**********
104  * Action *
105  **********/
106 class NetworkGTNetsAction : public NetworkCm02Action {
107 public:
108   NetworkGTNetsAction(NetworkGTNetsModelPtr model, double latency){};
109
110   double m_latency;
111   double m_latCurrent;
112 #ifdef HAVE_TRACING
113   int m_lastRemains;
114 #endif
115   lmm_variable_t p_variable;
116   double m_rate;
117   int m_suspended;
118 #ifdef HAVE_TRACING
119   RoutingEdgePtr src;
120   RoutingEdgePtr dst;
121 #endif //HAVE_TRACING
122 };
123
124 #endif /* NETWORK_GTNETS_HPP_ */