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_record
pr
const
CudaComputeNonbonded::PatchRecord
pr

Detailed Description

Definition at line 1059 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 1062 of file ComputeNonbondedCUDA.C.

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

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

Definition at line 1567 of file CudaComputeNonbonded.C.

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


Member Function Documentation

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

Definition at line 1587 of file CudaComputeNonbonded.C.

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

01588                                            {  // i and j reversed
01589     // Choose patch i (= patch with greater priority)
01590     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]);
01591     // Choose patch j
01592     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]);
01593     if ( pidi.x != pidj.x ) return pid_compare_priority(pidi, pidj);
01594     return distop(i,j);
01595   }

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

Definition at line 1082 of file ComputeNonbondedCUDA.C.

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

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

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

Definition at line 1569 of file CudaComputeNonbonded.C.

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

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

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

Definition at line 1064 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()().

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


Member Data Documentation

Definition at line 1060 of file ComputeNonbondedCUDA.C.

Referenced by operator()().

Definition at line 1566 of file CudaComputeNonbonded.C.

Definition at line 1061 of file ComputeNonbondedCUDA.C.

Referenced by pid_compare_priority().


The documentation for this struct was generated from the following files:

Generated on 8 Dec 2019 for NAMD by  doxygen 1.6.1