X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6ee7e9c2e455536ab817ae0136acfbb53822eecd..7b02515baed02f4f6b8808eb16b0e0175eb53395:/src/surf/gtnets/gtnets_interface.cc diff --git a/src/surf/gtnets/gtnets_interface.cc b/src/surf/gtnets/gtnets_interface.cc index 145476e6c1..b278ed70b8 100644 --- a/src/surf/gtnets/gtnets_interface.cc +++ b/src/surf/gtnets/gtnets_interface.cc @@ -1,10 +1,9 @@ -/* $Id$ */ -/* Copyright (c) 2007 Kayo Fujiwara. All rights reserved. */ +/* Copyright (c) 2007-2011, 2014. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ - #include "gtnets_simulator.h" #include "gtnets_interface.h" #ifdef XBT_DEBUG @@ -24,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets_interface, surf_network_gtne // initialize the GTNetS interface and environment int gtnets_initialize(int wsize){ XBT_DEBUG("Using logging."); - xbt_assert0(!gtnets_sim, "gtnets already initialized"); + xbt_assert(!gtnets_sim, "gtnets already initialized"); if(wsize > 0){ XBT_INFO("TCP window maximum size : %d", wsize); @@ -124,7 +123,26 @@ double gtnets_get_flow_rx(void *metadata){ // run for a given time (double) int gtnets_run(Time_t deltat){ + ofstream file; + streambuf* sbuf; + double value; + + if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) { + file.open ("/dev/null"); + sbuf = cout.rdbuf(); + cout.rdbuf(file.rdbuf()); + XBT_DEBUG("Enable GTNetS library quite mode"); + }else { + XBT_DEBUG("Disable GTNetS library quite mode"); + } + gtnets_sim->run(deltat); + + + if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) { + cout.rdbuf(sbuf); + file.close(); + } return 0; }