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 1060 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 1063 of file ComputeNonbondedCUDA.C.

01064                                                           : 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 1083 of file ComputeNonbondedCUDA.C.

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

01084                                                               {  // i and j reversed
01085     int pidi = pid_compare_priority(i.pid[0],i.pid[1]) ? i.pid[0] : i.pid[1];
01086     int pidj = pid_compare_priority(j.pid[0],j.pid[1]) ? j.pid[0] : j.pid[1];
01087     if ( pidi != pidj ) return pid_compare_priority(pidi, pidj);
01088     return distop(i,j);
01089   }

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 1065 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()().

01065                                                 {
01066     const ComputeNonbondedCUDA::patch_record &pri = pr[pidi];
01067     const ComputeNonbondedCUDA::patch_record &prj = pr[pidj];
01068     if ( pri.isSamePhysicalNode && ! prj.isSamePhysicalNode ) return 0;
01069     if ( prj.isSamePhysicalNode && ! pri.isSamePhysicalNode ) return 1;
01070     if ( pri.isSameNode && ! prj.isSameNode ) return 0;
01071     if ( prj.isSameNode && ! pri.isSameNode ) return 1;
01072     if ( pri.isSameNode ) {  // and prj.isSameNode
01073       int rpri = pri.reversePriorityRankInPe;
01074       int rprj = prj.reversePriorityRankInPe;
01075       if ( rpri != rprj ) return rpri > rprj;
01076       return sortop_bitreverse(CkRankOf(pri.hostPe),CkRankOf(prj.hostPe));
01077     }
01078     int ppi = PATCH_PRIORITY(pidi);
01079     int ppj = PATCH_PRIORITY(pidj);
01080     if ( ppi != ppj ) return ppi < ppj;
01081     return pidi < pidj;
01082   }


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 1061 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 1062 of file ComputeNonbondedCUDA.C.

Referenced by pid_compare_priority().


The documentation for this struct was generated from the following files:
Generated on Mon Feb 19 01:17:18 2018 for NAMD by  doxygen 1.4.7