NAMD
Public Member Functions | Public Attributes | List of all members
cr_sortop_reverse_priority Struct Reference

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.

1063  : distop(sod), pr(patchrecs) { }
const ComputeNonbondedCUDA::patch_record * pr
cr_sortop_reverse_priority::cr_sortop_reverse_priority ( cr_sortop_distance sod,
const CudaComputeNonbonded::PatchRecord patchrecs 
)
inline

Definition at line 1568 of file CudaComputeNonbonded.C.

1569  : distop(sod), pr(patchrecs) { }
const ComputeNonbondedCUDA::patch_record * pr

Member Function Documentation

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

1083  { // i and j reversed
1084  int pidi = pid_compare_priority(i.pid[0],i.pid[1]) ? i.pid[0] : i.pid[1];
1085  int pidj = pid_compare_priority(j.pid[0],j.pid[1]) ? j.pid[0] : j.pid[1];
1086  if ( pidi != pidj ) return pid_compare_priority(pidi, pidj);
1087  return distop(i,j);
1088  }
bool pid_compare_priority(int pidi, int pidj)
bool cr_sortop_reverse_priority::operator() ( CudaComputeNonbonded::ComputeRecord  j,
CudaComputeNonbonded::ComputeRecord  i 
)
inline

Definition at line 1588 of file CudaComputeNonbonded.C.

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

1589  { // i and j reversed
1590  // Choose patch i (= patch with greater priority)
1591  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]);
1592  // Choose patch j
1593  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]);
1594  if ( pidi.x != pidj.x ) return pid_compare_priority(pidi, pidj);
1595  return distop(i,j);
1596  }
bool pid_compare_priority(int pidi, int pidj)
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()().

1064  {
1065  const ComputeNonbondedCUDA::patch_record &pri = pr[pidi];
1066  const ComputeNonbondedCUDA::patch_record &prj = pr[pidj];
1067  if ( pri.isSamePhysicalNode && ! prj.isSamePhysicalNode ) return 0;
1068  if ( prj.isSamePhysicalNode && ! pri.isSamePhysicalNode ) return 1;
1069  if ( pri.isSameNode && ! prj.isSameNode ) return 0;
1070  if ( prj.isSameNode && ! pri.isSameNode ) return 1;
1071  if ( pri.isSameNode ) { // and prj.isSameNode
1072  int rpri = pri.reversePriorityRankInPe;
1073  int rprj = prj.reversePriorityRankInPe;
1074  if ( rpri != rprj ) return rpri > rprj;
1075  return sortop_bitreverse(CkRankOf(pri.hostPe),CkRankOf(prj.hostPe));
1076  }
1077  int ppi = PATCH_PRIORITY(pidi);
1078  int ppj = PATCH_PRIORITY(pidj);
1079  if ( ppi != ppj ) return ppi < ppj;
1080  return pidi < pidj;
1081  }
static bool sortop_bitreverse(int a, int b)
const ComputeNonbondedCUDA::patch_record * pr
#define PATCH_PRIORITY(PID)
Definition: Priorities.h:25
bool cr_sortop_reverse_priority::pid_compare_priority ( int2  pidi,
int2  pidj 
)
inline

Definition at line 1570 of file CudaComputeNonbonded.C.

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

1570  {
1571  const CudaComputeNonbonded::PatchRecord &pri = pr[pidi.y];
1572  const CudaComputeNonbonded::PatchRecord &prj = pr[pidj.y];
1573  if ( pri.isSamePhysicalNode && ! prj.isSamePhysicalNode ) return 0;
1574  if ( prj.isSamePhysicalNode && ! pri.isSamePhysicalNode ) return 1;
1575  if ( pri.isSameNode && ! prj.isSameNode ) return 0;
1576  if ( prj.isSameNode && ! pri.isSameNode ) return 1;
1577  if ( pri.isSameNode ) { // and prj.isSameNode
1578  int rpri = pri.reversePriorityRankInPe;
1579  int rprj = prj.reversePriorityRankInPe;
1580  if ( rpri != rprj ) return rpri > rprj;
1581  return sortop_bitreverse(CkRankOf(pri.pe),CkRankOf(prj.pe));
1582  }
1583  int ppi = PATCH_PRIORITY(pidi.x);
1584  int ppj = PATCH_PRIORITY(pidj.x);
1585  if ( ppi != ppj ) return ppi < ppj;
1586  return pidi.x < pidj.x;
1587  }
const ComputeNonbondedCUDA::patch_record * pr
static bool sortop_bitreverse(int a, int b)
#define PATCH_PRIORITY(PID)
Definition: Priorities.h:25

Member Data Documentation

cr_sortop_distance & cr_sortop_reverse_priority::distop

Definition at line 1060 of file ComputeNonbondedCUDA.C.

Referenced by operator()().

const ComputeNonbondedCUDA::patch_record* cr_sortop_reverse_priority::pr

Definition at line 1061 of file ComputeNonbondedCUDA.C.

Referenced by pid_compare_priority().

const CudaComputeNonbonded::PatchRecord* cr_sortop_reverse_priority::pr

Definition at line 1567 of file CudaComputeNonbonded.C.


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