legacy_sources/v1/libparallel.c
/*----------------------------------------------------------*/
/* Sort wp depending on their number of dependencies		*/
/*----------------------------------------------------------*/
Sort wp depending on their number of dependencies
Sort wp depending on their number of dependencies
void EndDependency(float DepSta[2])
{
	int i;
	DepSta[0] = DepSta[1] = 0.;
	for(i=0;i<par->CurTyp->NmbWrk;i++)
	{
		DepSta[0] += par->CurTyp->WrkTab[i].NmbBit;
		if(par->CurTyp->WrkTab[i].NmbBit > DepSta[1])
			DepSta[1] = par->CurTyp->WrkTab[i].NmbBit;
	}
	DepSta[0] = 100 * DepSta[0] / (par->CurTyp->NmbWrk * par->CurTyp->NmbDep * 32);
	DepSta[1] = 100 * DepSta[1] / (par->CurTyp->NmbDep * 32);
	qsort(par->CurTyp->WrkTab, par->CurTyp->NmbWrk, sizeof(WrkSct), CmpWrk);
	par->CurTyp = NULL;
}
void EndDependency ( float DepSta [ 2 ] ) { int i ; DepSta [ 0 ] = DepSta [ 1 ] = 0. ; for ( i = 0 ; i < par -> CurTyp -> NmbWrk ; i ++ ) { DepSta [ 0 ] += par -> CurTyp -> WrkTab [ i ] . NmbBit ; if ( par -> CurTyp -> WrkTab [ i ] . NmbBit > DepSta [ 1 ] ) DepSta [ 1 ] = par -> CurTyp -> WrkTab [ i ] . NmbBit ; } DepSta [ 0 ] = 100 * DepSta [ 0 ] / ( par -> CurTyp -> NmbWrk * par -> CurTyp -> NmbDep * 32 ) ; DepSta [ 1 ] = 100 * DepSta [ 1 ] / ( par -> CurTyp -> NmbDep * 32 ) ; qsort ( par -> CurTyp -> WrkTab , par -> CurTyp -> NmbWrk , sizeof ( WrkSct ) , CmpWrk ) ; par -> CurTyp = NULL ; }
Sort wp depending on their number of dependencies
Sort wp depending on their number of dependencies
/* Compute average and max number of collisions */ /* Sort WP from highest collision number to the lowest */