// wrapper void CPathEstimator::CalcOffsetsAndPathCosts(int minBlock, int maxBlock, int threadID) { // NOTE: EstimatePathCosts() [B] is temporally dependent on CalculateBlockOffsets() [A], // A must be completely finished before B_i can be safely called. This means we cannot // let thread i execute (A_i, B_i), but instead have to split the work such that every // thread finishes its part of A before any starts B_i. Hence this wrapper function is // no longer called when more than one thread is spawned in InitEstimator(). CalculateBlockOffsets(minBlock, maxBlock, threadID); EstimatePathCosts(minBlock, maxBlock, threadID); }
void CPathEstimator::CalcOffsetsAndPathCosts(int thread) { streflop_init<streflop::Simple>(); // NOTE: EstimatePathCosts() [B] is temporally dependent on CalculateBlockOffsets() [A], // A must be completely finished before B_i can be safely called. This means we cannot // let thread i execute (A_i, B_i), but instead have to split the work such that every // thread finishes its part of A before any starts B_i. int nbr = nbrOfBlocks - 1; int i; while((i = --offsetBlockNum) >= 0) CalculateBlockOffsets(nbr - i, thread); pathBarrier->wait(); while((i = --costBlockNum) >= 0) EstimatePathCosts(nbr - i, thread); }