X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/558cfc9fc06c8d1a7206b5995d3736cc11319529..8fe7143ac15490fc64aaf5f88c08bcf489a1e9f1:/examples/smpi/NAS/DGraph.c diff --git a/examples/smpi/NAS/DGraph.c b/examples/smpi/NAS/DGraph.c index 6dd0ed353c..ad4f682106 100644 --- a/examples/smpi/NAS/DGraph.c +++ b/examples/smpi/NAS/DGraph.c @@ -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;