Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add debug on topology.
[simgrid.git] / src / surf / gtnets / gtnets_simulator.cc
index 8d5c3ab..dafa668 100644 (file)
@@ -157,6 +157,10 @@ void GTSim::create_gtnets_topology(){
   node_connect();
 }
 
+void GTSim::print_topology(){
+  topo_->print_topology();
+}
+
 // Add a route that includes more than one hop. All one hop
 // routes must have been added. When this function is called
 // for the first time, all gtnets nodes are generated.
@@ -250,11 +254,11 @@ int GTSim::create_flow(int src, int dst, long datasize, void* metadata){
 
   gtnets_servers_[nflow_] = (TCPServer*) gtnets_nodes_[dst_node]->
        AddApplication(TCPServer(TCPReno()));
-  gtnets_servers_[nflow_]->BindAndListen(80);
+  gtnets_servers_[nflow_]->BindAndListen(1000+nflow_);
 
   gtnets_clients_[nflow_] = (TCPSend*)gtnets_nodes_[src_node]->
     AddApplication(TCPSend(metadata, gtnets_nodes_[dst_node]->GetIPAddr(), 
-                          80, Constant(datasize), TCPReno()));
+                          1000+nflow_, Constant(datasize), TCPReno()));
   gtnets_clients_[nflow_]->SetSendCallBack(tcp_sent_callback);
   gtnets_clients_[nflow_]->Start(0);
 
@@ -293,7 +297,7 @@ Time_t GTSim::get_time_to_next_flow_completion(){
 
 double GTSim::gtnets_get_flow_rx(void *metadata){
   int flow_id = gtnets_action_to_flow_[metadata];
-  return gtnets_servers_[flow_id]->totRx
+  return gtnets_servers_[flow_id]->GetTotRx()
 }
 
 int GTSim::run_until_next_flow_completion(void ***metadata, int *number_of_flows){