NAMD
|
#include <CudaPmeSolverUtil.h>
Classes | |
struct | EnergyVirial |
Public Member Functions | |
CudaPmeOneDevice (PmeGrid pmeGrid_, int deviceID_, int deviceIndex_) | |
~CudaPmeOneDevice () | |
void | compute (const Lattice &lattice, int doEnergyVirial, int step) |
void | finishReduction (bool doEnergyVirial) |
int | getShiftedGrid (const double x, const int grid) |
int | computeSharedMemoryPatchLevelSpreadCharge (const int numThreads, const int3 patchGridDim, const int order) |
int | computeSharedMemoryPatchLevelGatherForce (const int numThreads, const int3 patchGridDim, const int order) |
void | checkPatchLevelSimParamCompatibility (const int order, const bool periodicY, const bool periodicZ) |
void | checkPatchLevelDeviceCompatibility () |
void | checkPatchLevelLatticeCompatibilityAndComputeOffsets (const Lattice &lattice, const int numPatches, const CudaLocalRecord *localRecords, double3 *patchMin, double3 *patchMax, double3 *awayDists) |
Public Attributes | |
PmeGrid | pmeGrid |
int | deviceID |
int | deviceIndex |
cudaStream_t | stream |
int | natoms |
size_t | num_used_grids |
float4 * | d_atoms |
int * | d_partition |
float3 * | d_forces |
float * | d_scaling_factors |
cudaTextureObject_t * | gridTexObjArrays |
float * | d_grids |
float2 * | d_trans |
size_t | gridsize |
size_t | transize |
cufftHandle * | forwardPlans |
cufftHandle * | backwardPlans |
float * | d_bm1 |
float * | d_bm2 |
float * | d_bm3 |
double | kappa |
EnergyVirial * | d_energyVirials |
EnergyVirial * | h_energyVirials |
bool | self_energy_alch_first_time |
bool | force_scaling_alch_first_time |
double * | d_selfEnergy |
double * | d_selfEnergy_FEP |
double * | d_selfEnergy_TI_1 |
double * | d_selfEnergy_TI_2 |
double | selfEnergy |
double | selfEnergy_FEP |
double | selfEnergy_TI_1 |
double | selfEnergy_TI_2 |
int | m_step |
PatchLevelPmeData | patchLevelPmeData |
Lattice | currentLattice |
PME for single GPU case, where data persists on GPU calls real space, FFT, and K space parts receives atom and charge data as float4 * allocated on device returns force data as float3 * allocated on device returns energy and virial allocated on device
Definition at line 209 of file CudaPmeSolverUtil.h.
CudaPmeOneDevice::CudaPmeOneDevice | ( | PmeGrid | pmeGrid_, |
int | deviceID_, | ||
int | deviceIndex_ | ||
) |
Definition at line 1300 of file CudaPmeSolverUtil.C.
References SimParameters::alchFepOn, SimParameters::alchGetNumOfPMEGrids(), SimParameters::alchOn, SimParameters::alchThermIntOn, backwardPlans, checkPatchLevelDeviceCompatibility(), checkPatchLevelSimParamCompatibility(), compute_b_moduli(), cudaCheck, cufftCheck, d_atoms, d_bm1, d_bm2, d_bm3, d_energyVirials, d_forces, d_grids, d_partition, d_scaling_factors, d_selfEnergy, d_selfEnergy_FEP, d_selfEnergy_TI_1, d_selfEnergy_TI_2, d_trans, deviceID, deviceIndex, forwardPlans, gridsize, gridTexObjArrays, h_energyVirials, PmeGrid::K1, PmeGrid::K2, PmeGrid::K3, Node::molecule, natoms, num_used_grids, Molecule::numAtoms, Node::Object(), PmeGrid::order, order, pmeGrid, Node::simParameters, stream, and transize.
CudaPmeOneDevice::~CudaPmeOneDevice | ( | ) |
Definition at line 1467 of file CudaPmeSolverUtil.C.
References backwardPlans, cudaCheck, cufftCheck, d_atoms, d_bm1, d_bm2, d_bm3, d_energyVirials, d_forces, d_grids, d_partition, PatchLevelPmeData::d_patchGridOffsets, d_scaling_factors, d_selfEnergy, d_selfEnergy_FEP, d_selfEnergy_TI_1, d_selfEnergy_TI_2, d_trans, forwardPlans, gridTexObjArrays, h_energyVirials, PatchLevelPmeData::h_patchGridOffsets, num_used_grids, patchLevelPmeData, and stream.
void CudaPmeOneDevice::checkPatchLevelDeviceCompatibility | ( | ) |
Definition at line 2033 of file CudaPmeSolverUtil.C.
References computeSharedMemoryPatchLevelGatherForce(), computeSharedMemoryPatchLevelSpreadCharge(), PatchLevelPmeData::deviceCompatible, deviceID, PatchLevelPmeData::deviceMaxSharedBytes, PatchLevelPmeData::gatherForceSharedBytes, PatchLevelPmeData::kNumThreads, PatchLevelPmeData::kPatchGridDim, PatchLevelPmeData::kPatchGridDimPad, patchLevelPmeData, and PatchLevelPmeData::spreadChargeSharedBytes.
Referenced by CudaPmeOneDevice().
void CudaPmeOneDevice::checkPatchLevelLatticeCompatibilityAndComputeOffsets | ( | const Lattice & | lattice, |
const int | numPatches, | ||
const CudaLocalRecord * | localRecords, | ||
double3 * | patchMin, | ||
double3 * | patchMax, | ||
double3 * | awayDists | ||
) |
Definition at line 2053 of file CudaPmeSolverUtil.C.
References Lattice::a(), Lattice::a_r(), Lattice::b(), Lattice::b_r(), Lattice::c(), Lattice::c_r(), currentLattice, PatchLevelPmeData::d_patchGridOffsets, PatchLevelPmeData::deviceCompatible, getShiftedGrid(), PatchLevelPmeData::h_patchGridOffsets, Lattice::isEqual(), PmeGrid::K1, PmeGrid::K2, PmeGrid::K3, PatchLevelPmeData::kPatchGridDim, PatchLevelPmeData::latticeCompatible, PatchLevelPmeData::localRecords, PatchLevelPmeData::numPatches, Node::Object(), PmeGrid::order, order, PatchLevelPmeData::patchGridDim, patchLevelPmeData, pmeGrid, Lattice::scale(), Node::simParameters, simParams, PatchLevelPmeData::simulationCompatible, Vector::unit(), Lattice::unscale(), and Vector::x.
void CudaPmeOneDevice::checkPatchLevelSimParamCompatibility | ( | const int | order, |
const bool | periodicY, | ||
const bool | periodicZ | ||
) |
Definition at line 2022 of file CudaPmeSolverUtil.C.
References deviceCUDA, DeviceCUDA::getNumDevice(), order, patchLevelPmeData, and PatchLevelPmeData::simulationCompatible.
Referenced by CudaPmeOneDevice().
void CudaPmeOneDevice::compute | ( | const Lattice & | lattice, |
int | doEnergyVirial, | ||
int | step | ||
) |
Definition at line 1510 of file CudaPmeSolverUtil.C.
References Lattice::a_r(), SimParameters::alchOn, Lattice::b_r(), backwardPlans, Lattice::c_r(), compute_selfEnergy(), cudaCheck, cufftCheck, d_atoms, d_bm1, d_bm2, d_bm3, d_energyVirials, d_forces, d_grids, d_selfEnergy, d_trans, deviceID, SimParameters::firstTimestep, forwardPlans, gather_force(), gridsize, gridTexObjArrays, h_energyVirials, PmeGrid::K1, PmeGrid::K2, PmeGrid::K3, kappa, m_step, natoms, num_used_grids, Node::Object(), PmeGrid::order, order, patchLevelPmeData, pmeGrid, scalar_sum(), selfEnergy, Node::simParameters, spread_charge(), spread_charge_v2(), stream, transize, Lattice::volume(), WARPSIZE, Vector::x, Vector::y, and Vector::z.
int CudaPmeOneDevice::computeSharedMemoryPatchLevelGatherForce | ( | const int | numThreads, |
const int3 | patchGridDim, | ||
const int | order | ||
) |
Definition at line 2012 of file CudaPmeSolverUtil.C.
References PatchLevelPmeData::kThetaPad, and order.
Referenced by checkPatchLevelDeviceCompatibility().
int CudaPmeOneDevice::computeSharedMemoryPatchLevelSpreadCharge | ( | const int | numThreads, |
const int3 | patchGridDim, | ||
const int | order | ||
) |
Definition at line 2001 of file CudaPmeSolverUtil.C.
References PatchLevelPmeData::kDim, PatchLevelPmeData::kThetaPad, and order.
Referenced by checkPatchLevelDeviceCompatibility().
void CudaPmeOneDevice::finishReduction | ( | bool | doEnergyVirial | ) |
Definition at line 1680 of file CudaPmeSolverUtil.C.
References SimParameters::alchFepOn, SimParameters::alchOn, SimParameters::alchThermIntOn, cudaCheck, deviceID, CudaPmeOneDevice::EnergyVirial::energy, h_energyVirials, m_step, Node::Object(), PatchData::reduction, REDUCTION_ELECT_ENERGY_SLOW, REDUCTION_ELECT_ENERGY_SLOW_F, REDUCTION_ELECT_ENERGY_SLOW_TI_1, REDUCTION_ELECT_ENERGY_SLOW_TI_2, selfEnergy, selfEnergy_FEP, selfEnergy_TI_1, selfEnergy_TI_2, Node::simParameters, stream, and CudaPmeOneDevice::EnergyVirial::virial.
int CudaPmeOneDevice::getShiftedGrid | ( | const double | x, |
const int | grid | ||
) |
Definition at line 1995 of file CudaPmeSolverUtil.C.
Referenced by checkPatchLevelLatticeCompatibilityAndComputeOffsets().
cufftHandle* CudaPmeOneDevice::backwardPlans |
Definition at line 238 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
Lattice CudaPmeOneDevice::currentLattice |
Definition at line 283 of file CudaPmeSolverUtil.h.
Referenced by checkPatchLevelLatticeCompatibilityAndComputeOffsets().
float4* CudaPmeOneDevice::d_atoms |
Definition at line 219 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float* CudaPmeOneDevice::d_bm1 |
Definition at line 241 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float* CudaPmeOneDevice::d_bm2 |
Definition at line 242 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float* CudaPmeOneDevice::d_bm3 |
Definition at line 243 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
EnergyVirial* CudaPmeOneDevice::d_energyVirials |
Definition at line 251 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float3* CudaPmeOneDevice::d_forces |
Definition at line 221 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float* CudaPmeOneDevice::d_grids |
on device grid of charge before forward FFT R->C, then grid of potential after backward FFT C->R
Definition at line 227 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
int* CudaPmeOneDevice::d_partition |
Definition at line 220 of file CudaPmeSolverUtil.h.
Referenced by CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float* CudaPmeOneDevice::d_scaling_factors |
Definition at line 222 of file CudaPmeSolverUtil.h.
Referenced by CudaPmeOneDevice(), and ~CudaPmeOneDevice().
double* CudaPmeOneDevice::d_selfEnergy |
Definition at line 256 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
double* CudaPmeOneDevice::d_selfEnergy_FEP |
Definition at line 257 of file CudaPmeSolverUtil.h.
Referenced by CudaPmeOneDevice(), and ~CudaPmeOneDevice().
double* CudaPmeOneDevice::d_selfEnergy_TI_1 |
Definition at line 258 of file CudaPmeSolverUtil.h.
Referenced by CudaPmeOneDevice(), and ~CudaPmeOneDevice().
double* CudaPmeOneDevice::d_selfEnergy_TI_2 |
Definition at line 259 of file CudaPmeSolverUtil.h.
Referenced by CudaPmeOneDevice(), and ~CudaPmeOneDevice().
float2* CudaPmeOneDevice::d_trans |
on device FFT transformation to complex
Definition at line 231 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
int CudaPmeOneDevice::deviceID |
Definition at line 212 of file CudaPmeSolverUtil.h.
Referenced by checkPatchLevelDeviceCompatibility(), compute(), CudaPmeOneDevice(), and finishReduction().
int CudaPmeOneDevice::deviceIndex |
Definition at line 213 of file CudaPmeSolverUtil.h.
Referenced by CudaPmeOneDevice().
bool CudaPmeOneDevice::force_scaling_alch_first_time |
Definition at line 255 of file CudaPmeSolverUtil.h.
cufftHandle* CudaPmeOneDevice::forwardPlans |
Definition at line 237 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
size_t CudaPmeOneDevice::gridsize |
Definition at line 233 of file CudaPmeSolverUtil.h.
Referenced by compute(), and CudaPmeOneDevice().
cudaTextureObject_t* CudaPmeOneDevice::gridTexObjArrays |
Definition at line 224 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
EnergyVirial* CudaPmeOneDevice::h_energyVirials |
Definition at line 252 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), finishReduction(), and ~CudaPmeOneDevice().
double CudaPmeOneDevice::kappa |
Definition at line 245 of file CudaPmeSolverUtil.h.
Referenced by compute().
int CudaPmeOneDevice::m_step |
Definition at line 264 of file CudaPmeSolverUtil.h.
Referenced by compute(), and finishReduction().
int CudaPmeOneDevice::natoms |
Definition at line 216 of file CudaPmeSolverUtil.h.
Referenced by compute(), and CudaPmeOneDevice().
size_t CudaPmeOneDevice::num_used_grids |
Definition at line 217 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), and ~CudaPmeOneDevice().
PatchLevelPmeData CudaPmeOneDevice::patchLevelPmeData |
Definition at line 282 of file CudaPmeSolverUtil.h.
Referenced by checkPatchLevelDeviceCompatibility(), checkPatchLevelLatticeCompatibilityAndComputeOffsets(), checkPatchLevelSimParamCompatibility(), compute(), and ~CudaPmeOneDevice().
PmeGrid CudaPmeOneDevice::pmeGrid |
Definition at line 211 of file CudaPmeSolverUtil.h.
Referenced by checkPatchLevelLatticeCompatibilityAndComputeOffsets(), compute(), and CudaPmeOneDevice().
bool CudaPmeOneDevice::self_energy_alch_first_time |
Definition at line 254 of file CudaPmeSolverUtil.h.
double CudaPmeOneDevice::selfEnergy |
Definition at line 260 of file CudaPmeSolverUtil.h.
Referenced by compute(), and finishReduction().
double CudaPmeOneDevice::selfEnergy_FEP |
Definition at line 261 of file CudaPmeSolverUtil.h.
Referenced by finishReduction().
double CudaPmeOneDevice::selfEnergy_TI_1 |
Definition at line 262 of file CudaPmeSolverUtil.h.
Referenced by finishReduction().
double CudaPmeOneDevice::selfEnergy_TI_2 |
Definition at line 263 of file CudaPmeSolverUtil.h.
Referenced by finishReduction().
cudaStream_t CudaPmeOneDevice::stream |
Definition at line 214 of file CudaPmeSolverUtil.h.
Referenced by compute(), CudaPmeOneDevice(), finishReduction(), and ~CudaPmeOneDevice().
size_t CudaPmeOneDevice::transize |
Definition at line 234 of file CudaPmeSolverUtil.h.
Referenced by compute(), and CudaPmeOneDevice().