X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1657f21a5d6f8acc62a892f71746505a5fbce74c..293fd3688edf10b5aa587ef872a9461d0cc6737a:/src/surf/gtnets/gtnets_simulator.cc diff --git a/src/surf/gtnets/gtnets_simulator.cc b/src/surf/gtnets/gtnets_simulator.cc index 4b3032426a..d6bfc9d60f 100644 --- a/src/surf/gtnets/gtnets_simulator.cc +++ b/src/surf/gtnets/gtnets_simulator.cc @@ -162,7 +162,6 @@ void GTSim::create_gtnets_topology(){ int GTSim::add_route(int src, int dst, int* links, int nlink){ if (is_topology_ == 0){ create_gtnets_topology(); - // topo_->print_topology(); is_topology_ = 1; } @@ -234,7 +233,6 @@ int GTSim::create_flow(int src, int dst, long datasize, void* metadata){ //generate it here. if (is_topology_ == 0){ create_gtnets_topology(); - // topo_->print_topology(); is_topology_ = 1; } @@ -279,17 +277,19 @@ Time_t GTSim::get_time_to_next_flow_completion(){ int status; Time_t t1; int pfds[2]; + int soon_pid=-1; meta_flg=0; - + //remain needs to be updated in the future Count_t remain; pipe(pfds); t1 = 0; - if (fork() != 0){ + + if ( (soon_pid=fork()) != 0){ read(pfds[0], &t1, sizeof(Time_t)); - waitpid(-1, &status, 0); + waitpid(soon_pid, &status, 0); }else{ Time_t t; t = sim_->RunUntilNextCompletion(); @@ -306,6 +306,7 @@ double GTSim::gtnets_get_flow_rx(void *metadata){ } int GTSim::run_until_next_flow_completion(void ***metadata, int *number_of_flows){ + meta_flows.clear(); meta_nflow = number_of_flows; meta_flg = 1;