version 1.5, 2001/11/19 19:02:14 |
version 1.6, 2002/03/25 16:30:55 |
|
|
printf( "[addarc] %d arcs from %s to %s\n" , |
printf( "[addarc] %d arcs from %s to %s\n" , |
count , parentp -> name , childp -> name ); |
count , parentp -> name , childp -> name ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
arcp = arclookup( parentp , childp ); |
arcp = arclookup( parentp , childp ); |
if ( arcp != 0 ) { |
if ( arcp != 0 ) { |
/* |
/* |
|
|
printf( "[tally] hit %d += %d\n" , |
printf( "[tally] hit %d += %d\n" , |
arcp -> arc_count , count ); |
arcp -> arc_count , count ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
arcp -> arc_count += count; |
arcp -> arc_count += count; |
return; |
return; |
} |
} |
|
|
if ( debug & BREAKCYCLE ) { |
if ( debug & BREAKCYCLE ) { |
printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle ); |
printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
if ( pass == 1 ) { |
if ( pass == 1 ) { |
printf( "\n\n%s %s\n%s %d:\n" , |
printf( "\n\n%s %s\n%s %d:\n" , |
"The following arcs were deleted" , |
"The following arcs were deleted" , |
|
|
printf( "\n" ); |
printf( "\n" ); |
} |
} |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
/* |
/* |
* starting from the topological top, |
* starting from the topological top, |
* propagate print flags to children. |
* propagate print flags to children. |
|
|
printname( parentp ); |
printname( parentp ); |
printf( "\n[dotime] share %f\n" , share ); |
printf( "\n[dotime] share %f\n" , share ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
} |
} |
} |
} |
|
|
|
|
printname( nlp ); |
printname( nlp ); |
printf( " is the head of cycle %d\n" , cycle ); |
printf( " is the head of cycle %d\n" , cycle ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
/* |
/* |
* link members to cycle header |
* link members to cycle header |
*/ |
*/ |
|
|
printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" , |
printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" , |
cycleno , ncycle , size ); |
cycleno , ncycle , size ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) { |
for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) { |
stkp = &cyclestack[0]; |
stkp = &cyclestack[0]; |
nlp -> flags |= CYCLEHEAD; |
nlp -> flags |= CYCLEHEAD; |
|
|
printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n", |
printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n", |
"[doarcs]" , visited , viable , newcycle , oldcycle); |
"[doarcs]" , visited , viable , newcycle , oldcycle); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
return (done); |
return (done); |
} |
} |
|
|
|
|
for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) { |
for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) { |
# ifdef DEBUG |
# ifdef DEBUG |
visited++; |
visited++; |
# endif DEBUG |
# endif /* DEBUG */ |
if ( arcp -> arc_childp -> cycleno != node -> cycleno |
if ( arcp -> arc_childp -> cycleno != node -> cycleno |
|| ( arcp -> arc_childp -> flags & VISITED ) |
|| ( arcp -> arc_childp -> flags & VISITED ) |
|| ( arcp -> arc_flags & DEADARC ) ) |
|| ( arcp -> arc_flags & DEADARC ) ) |
continue; |
continue; |
# ifdef DEBUG |
# ifdef DEBUG |
viable++; |
viable++; |
# endif DEBUG |
# endif /* DEBUG */ |
*stkp = arcp; |
*stkp = arcp; |
if ( arcp -> arc_childp -> flags & CYCLEHEAD ) { |
if ( arcp -> arc_childp -> flags & CYCLEHEAD ) { |
if ( addcycle( stkstart , stkp ) == FALSE ) |
if ( addcycle( stkstart , stkp ) == FALSE ) |
|
|
if ( arcpp == endlist ) { |
if ( arcpp == endlist ) { |
# ifdef DEBUG |
# ifdef DEBUG |
oldcycle++; |
oldcycle++; |
# endif DEBUG |
# endif /* DEBUG */ |
return( TRUE ); |
return( TRUE ); |
} |
} |
} |
} |
|
|
if ( debug & SUBCYCLELIST ) { |
if ( debug & SUBCYCLELIST ) { |
printsubcycle( clp ); |
printsubcycle( clp ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
cyclecnt++; |
cyclecnt++; |
if ( cyclecnt >= CYCLEMAX ) |
if ( cyclecnt >= CYCLEMAX ) |
return( FALSE ); |
return( FALSE ); |
|
|
maxarcp = maxexitarcp; |
maxarcp = maxexitarcp; |
# ifdef DEBUG |
# ifdef DEBUG |
type = "exit"; |
type = "exit"; |
# endif DEBUG |
# endif /* DEBUG */ |
} else if ( maxwithparentcnt > 0 ) { |
} else if ( maxwithparentcnt > 0 ) { |
/* |
/* |
* second choice is edge leading to node with at least one |
* second choice is edge leading to node with at least one |
|
|
maxarcp = maxwithparentarcp; |
maxarcp = maxwithparentarcp; |
# ifdef DEBUG |
# ifdef DEBUG |
type = "internal"; |
type = "internal"; |
# endif DEBUG |
# endif /* DEBUG */ |
} else { |
} else { |
/* |
/* |
* last choice is edge leading to node with only this arc as |
* last choice is edge leading to node with only this arc as |
|
|
maxarcp = maxnoparentarcp; |
maxarcp = maxnoparentarcp; |
# ifdef DEBUG |
# ifdef DEBUG |
type = "orphan"; |
type = "orphan"; |
# endif DEBUG |
# endif /* DEBUG */ |
} |
} |
maxarcp -> arc_flags |= DEADARC; |
maxarcp -> arc_flags |= DEADARC; |
maxarcp -> arc_childp -> parentcnt -= 1; |
maxarcp -> arc_childp -> parentcnt -= 1; |
|
|
maxarcp -> arc_parentp -> name, maxarcp -> arc_count, |
maxarcp -> arc_parentp -> name, maxarcp -> arc_count, |
maxarcp -> arc_childp -> name, maxarcp -> arc_cyclecnt); |
maxarcp -> arc_childp -> name, maxarcp -> arc_cyclecnt); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
printf("\t%s to %s with %ld calls\n", maxarcp->arc_parentp -> name, |
printf("\t%s to %s with %ld calls\n", maxarcp->arc_parentp -> name, |
maxarcp->arc_childp->name, maxarcp->arc_count); |
maxarcp->arc_childp->name, maxarcp->arc_count); |
prev = &cyclehead; |
prev = &cyclehead; |
|
|
printf( " inherits printflag %d and propfraction %f\n" , |
printf( " inherits printflag %d and propfraction %f\n" , |
childp -> printflag , childp -> propfraction ); |
childp -> printflag , childp -> propfraction ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
if ( ! childp -> printflag ) { |
if ( ! childp -> printflag ) { |
/* |
/* |
* printflag is off |
* printflag is off |
|
|
printf( "time %f propself %f printtime %f\n" , |
printf( "time %f propself %f printtime %f\n" , |
childp -> time , childp -> propself , printtime ); |
childp -> time , childp -> propself , printtime ); |
} |
} |
# endif DEBUG |
# endif /* DEBUG */ |
} |
} |
} |
} |
|
|