Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

static void Impala::Core::Array::Pattern::PxGetSBTorder ( int  root,
int  orderLength,
int *  order,
int *  myIndex 
) [inline, static]

Definition at line 196 of file PxDistribution.h.

References _logCPUs, _myCPU, and _nrCPUs.

Referenced by PxBcastArraySBT(), PxBcastValueSBT(), PxGatherArraySBT(), PxReduceValueToRootSBT(), and PxScatterArraySBT().

00197 {
00198     /*** Determine ordering of CPUs in Spanning Binomial Tree ***/
00199 
00200     if (root >= _nrCPUs) {
00201         return;
00202     }
00203     *myIndex    = 0;
00204     order[0]    = root;
00205     int rootTmp = root;
00206     int index   = orderLength / 2;
00207 
00208     for (int i=0; i<_logCPUs; i++) {
00209         if (rootTmp < index) {
00210             for (int j=0; j<index; j++) {
00211                 int cpu = index+j + root-rootTmp;
00212                 if (cpu == _myCPU) {
00213                     *myIndex = index+j;
00214                 }
00215                 order[index+j] = cpu;
00216             }
00217         } else {
00218             for (int j=0; j<index; j++) {
00219                 int cpu = j + root-rootTmp;
00220                 if (cpu == _myCPU) {
00221                     *myIndex = index+j;
00222                 }
00223                 order[index+j] = cpu;
00224             }
00225             rootTmp -= index;
00226         }
00227         index /= 2;
00228     }
00229 }


Generated on Fri Mar 19 11:02:34 2010 for ImpalaSrc by  doxygen 1.5.1