Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #181 from bcamus/master
[simgrid.git] / examples / smpi / NAS / DGraph.c
index 6dd0ed3..ad4f682 100644 (file)
@@ -10,6 +10,7 @@ DGArc *newArc(DGNode *tl,DGNode *hd){
   ar->head=hd;
   return ar;
 }
+
 void arcShow(DGArc *ar){
   DGNode *tl=(DGNode *)ar->tail,
          *hd=(DGNode *)ar->head;
@@ -30,12 +31,13 @@ DGNode *newNode(char *nm){
   nd->feat=NULL;
   return nd;
 }
+
 void nodeShow(DGNode* nd){
   fprintf( stderr,"%3d.%s: (%d,%d)\n", nd->id,nd->name,nd->inDegree,nd->outDegree);
 /*
   if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
   else if(nd->verified==0)  fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
-  else  fprintf(stderr,"%ld.%s\t: notverified.",nd->id,nd->name);   
+  else  fprintf(stderr,"%ld.%s\t: notverified.",nd->id,nd->name);
 */
 }
 
@@ -81,7 +83,7 @@ int AttachNode(DGraph* dg, DGNode* nd) {
       }
       memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
       tmpnd->inDegree += nd->inDegree;
-    }   
+    }
     if ( nd->outDegree > 0 ) {
       tmpnd->maxOutDegree += nd->maxOutDegree;
       ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
@@ -94,7 +96,7 @@ int AttachNode(DGraph* dg, DGNode* nd) {
       memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
       tmpnd->outDegree += nd->outDegree;
     }
-    free(nd); 
+    free(nd);
     return i;
   }
   nd->id = dg->numNodes;