Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
2ef05285
Commit
2ef05285
authored
Sep 13, 2010
by
Mark Friedrichs
Browse files
Direct space PME
parent
c22f00cf
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
546 additions
and
452 deletions
+546
-452
plugins/amoeba/CMakeLists.txt
plugins/amoeba/CMakeLists.txt
+6
-5
plugins/amoeba/openmmapi/include/AmoebaMultipoleForce.h
plugins/amoeba/openmmapi/include/AmoebaMultipoleForce.h
+15
-0
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
+8
-0
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
+1
-0
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
+4
-4
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaKernels.h
...ins/amoeba/platforms/cuda/src/kernels/amoebaCudaKernels.h
+3
-3
plugins/amoeba/platforms/cuda/src/kernels/amoebaGpuTypes.h
plugins/amoeba/platforms/cuda/src/kernels/amoebaGpuTypes.h
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
...src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
+354
-235
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.h
.../src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.h
+140
-199
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
...ms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
+7
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
.../src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
+2
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaRotateFrame.cu
...platforms/cuda/src/kernels/kCalculateAmoebaRotateFrame.cu
+1
-1
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
...amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
+4
-2
No files found.
plugins/amoeba/CMakeLists.txt
View file @
2ef05285
...
...
@@ -38,8 +38,7 @@ ENDIF(LOG)
# The source is organized into subdirectories, but we handle them all from
# this CMakeLists file rather than letting CMake visit them as SUBDIRS.
#SET(OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi platforms/reference)
SET
(
OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi
)
SET
(
OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi platforms/reference
)
# Collect up information about the version of the OpenMM library we're building
# and make it available to the code so it can be built into the binaries.
...
...
@@ -103,8 +102,10 @@ FOREACH(subdir ${OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS})
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
subdir
}
/include
)
ENDFOREACH
(
subdir
)
#INCLUDE_DIRECTORIES(BEFORE ${OPENMM_DIR}/platforms/reference/src)
#INCLUDE_DIRECTORIES(BEFORE ${OPENMM_DIR}/platforms/reference/src/SimTKReference)
INCLUDE_DIRECTORIES
(
BEFORE
${
OPENMM_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
OPENMM_DIR
}
/platforms/reference/src/SimTKReference
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/platforms/reference/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/platforms/reference/src/SimTKReference
)
# ----------------------------------------------------------------------------
IF
(
LOG
)
...
...
@@ -158,7 +159,7 @@ IF(OPENMM_BUILD_STATIC_LIB)
TARGET_LINK_LIBRARIES
(
${
STATIC_AMOEBA_TARGET
}
${
STATIC_TARGET
}
)
ENDIF
(
OPENMM_BUILD_STATIC_LIB
)
#
ADD_SUBDIRECTORY(platforms/reference/tests)
ADD_SUBDIRECTORY
(
platforms/reference/tests
)
# Which hardware platforms to build
IF
(
CUDA_FOUND
)
...
...
plugins/amoeba/openmmapi/include/AmoebaMultipoleForce.h
View file @
2ef05285
...
...
@@ -113,6 +113,20 @@ public:
*/
void
setCutoffDistance
(
double
distance
);
/**
* Get the aEwald parameter
*
* @return the Ewald parameter
*/
double
getAEwald
()
const
;
/**
* Set the aEwald parameter
*
* @param Ewald parameter
*/
void
setAEwald
(
double
aewald
);
/**
* Add multipole-related info for a particle
*
...
...
@@ -279,6 +293,7 @@ private:
AmoebaNonbondedMethod
nonbondedMethod
;
double
cutoffDistance
;
double
aewald
;
MutualInducedIterationMethod
mutualInducedIterationMethod
;
int
mutualInducedMaxIterations
;
double
mutualInducedTargetEpsilon
;
...
...
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
View file @
2ef05285
...
...
@@ -56,6 +56,14 @@ void AmoebaMultipoleForce::setCutoffDistance(double distance) {
cutoffDistance
=
distance
;
}
double
AmoebaMultipoleForce
::
getAEwald
()
const
{
return
aewald
;
}
void
AmoebaMultipoleForce
::
setAEwald
(
double
inputAewald
)
{
aewald
=
inputAewald
;
}
AmoebaMultipoleForce
::
MutualInducedIterationMethod
AmoebaMultipoleForce
::
getMutualInducedIterationMethod
(
void
)
const
{
return
mutualInducedIterationMethod
;
}
...
...
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
View file @
2ef05285
...
...
@@ -589,6 +589,7 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
static_cast
<
float
>
(
force
.
getMutualInducedTargetEpsilon
()),
nonbondedMethod
,
static_cast
<
float
>
(
force
.
getCutoffDistance
()),
static_cast
<
float
>
(
force
.
getAEwald
()),
static_cast
<
float
>
(
force
.
getElectricConstant
())
);
if
(
nonbondedMethod
==
AmoebaMultipoleForce
::
PME
)
{
double
alpha
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
View file @
2ef05285
...
...
@@ -350,6 +350,7 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
(
void
)
fprintf
(
log
,
" pP_ScaleIndices %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pP_ScaleIndices
);
(
void
)
fprintf
(
log
,
" pM_ScaleIndices %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pM_ScaleIndices
);
(
void
)
fprintf
(
log
,
" sqrtPi %15.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
sqrtPi
);
(
void
)
fprintf
(
log
,
" alpha Ewald %15.7e
\n
"
,
gpu
->
sim
.
alphaEwald
);
(
void
)
fprintf
(
log
,
" cutoffDistance2 %15.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
cutoffDistance2
);
(
void
)
fprintf
(
log
,
" electric %15.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
electric
);
(
void
)
fprintf
(
log
,
" box %15.7e %15.7e %15.7e
\n
"
,
gpu
->
sim
.
periodicBoxSizeX
,
gpu
->
sim
.
periodicBoxSizeY
,
gpu
->
sim
.
periodicBoxSizeZ
);
...
...
@@ -1463,7 +1464,7 @@ void gpuSetAmoebaMultipoleParameters(amoebaGpuContext amoebaGpu, const std::vect
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
int
>
>
>&
multipoleParticleCovalentInfo
,
const
std
::
vector
<
int
>&
covalentDegree
,
const
std
::
vector
<
int
>&
minCovalentIndices
,
const
std
::
vector
<
int
>&
minCovalentPolarizationIndices
,
int
maxCovalentRange
,
int
mutualInducedIterativeMethod
,
int
mutualInducedMaxIterations
,
float
mutualInducedTargetEpsilon
,
int
nonbondedMethod
,
float
cutoffDistance
,
float
electricConstant
){
int
nonbondedMethod
,
float
cutoffDistance
,
float
alphaEwald
,
float
electricConstant
){
// ---------------------------------------------------------------------------------------
...
...
@@ -1565,9 +1566,8 @@ void gpuSetAmoebaMultipoleParameters(amoebaGpuContext amoebaGpu, const std::vect
amoebaGpu
->
amoebaSim
.
cutoffDistance2
=
cutoffDistance
*
cutoffDistance
;
amoebaGpu
->
amoebaSim
.
sqrtPi
=
sqrt
(
3.1415926535897932384626433832795
);
amoebaGpu
->
amoebaSim
.
electric
=
electricConstant
;
amoebaGpu
->
gpuContext
->
sim
.
alphaEwald
=
alphaEwald
;
amoebaGpu
->
gpuContext
->
sim
.
nonbondedCutoff
=
cutoffDistance
;
tabulateErfc
(
amoebaGpu
->
gpuContext
);
if
(
amoebaGpu
->
amoebaSim
.
dielec
<
1.0e-05
){
amoebaGpu
->
amoebaSim
.
dielec
=
1.0
f
;
...
...
@@ -2766,7 +2766,7 @@ void amoebaGpuSetConstants(amoebaGpuContext amoebaGpu)
SetCalculateAmoebaCudaPmeMutualInducedFieldSim
(
amoebaGpu
);
SetCalculateAmoebaCudaPmeFixedEFieldSim
(
amoebaGpu
);
SetCalculateAmoebaElectrostaticSim
(
amoebaGpu
);
SetCalculateAmoeba
RealSpaceEwald
Sim
(
amoebaGpu
);
SetCalculateAmoeba
PmeDirectElectrostatic
Sim
(
amoebaGpu
);
SetCalculateAmoebaCudaMapTorquesSim
(
amoebaGpu
);
SetCalculateAmoebaKirkwoodSim
(
amoebaGpu
);
SetCalculateAmoebaKirkwoodEDiffSim
(
amoebaGpu
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaKernels.h
View file @
2ef05285
...
...
@@ -106,9 +106,9 @@ extern void SetCalculateAmoebaElectrostaticSim( amoebaGpuContext amoebaGpu );
extern
void
GetCalculateAmoebaElectrostaticSim
(
amoebaGpuContext
amoebaGpu
);
extern
void
cudaComputeAmoebaElectrostatic
(
amoebaGpuContext
amoebaGpu
);
extern
void
SetCalculateAmoeba
RealSpaceEwald
Sim
(
amoebaGpuContext
amoebaGpu
);
extern
void
GetCalculateAmoeba
RealSpaceEwald
Sim
(
amoebaGpuContext
amoebaGpu
);
extern
void
cudaComputeAmoeba
RealSpaceEwald
(
amoebaGpuContext
amoebaGpu
);
extern
void
SetCalculateAmoeba
PmeDirectElectrostatic
Sim
(
amoebaGpuContext
amoebaGpu
);
extern
void
GetCalculateAmoeba
PmeDirectElectrostatic
Sim
(
amoebaGpuContext
amoebaGpu
);
extern
void
cudaComputeAmoeba
PmeElectrostatic
(
amoebaGpuContext
amoebaGpu
);
extern
void
SetCalculateAmoebaCudaMapTorquesSim
(
amoebaGpuContext
gpu
);
extern
void
GetCalculateAmoebaCudaMapTorquesSim
(
amoebaGpuContext
gpu
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaGpuTypes.h
View file @
2ef05285
...
...
@@ -307,7 +307,7 @@ void gpuSetAmoebaMultipoleParameters(amoebaGpuContext amoebaGpu, const std::vect
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
int
>
>
>&
multipoleAtomCovalentInfo
,
const
std
::
vector
<
int
>&
covalentDegree
,
const
std
::
vector
<
int
>&
minCovalentIndices
,
const
std
::
vector
<
int
>&
minCovalentPolarizationIndices
,
int
maxCovalentRange
,
int
mutualInducedIterationMethod
,
int
mutualInducedMaxIterations
,
float
mutualInducedTargetEpsilon
,
int
nonbondedMethod
,
float
cutoffDistance
,
float
electricConstant
);
int
nonbondedMethod
,
float
cutoffDistance
,
float
alphaEwald
,
float
electricConstant
);
extern
"C"
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCuda
RealSpaceEwald
.cu
→
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCuda
PmeDirectElectrostatic
.cu
View file @
2ef05285
This diff is collapsed.
Click to expand it.
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCuda
RealSpaceEwald
.h
→
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCuda
PmeDirectElectrostatic
.h
View file @
2ef05285
...
...
@@ -34,15 +34,8 @@ __launch_bounds__(128, 1)
#else
__launch_bounds__
(
64
,
1
)
#endif
void
METHOD_NAME
(
kCalculateAmoebaCudaRealSpaceEwald
,
Forces_kernel
)(
unsigned
int
*
workUnit
,
float4
*
atomCoord
,
float
*
labFrameDipole
,
float
*
labFrameQuadrupole
,
float
*
inducedDipole
,
float
*
inducedDipolePolar
,
float
*
outputForce
,
float
*
outputTorque
void
METHOD_NAME
(
kCalculateAmoebaPmeDirectElectrostatic
,
Forces_kernel
)(
unsigned
int
*
workUnit
,
float
*
outputForce
,
float
*
outputTorque
#ifdef AMOEBA_DEBUG
,
float4
*
debugArray
,
unsigned
int
targetAtom
...
...
@@ -50,10 +43,11 @@ void METHOD_NAME(kCalculateAmoebaCudaRealSpaceEwald, Forces_kernel)(
){
#ifdef AMOEBA_DEBUG
int
pullIndexMax
=
12
;
float4
pullBack
[
20
];
#endif
extern
__shared__
RealSpaceEwald
Particle
sA
[];
extern
__shared__
PmeDirectElectrostatic
Particle
sA
[];
unsigned
int
totalWarps
=
gridDim
.
x
*
blockDim
.
x
/
GRID
;
unsigned
int
warp
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
)
/
GRID
;
...
...
@@ -80,12 +74,10 @@ void METHOD_NAME(kCalculateAmoebaCudaRealSpaceEwald, Forces_kernel)(
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
unsigned
int
tj
=
tgx
;
RealSpaceEwald
Particle
*
psA
=
&
sA
[
tbx
];
PmeDirectElectrostatic
Particle
*
psA
=
&
sA
[
tbx
];
unsigned
int
atomI
=
x
+
tgx
;
RealSpaceEwaldParticle
localParticle
;
loadRealSpaceEwaldShared
(
&
localParticle
,
atomI
,
atomCoord
,
labFrameDipole
,
labFrameQuadrupole
,
inducedDipole
,
inducedDipolePolar
,
cAmoebaSim
.
pDampingFactorAndThole
);
PmeDirectElectrostaticParticle
localParticle
;
loadPmeDirectElectrostaticShared
(
&
localParticle
,
atomI
);
localParticle
.
force
[
0
]
=
0
.
0
f
;
localParticle
.
force
[
1
]
=
0
.
0
f
;
...
...
@@ -105,9 +97,7 @@ void METHOD_NAME(kCalculateAmoebaCudaRealSpaceEwald, Forces_kernel)(
// load shared data
loadRealSpaceEwaldShared
(
&
(
sA
[
threadIdx
.
x
]),
atomI
,
atomCoord
,
labFrameDipole
,
labFrameQuadrupole
,
inducedDipole
,
inducedDipolePolar
,
cAmoebaSim
.
pDampingFactorAndThole
);
loadPmeDirectElectrostaticShared
(
&
(
sA
[
threadIdx
.
x
]),
atomI
);
if
(
!
bExclusionFlag
)
{
...
...
@@ -122,9 +112,8 @@ void METHOD_NAME(kCalculateAmoebaCudaRealSpaceEwald, Forces_kernel)(
float
torque
[
2
][
3
];
float
energy
;
calculateRealSpaceEwaldPairIxn_kernel
(
localParticle
,
psA
[
j
],
cAmoebaSim
.
scalingDistanceCutoff
,
scalingFactors
,
force
,
torque
,
&
energy
calculatePmeDirectElectrostaticPairIxn_kernel
(
localParticle
,
psA
[
j
],
scalingFactors
,
force
,
torque
,
&
energy
#ifdef AMOEBA_DEBUG
,
pullBack
#endif
...
...
@@ -171,9 +160,8 @@ void METHOD_NAME(kCalculateAmoebaCudaRealSpaceEwald, Forces_kernel)(
// force
float
energy
;
calculateRealSpaceEwaldPairIxn_kernel
(
localParticle
,
psA
[
j
],
cAmoebaSim
.
scalingDistanceCutoff
,
scalingFactors
,
force
,
torque
,
&
energy
calculatePmeDirectElectrostaticPairIxn_kernel
(
localParticle
,
psA
[
j
],
scalingFactors
,
force
,
torque
,
&
energy
#ifdef AMOEBA_DEBUG
,
pullBack
#endif
...
...
@@ -199,58 +187,54 @@ void METHOD_NAME(kCalculateAmoebaCudaRealSpaceEwald, Forces_kernel)(
#ifdef AMOEBA_DEBUG
if
(
atomI
==
targetAtom
){
unsigned
int
index
=
(
atomI
==
targetAtom
)
?
atomJ
:
atomI
;
float
blockId
=
1
.
0
f
;
debugArray
[
index
].
x
=
(
float
)
atomI
;
debugArray
[
index
].
y
=
(
float
)
atomJ
;
debugArray
[
index
].
z
=
1
.
0
f
;
debugArray
[
index
].
w
=
(
float
)
y
;
/*
debugArray
[
index
].
z
=
(
float
)
y
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
force
[
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
force
[
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
force
[
2
]
:
0
.
0
f
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
torque
[
0
][
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
torque
[
0
][
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
torque
[
0
][
2
]
:
0
.
0
f
;
*/
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
int
pullIndex
=
0
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
debugArray
[
index
].
x
=
mask
?
torque
[
0
][
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
torque
[
0
][
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
torque
[
0
][
2
]
:
0
.
0
f
;
debugArray
[
index
].
w
=
blockId
;
for
(
int
pullIndex
=
0
;
pullIndex
<
pullIndexMax
;
pullIndex
++
){
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
}
}
#endif
}
}
// include self energy and self torque
if
(
atomI
<
cAmoebaSim
.
numberOfAtoms
){
calculatePmeSelfTorqueElectrostaticPairIxn_kernel
(
localParticle
);
//float energy;
//calculatePmeSelfEnergyElectrostaticPairIxn_kernel( localParticle, &energy );
//totalEnergy += energy;
}
// Write results
#ifdef USE_OUTPUT_BUFFER_PER_WARP
...
...
@@ -300,9 +284,7 @@ if( atomI == targetAtom ){
{
// load shared data
loadRealSpaceEwaldShared
(
&
(
sA
[
threadIdx
.
x
]),
(
y
+
tgx
),
atomCoord
,
labFrameDipole
,
labFrameQuadrupole
,
inducedDipole
,
inducedDipolePolar
,
cAmoebaSim
.
pDampingFactorAndThole
);
loadPmeDirectElectrostaticShared
(
&
(
sA
[
threadIdx
.
x
]),
(
y
+
tgx
)
);
}
...
...
@@ -325,9 +307,8 @@ if( atomI == targetAtom ){
unsigned
int
atomJ
=
y
+
tj
;
float
energy
;
calculateRealSpaceEwaldPairIxn_kernel
(
localParticle
,
psA
[
tj
],
cAmoebaSim
.
scalingDistanceCutoff
,
scalingFactors
,
force
,
torque
,
&
energy
calculatePmeDirectElectrostaticPairIxn_kernel
(
localParticle
,
psA
[
tj
],
scalingFactors
,
force
,
torque
,
&
energy
#ifdef AMOEBA_DEBUG
,
pullBack
#endif
...
...
@@ -360,60 +341,44 @@ if( atomI == targetAtom ){
#ifdef AMOEBA_DEBUG
if
(
atomI
==
targetAtom
||
atomJ
==
targetAtom
){
unsigned
int
index
=
(
atomI
==
targetAtom
)
?
atomJ
:
atomI
;
unsigned
int
indexI
=
(
atomI
==
targetAtom
)
?
0
:
1
;
unsigned
int
indexJ
=
(
atomI
==
targetAtom
)
?
1
:
0
;
float
forceSign
=
(
atomI
==
targetAtom
)
?
1
.
0
f
:
-
1
.
0
f
;
float
blockId
=
2
.
0
f
;
debugArray
[
index
].
x
=
(
float
)
atomI
;
debugArray
[
index
].
y
=
(
float
)
atomJ
;
debugArray
[
index
].
z
=
2
.
0
f
;
debugArray
[
index
].
w
=
(
float
)
y
;
/*
debugArray
[
index
].
z
=
(
float
)
y
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
forceSign
*
force
[
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
forceSign
*
force
[
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
forceSign
*
force
[
2
]
:
0
.
0
f
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
torque
[
indexI
][
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
torque
[
indexI
][
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
torque
[
indexI
][
2
]
:
0
.
0
f
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
torque
[
indexJ
][
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
torque
[
indexJ
][
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
torque
[
indexJ
][
2
]
:
0
.
0
f
;
*/
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
int
pullIndex
=
0
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
debugArray
[
index
].
w
=
blockId
;
for
(
int
pullIndex
=
0
;
pullIndex
<
pullIndexMax
;
pullIndex
++
){
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
}
}
#endif
...
...
@@ -449,9 +414,8 @@ if( atomI == targetAtom || atomJ == targetAtom ){
// force
float
energy
;
calculateRealSpaceEwaldPairIxn_kernel
(
localParticle
,
psA
[
tj
],
cAmoebaSim
.
scalingDistanceCutoff
,
scalingFactors
,
force
,
torque
,
&
energy
calculatePmeDirectElectrostaticPairIxn_kernel
(
localParticle
,
psA
[
tj
],
scalingFactors
,
force
,
torque
,
&
energy
#ifdef AMOEBA_DEBUG
,
pullBack
#endif
...
...
@@ -490,55 +454,39 @@ if( atomI == targetAtom || atomJ == targetAtom ){
unsigned
int
indexI
=
(
atomI
==
targetAtom
)
?
0
:
1
;
unsigned
int
indexJ
=
(
atomI
==
targetAtom
)
?
1
:
0
;
float
forceSign
=
(
atomI
==
targetAtom
)
?
1
.
0
f
:
-
1
.
0
f
;
float
blockId
=
3
.
0
f
;
debugArray
[
index
].
x
=
(
float
)
atomI
;
debugArray
[
index
].
y
=
(
float
)
atomJ
;
debugArray
[
index
].
z
=
3
.
0
f
;
debugArray
[
index
].
w
=
(
float
)
y
;
/*
debugArray
[
index
].
z
=
(
float
)
y
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
forceSign
*
force
[
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
forceSign
*
force
[
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
forceSign
*
force
[
2
]
:
0
.
0
f
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
torque
[
indexI
][
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
torque
[
indexI
][
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
torque
[
indexI
][
2
]
:
0
.
0
f
;
debugArray
[
index
].
w
=
blockId
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
mask
?
torque
[
indexJ
][
0
]
:
0
.
0
f
;
debugArray
[
index
].
y
=
mask
?
torque
[
indexJ
][
1
]
:
0
.
0
f
;
debugArray
[
index
].
z
=
mask
?
torque
[
indexJ
][
2
]
:
0
.
0
f
;
*/
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
int
pullIndex
=
0
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
debugArray
[
index
].
w
=
blockId
;
for
(
int
pullIndex
=
0
;
pullIndex
<
pullIndexMax
;
pullIndex
++
){
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
pullIndex
++
;
debugArray
[
index
].
x
=
pullBack
[
pullIndex
].
x
;
debugArray
[
index
].
y
=
pullBack
[
pullIndex
].
y
;
debugArray
[
index
].
z
=
pullBack
[
pullIndex
].
z
;
debugArray
[
index
].
w
=
pullBack
[
pullIndex
].
w
;
}
#if 0
index += cAmoebaSim.paddedNumberOfAtoms;
...
...
@@ -550,13 +498,6 @@ if( atomI == targetAtom || atomJ == targetAtom ){
index += cAmoebaSim.paddedNumberOfAtoms;
debugArray[index].x = scalingFactors[MScaleIndex];
debugArray[index].y = mScaleVal;
for( int pIndex = 0; pIndex < 14; pIndex++ ){
index += cAmoebaSim.paddedNumberOfAtoms;
debugArray[index].x = pullBack[pIndex].x;
debugArray[index].y = pullBack[pIndex].y;
debugArray[index].z = pullBack[pIndex].z;
debugArray[index].w = pullBack[pIndex].w;
}
index += cAmoebaSim.paddedNumberOfAtoms;
debugArray[index].x = labFrameDipole[3*atomI];
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
View file @
2ef05285
...
...
@@ -322,7 +322,7 @@ __device__ void calculateFixedFieldRealSpacePairIxn_kernel( FixedFieldParticle&
--------------------------------------------------------------------------------------- */
void
cudaComputeAmoebaPmeFixedEField
(
amoebaGpuContext
amoebaGpu
)
static
void
cudaComputeAmoebaPme
Direct
FixedEField
(
amoebaGpuContext
amoebaGpu
)
{
// ---------------------------------------------------------------------------------------
...
...
@@ -487,3 +487,9 @@ void cudaComputeAmoebaPmeFixedEField( amoebaGpuContext amoebaGpu )
}
}
void
cudaComputeAmoebaPmeFixedEField
(
amoebaGpuContext
amoebaGpu
)
{
cudaComputeAmoebaPmeDirectFixedEField
(
amoebaGpu
);
kCalculateAmoebaPMEFixedMultipoleField
(
amoebaGpu
);
}
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
View file @
2ef05285
...
...
@@ -616,6 +616,7 @@ static void cudaComputeAmoebaPmeMutualInducedFieldBySOR( amoebaGpuContext amoeba
// matrix multiply
cudaComputeAmoebaPmeMutualInducedFieldMatrixMultiply
(
amoebaGpu
,
amoebaGpu
->
psWorkVector
[
0
],
amoebaGpu
->
psWorkVector
[
1
]
);
kCalculateAmoebaPMEInducedDipoleField
(
amoebaGpu
);
LAUNCHERROR
(
"cudaComputeAmoebaPmeMutualInducedFieldMatrixMultiply Loop
\n
"
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaRotateFrame.cu
View file @
2ef05285
...
...
@@ -390,7 +390,7 @@ void kCalculateAmoebaMultipoleForces(amoebaGpuContext amoebaGpu, bool hasAmoebaG
if
(
amoebaGpu
->
multipoleNonbondedMethod
==
AMOEBA_NO_CUTOFF
){
cudaComputeAmoebaElectrostatic
(
amoebaGpu
);
}
else
{
cudaComputeAmoeba
RealSpaceEwald
(
amoebaGpu
);
cudaComputeAmoeba
PmeElectrostatic
(
amoebaGpu
);
}
// map torques to forces
...
...
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
View file @
2ef05285
...
...
@@ -2008,6 +2008,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, int version, MapStringI
multipoleForce
->
setNonbondedMethod
(
AmoebaMultipoleForce
::
NoCutoff
);
}
multipoleForce
->
setCutoffDistance
(
cutoffDistance
);
multipoleForce
->
setAEwald
(
aewald
);
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
box
[
0
],
0.0
,
0.0
),
Vec3
(
0.0
,
box
[
1
],
0.0
),
Vec3
(
0.0
,
0.0
,
box
[
2
])
);
if
(
log
){
(
void
)
fprintf
(
log
,
"%s number of MultipoleParameter terms=%d usePme=%d aewald=%15.7e cutoffDistance=%12.4f
\n
"
,
...
...
@@ -2111,6 +2112,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, int version, MapStringI
double
polarityConversion
=
AngstromToNm
*
AngstromToNm
*
AngstromToNm
;
double
dampingFactorConversion
=
sqrt
(
AngstromToNm
);
multipoleForce
->
setAEwald
(
multipoleForce
->
getAEwald
()
/
AngstromToNm
);
multipoleForce
->
setCutoffDistance
(
multipoleForce
->
getCutoffDistance
()
*
AngstromToNm
);
multipoleForce
->
setScalingDistanceCutoff
(
multipoleForce
->
getScalingDistanceCutoff
()
*
AngstromToNm
);
...
...
@@ -2165,8 +2167,8 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, int version, MapStringI
(
useOpenMMUnits
?
"OpenMM"
:
"Amoeba"
)
);
std
::
string
nonbondedMethod
=
multipoleForce
->
getNonbondedMethod
(
)
==
AmoebaMultipoleForce
::
PME
?
"PME"
:
"NoCutoff"
;
(
void
)
fprintf
(
log
,
"NonbondedMethod=%s cutoff=%15.7e.
\n
"
,
nonbondedMethod
.
c_str
(),
multipoleForce
->
getCutoffDistance
()
);
(
void
)
fprintf
(
log
,
"NonbondedMethod=%s
aEwald=%15.7e
cutoff=%15.7e.
\n
"
,
nonbondedMethod
.
c_str
(),
multipoleForce
->
getAEwald
(),
multipoleForce
->
getCutoffDistance
()
);
Vec3
a
,
b
,
c
;
system
.
getDefaultPeriodicBoxVectors
(
a
,
b
,
c
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment