cr_sortop_reverse_priority Struct Reference

List of all members.

Public Member Functions

 cr_sortop_reverse_priority (cr_sortop_distance &sod, const ComputeNonbondedCUDA::patch_record *patchrecs)
bool pid_compare_priority (int pidi, int pidj)
bool operator() (ComputeNonbondedCUDA::compute_record j, ComputeNonbondedCUDA::compute_record i)
 cr_sortop_reverse_priority (cr_sortop_distance &sod, const CudaComputeNonbonded::PatchRecord *patchrecs)
bool pid_compare_priority (int2 pidi, int2 pidj)
bool operator() (CudaComputeNonbonded::ComputeRecord j, CudaComputeNonbonded::ComputeRecord i)

Public Attributes

cr_sortop_distancedistop
const ComputeNonbondedCUDA::patch_recordpr
cr_sortop_distancedistop
const CudaComputeNonbonded::PatchRecordpr

Detailed Description

Definition at line 1384 of file ComputeNonbondedCUDA.C.


Constructor & Destructor Documentation

cr_sortop_reverse_priority::cr_sortop_reverse_priority ( cr_sortop_distance sod,
const ComputeNonbondedCUDA::patch_record patchrecs 
) [inline]

Definition at line 1387 of file ComputeNonbondedCUDA.C.

01388                                                           : distop(sod), pr(patchrecs) { }

cr_sortop_reverse_priority::cr_sortop_reverse_priority ( cr_sortop_distance sod,
const CudaComputeNonbonded::PatchRecord patchrecs 
) [inline]

Definition at line 1562 of file CudaComputeNonbonded.C.

01563                                                          : distop(sod), pr(patchrecs) { }


Member Function Documentation

bool cr_sortop_reverse_priority::operator() ( CudaComputeNonbonded::ComputeRecord  j,
CudaComputeNonbonded::ComputeRecord  i 
) [inline]

Definition at line 1582 of file CudaComputeNonbonded.C.

References distop, j, CudaComputeNonbonded::ComputeRecord::patchInd, CudaComputeNonbonded::ComputeRecord::pid, and pid_compare_priority().

01583                                            {  // i and j reversed
01584     // Choose patch i (= patch with greater priority)
01585     int2 pidi = pid_compare_priority(make_int2(i.pid[0], i.patchInd[0]), make_int2(i.pid[1], i.patchInd[1])) ? make_int2(i.pid[0], i.patchInd[0]) : make_int2(i.pid[1], i.patchInd[1]);
01586     // Choose patch j
01587     int2 pidj = pid_compare_priority(make_int2(j.pid[0], j.patchInd[0]), make_int2(j.pid[1], j.patchInd[1])) ? make_int2(j.pid[0], j.patchInd[0]) : make_int2(j.pid[1], j.patchInd[1]);
01588     if ( pidi.x != pidj.x ) return pid_compare_priority(pidi, pidj);
01589     return distop(i,j);
01590   }

bool cr_sortop_reverse_priority::operator() ( ComputeNonbondedCUDA::compute_record  j,
ComputeNonbondedCUDA::compute_record  i 
) [inline]

Definition at line 1407 of file ComputeNonbondedCUDA.C.

References distop, j, ComputeNonbondedCUDA::compute_record::pid, and pid_compare_priority().

01408                                                               {  // i and j reversed
01409     int pidi = pid_compare_priority(i.pid[0],i.pid[1]) ? i.pid[0] : i.pid[1];
01410     int pidj = pid_compare_priority(j.pid[0],j.pid[1]) ? j.pid[0] : j.pid[1];
01411     if ( pidi != pidj ) return pid_compare_priority(pidi, pidj);
01412     return distop(i,j);
01413   }

bool cr_sortop_reverse_priority::pid_compare_priority ( int2  pidi,
int2  pidj 
) [inline]

Definition at line 1564 of file CudaComputeNonbonded.C.

