NAMD
Classes | Macros | Typedefs | Functions
ComputeNonbondedUtil.h File Reference
#include "NamdTypes.h"
#include "ReductionMgr.h"
#include "Molecule.h"

Go to the source code of this file.

Classes

class  Pairlists
 
class  ComputeNonbondedWorkArrays
 
struct  GBISParamStruct
 
struct  nonbonded
 
class  ComputeNonbondedUtil
 

Macros

#define NBWORKARRAYSINIT(ARRAYS)   ComputeNonbondedWorkArrays* const computeNonbondedWorkArrays = ARRAYS;
 
#define NBWORKARRAY(TYPE, NAME, SIZE)
 
#define VDW_SWITCH_MODE_ENERGY   0
 
#define VDW_SWITCH_MODE_MARTINI   1
 
#define VDW_SWITCH_MODE_FORCE   2
 

Typedefs

typedef unsigned short plint
 

Functions

void register_cuda_compute_self (ComputeID c, PatchID pid)
 
void register_cuda_compute_pair (ComputeID c, PatchID pid[], int t[])
 
void unregister_cuda_compute (ComputeID c)
 

Macro Definition Documentation

#define NBWORKARRAY (   TYPE,
  NAME,
  SIZE 
)
Value:
computeNonbondedWorkArrays->NAME.resize(SIZE); \
TYPE * const NAME = computeNonbondedWorkArrays->NAME.begin();
#define NAME

Definition at line 97 of file ComputeNonbondedUtil.h.

#define NBWORKARRAYSINIT (   ARRAYS)    ComputeNonbondedWorkArrays* const computeNonbondedWorkArrays = ARRAYS;

Definition at line 88 of file ComputeNonbondedUtil.h.

#define VDW_SWITCH_MODE_ENERGY   0

Definition at line 416 of file ComputeNonbondedUtil.h.

Referenced by for(), and ComputeNonbondedUtil::select().

#define VDW_SWITCH_MODE_FORCE   2

Definition at line 418 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedUtil::select().

#define VDW_SWITCH_MODE_MARTINI   1

Definition at line 417 of file ComputeNonbondedUtil.h.

Referenced by for(), and ComputeNonbondedUtil::select().

Typedef Documentation

typedef unsigned short plint

Definition at line 33 of file ComputeNonbondedUtil.h.

Function Documentation

void register_cuda_compute_pair ( ComputeID  c,
PatchID  pid[],
int  t[] 
)

Definition at line 390 of file ComputeNonbondedCUDA.C.

References ComputeNonbondedCUDA::compute_record::c, PatchMap::center(), cudaCompute, ComputeNonbondedCUDA::localComputeRecords, NAMD_bug(), ComputeNonbondedCUDA::compute_record::offset, ComputeNonbondedCUDA::patchMap, ComputeNonbondedCUDA::patchRecords, ComputeNonbondedCUDA::compute_record::pid, ComputeNonbondedCUDA::remoteComputeRecords, ComputeNonbondedCUDA::requirePatch(), Vector::x, Vector::y, and Vector::z.

Referenced by ComputeNonbondedPair::initialize().

390  {
391 
392  if ( ! cudaCompute ) NAMD_bug("register_pair called early");
393 
394  cudaCompute->requirePatch(pid[0]);
395  cudaCompute->requirePatch(pid[1]);
396 
398  cr.c = c;
399  cr.pid[0] = pid[0]; cr.pid[1] = pid[1];
400 
401  int t1 = t[0];
402  int t2 = t[1];
403  Vector offset = cudaCompute->patchMap->center(pid[0])
404  - cudaCompute->patchMap->center(pid[1]);
405  offset.x += (t1%3-1) - (t2%3-1);
406  offset.y += ((t1/3)%3-1) - ((t2/3)%3-1);
407  offset.z += (t1/9-1) - (t2/9-1);
408  cr.offset = offset;
409 
410  if ( cudaCompute->patchRecords[pid[0]].isLocal ) {
412  } else {
414  }
415 }
Definition: Vector.h:64
BigReal z
Definition: Vector.h:66
void NAMD_bug(const char *err_msg)
Definition: common.C:123
BigReal x
Definition: Vector.h:66
ResizeArray< compute_record > localComputeRecords
ResizeArray< compute_record > remoteComputeRecords
ScaledPosition center(int pid) const
Definition: PatchMap.h:99
BigReal y
Definition: Vector.h:66
ResizeArray< patch_record > patchRecords
static __thread ComputeNonbondedCUDA * cudaCompute
void register_cuda_compute_self ( ComputeID  c,
PatchID  pid 
)

Definition at line 373 of file ComputeNonbondedCUDA.C.

References ComputeNonbondedCUDA::compute_record::c, cudaCompute, ComputeNonbondedCUDA::localComputeRecords, NAMD_bug(), ComputeNonbondedCUDA::compute_record::offset, ComputeNonbondedCUDA::patchRecords, ComputeNonbondedCUDA::compute_record::pid, ComputeNonbondedCUDA::remoteComputeRecords, and ComputeNonbondedCUDA::requirePatch().

Referenced by ComputeNonbondedSelf::initialize().

373  {
374 
375  if ( ! cudaCompute ) NAMD_bug("register_self called early");
376 
378 
380  cr.c = c;
381  cr.pid[0] = pid; cr.pid[1] = pid;
382  cr.offset = 0.;
383  if ( cudaCompute->patchRecords[pid].isLocal ) {
385  } else {
387  }
388 }
void NAMD_bug(const char *err_msg)
Definition: common.C:123
ResizeArray< compute_record > localComputeRecords
ResizeArray< compute_record > remoteComputeRecords
ResizeArray< patch_record > patchRecords
static __thread ComputeNonbondedCUDA * cudaCompute
void unregister_cuda_compute ( ComputeID  c)

Definition at line 417 of file ComputeNonbondedCUDA.C.

References NAMD_bug().

417  { // static
418 
419  NAMD_bug("unregister_compute unimplemented");
420 
421 }
void NAMD_bug(const char *err_msg)
Definition: common.C:123