Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / surf / network_interface.cpp
index 3c2bb7e..b53f312 100644 (file)
@@ -12,8 +12,7 @@
 #ifndef NETWORK_INTERFACE_CPP_
 #define NETWORK_INTERFACE_CPP_
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
-    "Logging specific to the SURF network module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf, "Logging specific to the SURF network module");
 
 /*********
  * C API *
@@ -64,12 +63,9 @@ namespace simgrid {
 
     boost::unordered_map<std::string,Link *> *Link::links = new boost::unordered_map<std::string,Link *>();
     Link *Link::byName(const char* name) {
-      Link * res = NULL;
-      try {
-        res = links->at(name);
-      } catch (std::out_of_range& e) {}
-
-      return res;
+      if (links->find(name) == links->end())
+        return NULL;
+      return  links->at(name);
     }
     /** @brief Returns the amount of links in the platform */
     int Link::linksCount() {
@@ -168,7 +164,7 @@ namespace simgrid {
       ActionList *runningActions = surf_network_model->getRunningActionSet();
       double minRes;
 
-      minRes = shareResourcesMaxMin(runningActions, surf_network_model->p_maxminSystem, surf_network_model->f_networkSolve);
+      minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);
 
       for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
           ; it != itend ; ++it) {