References CudaComputeNonbonded::PatchRecord::isSameNode, CudaComputeNonbonded::PatchRecord::isSamePhysicalNode, PATCH_PRIORITY, CudaComputeNonbonded::PatchRecord::pe, CudaComputeNonbonded::PatchRecord::reversePriorityRankInPe, and sortop_bitreverse().

01564                                                   {
01565     const CudaComputeNonbonded::PatchRecord &pri = pr[pidi.y];
01566     const CudaComputeNonbonded::PatchRecord &prj = pr[pidj.y];
01567     if ( pri.isSamePhysicalNode && ! prj.isSamePhysicalNode ) return 0;
01568     if ( prj.isSamePhysicalNode && ! pri.isSamePhysicalNode ) return 1;
01569     if ( pri.isSameNode && ! prj.isSameNode ) return 0;
01570     if ( prj.isSameNode && ! pri.isSameNode ) return 1;
01571     if ( pri.isSameNode ) {  // and prj.isSameNode
01572       int rpri = pri.reversePriorityRankInPe;
01573       int rprj = prj.reversePriorityRankInPe;
01574       if ( rpri != rprj ) return rpri > rprj;
01575       return sortop_bitreverse(CkRankOf(pri.pe),CkRankOf(prj.pe));
01576     }
01577     int ppi = PATCH_PRIORITY(pidi.x);
01578     int ppj = PATCH_PRIORITY(pidj.x);
01579     if ( ppi != ppj ) return ppi < ppj;
01580     return pidi.x < pidj.x;
01581   }

bool cr_sortop_reverse_priority::pid_compare_priority ( int  pidi,
int  pidj 
) [inline]

Definition at line 1389 of file ComputeNonbondedCUDA.C.

References ComputeNonbondedCUDA::patch_record::hostPe, ComputeNonbondedCUDA::patch_record::isSameNode, ComputeNonbondedCUDA::patch_record::isSamePhysicalNode, PATCH_PRIORITY, pr, ComputeNonbondedCUDA::patch_record::reversePriorityRankInPe, and sortop_bitreverse().

Referenced by operator()().

01389                                                 {
01390     const ComputeNonbondedCUDA::patch_record &pri = pr[pidi];
01391     const ComputeNonbondedCUDA::patch_record &prj = pr[pidj];
01392     if ( pri.isSamePhysicalNode && ! prj.isSamePhysicalNode ) return 0;
01393     if ( prj.isSamePhysicalNode && ! pri.isSamePhysicalNode ) return 1;
01394     if ( pri.isSameNode && ! prj.isSameNode ) return 0;
01395     if ( prj.isSameNode && ! pri.isSameNode ) return 1;
01396     if ( pri.isSameNode ) {  // and prj.isSameNode
01397       int rpri = pri.reversePriorityRankInPe;
01398       int rprj = prj.reversePriorityRankInPe;
01399       if ( rpri != rprj ) return rpri > rprj;
01400       return sortop_bitreverse(CkRankOf(pri.hostPe),CkRankOf(prj.hostPe));
01401     }
01402     int ppi = PATCH_PRIORITY(pidi);
01403     int ppj = PATCH_PRIORITY(pidj);
01404     if ( ppi != ppj ) return ppi < ppj;
01405     return pidi < pidj;
01406   }


Member Data Documentation

cr_sortop_distance& cr_sortop_reverse_priority::distop

Definition at line 1560 of file CudaComputeNonbonded.C.

cr_sortop_distance& cr_sortop_reverse_priority::distop

Definition at line 1385 of file ComputeNonbondedCUDA.C.

Referenced by operator()().

const CudaComputeNonbonded::PatchRecord* cr_sortop_reverse_priority::pr

Definition at line 1561 of file CudaComputeNonbonded.C.

const ComputeNonbondedCUDA::patch_record* cr_sortop_reverse_priority::pr

Definition at line 1386 of file ComputeNonbondedCUDA.C.

Referenced by pid_compare_priority().


The documentation for this struct was generated from the following files:
Generated on Sat Sep 23 01:17:19 2017 for NAMD by  doxygen 1.4.7