コード例 #1
0
ファイル: target.c プロジェクト: llvm-mirror/test-suite
// This file contains routines that modify the number of blocks so that the
// number is close (+- 3) to the target number of blocks for the problem.
int reduce_blocks()
{
   int l, i, j, p, c, num_comb, comb, num_parents, nm_t;
   double t1, t2, t3;
   parent *pp;

   nm_t = 0;
   t3 = 0.0;
   t1 = timer();

   zero_refine();
   if (target_active)
      num_comb = (global_active - num_pes*target_active + 3)/7;
   else
      num_comb = (global_active - num_pes*target_active)/7;

   for (comb = 0, l = num_refine-1; comb < num_comb; l--) {
      for (p = 0; p < max_active_parent; p++)
         if ((pp = &parents[p])->number >= 0)
            if (pp->level == l)
               num_parents++;

      for (p = 0; p < max_active_parent && comb < num_comb; p++)
         if ((pp = &parents[p])->number >= 0)
            if (pp->level == l) {
               pp->refine = -1;
               comb++;
               for (c = 0; c < 8; c++)
                  if (pp->child_node[c] == my_pe && pp->child[c] >= 0)
                     blocks[pp->child[c]].refine = -1;
            }

      t2 = timer() - t2;
      consolidate_blocks();
      t3 += timer() - t2;
   }
   timer_target_rb += timer() - t1;
   timer_target_dc += timer() - t1 - t3;
   timer_target_cb += t3;

   return(nm_t);
}
コード例 #2
0
ファイル: splicer.C プロジェクト: Singular/LELA
void Splicer::consolidate ()
{
	consolidate_blocks (_horiz_blocks);
	consolidate_blocks (_vert_blocks);
}