Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge s4u wait_any
[simgrid.git] / src / surf / AsClusterDragonfly.cpp
index bb3a90c..e3eff8c 100644 (file)
@@ -14,12 +14,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_dragonfly, surf_route_cluster
 
 
 
-
-
-
-
 namespace simgrid {
-namespace surf {
+namespace routing {
 
 AsClusterDragonfly::AsClusterDragonfly(const char*name)
   : AsCluster(name) {
@@ -27,8 +23,8 @@ AsClusterDragonfly::AsClusterDragonfly(const char*name)
 
 AsClusterDragonfly::~AsClusterDragonfly() {
 
-  if(this->routers_!=NULL){
-    int i;
+  if(this->routers_!=nullptr){
+    unsigned int i;
     for (i=0; i<this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;i++)
         delete(routers_[i]);
     xbt_free(routers_);
@@ -113,13 +109,13 @@ DragonflyRouter::DragonflyRouter(int group, int chassis, int blade){
 }
 
 DragonflyRouter::~DragonflyRouter(){
-  if(this->myNodes_!=NULL)
+  if(this->myNodes_!=nullptr)
     xbt_free(myNodes_);
-  if(this->greenLinks_!=NULL)
+  if(this->greenLinks_!=nullptr)
     xbt_free(greenLinks_);
-  if(this->blackLinks_!=NULL)
+  if(this->blackLinks_!=nullptr)
     xbt_free(blackLinks_);
-  if(this->blueLinks_!=NULL)
+  if(this->blueLinks_!=nullptr)
     xbt_free(blueLinks_);
 }
 
@@ -143,8 +139,8 @@ for(i=0;i<this->numGroups_;i++){
 
 
 void AsClusterDragonfly::createLink(char* id, int numlinks, Link** linkup, Link** linkdown){
-  *linkup=NULL;
-  *linkdown=NULL;
+  *linkup=nullptr;
+  *linkdown=nullptr;
   s_sg_platf_link_cbarg_t linkTemplate;
   memset(&linkTemplate, 0, sizeof(linkTemplate));
   linkTemplate.bandwidth = this->cluster_->bw * numlinks;
@@ -175,12 +171,12 @@ void AsClusterDragonfly::createLink(char* id, int numlinks, Link** linkup, Link*
 
 void AsClusterDragonfly::generateLinks() {
 
-  unsigned int i, j, k, l,m;
+  unsigned int i, j, k, l;
   static int uniqueId = 0;
-  char* id = NULL;
+  char* id = nullptr;
   Link* linkup, *linkdown;
 
-  int numRouters = this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;
+  unsigned int numRouters = this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;
 
   if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX)
     numLinksperLink_=2;