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

394  {
395 
396  if ( ! cudaCompute ) NAMD_bug("register_pair called early");
397 
398  cudaCompute->requirePatch(pid[0]);
399  cudaCompute->requirePatch(pid[1]);
400 
402  cr.c = c;
403  cr.pid[0] = pid[0]; cr.pid[1] = pid[1];
404 
405  int t1 = t[0];
406  int t2 = t[1];
407  Vector offset = cudaCompute->patchMap->center(pid[0])
408  - cudaCompute->patchMap->center(pid[1]);
409  offset.x += (t1%3-1) - (t2%3-1);
410  offset.y += ((t1/3)%3-1) - ((t2/3)%3-1);
411  offset.z += (t1/9-1) - (t2/9-1);
412  cr.offset = offset;
413 
414  if ( cudaCompute->patchRecords[pid[0]].isLocal ) {
416  } else {
418  }
419 }
Definition: Vector.h:64
BigReal z
Definition: Vector.h:66
void NAMD_bug(const char *err_msg)
Definition: common.C:129
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 377 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().

377  {
378 
379  if ( ! cudaCompute ) NAMD_bug("register_self called early");
380 
382 
384  cr.c = c;
385  cr.pid[0] = pid; cr.pid[1] = pid;
386  cr.offset = 0.;
387  if ( cudaCompute->patchRecords[pid].isLocal ) {
389  } else {
391  }
392 }
void NAMD_bug(const char *err_msg)
Definition: common.C:129
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 421 of file ComputeNonbondedCUDA.C.

References NAMD_bug().

421  { // static
422 
423  NAMD_bug("unregister_compute unimplemented");
424 
425 }
void NAMD_bug(const char *err_msg)
Definition: common.C:129