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
3c130a24
"wrappers/python/src/vscode:/vscode.git/clone" did not exist on "2fbed592588e968fc244f6a60718db1e7fed2bec"
Commit
3c130a24
authored
Sep 22, 2012
by
Peter Eastman
Browse files
Fixed bugs in AMOEBA GK
parent
20e01186
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8019 additions
and
21 deletions
+8019
-21
plugins/amoeba/platforms/cuda2/src/AmoebaCudaKernels.cpp
plugins/amoeba/platforms/cuda2/src/AmoebaCudaKernels.cpp
+7
-13
plugins/amoeba/platforms/cuda2/src/kernels/amoebaGk.cu
plugins/amoeba/platforms/cuda2/src/kernels/amoebaGk.cu
+6
-6
plugins/amoeba/platforms/cuda2/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
...ms/cuda2/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
+8006
-2
No files found.
plugins/amoeba/platforms/cuda2/src/AmoebaCudaKernels.cpp
View file @
3c130a24
...
@@ -1079,7 +1079,7 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
...
@@ -1079,7 +1079,7 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
electrostaticsSource
<<
"#define T1
\n
"
;
electrostaticsSource
<<
"#define T1
\n
"
;
electrostaticsSource
<<
CudaAmoebaKernelSources
::
electrostaticPairForce
;
electrostaticsSource
<<
CudaAmoebaKernelSources
::
electrostaticPairForce
;
electrostaticsSource
<<
"#undef T1
\n
"
;
electrostaticsSource
<<
"#undef T1
\n
"
;
electrostaticsSource
<<
"#define T
2
\n
"
;
electrostaticsSource
<<
"#define T
3
\n
"
;
electrostaticsSource
<<
CudaAmoebaKernelSources
::
electrostaticPairForce
;
electrostaticsSource
<<
CudaAmoebaKernelSources
::
electrostaticPairForce
;
}
}
module
=
cu
.
createModule
(
electrostaticsSource
.
str
(),
defines
);
module
=
cu
.
createModule
(
electrostaticsSource
.
str
(),
defines
);
...
@@ -1401,12 +1401,6 @@ double CudaCalcAmoebaMultipoleForceKernel::execute(ContextImpl& context, bool in
...
@@ -1401,12 +1401,6 @@ double CudaCalcAmoebaMultipoleForceKernel::execute(ContextImpl& context, bool in
cu
.
executeKernel
(
electrostaticsKernel
,
electrostaticsArgs
,
numForceThreadBlocks
*
forceThreadBlockSize
,
forceThreadBlockSize
);
cu
.
executeKernel
(
electrostaticsKernel
,
electrostaticsArgs
,
numForceThreadBlocks
*
forceThreadBlockSize
,
forceThreadBlockSize
);
if
(
gkKernel
!=
NULL
)
if
(
gkKernel
!=
NULL
)
gkKernel
->
finishComputation
(
*
torque
,
*
labFrameDipoles
,
*
labFrameQuadrupoles
,
*
inducedDipole
,
*
inducedDipolePolar
,
*
dampingAndThole
,
*
covalentFlags
,
*
polarizationGroupFlags
);
gkKernel
->
finishComputation
(
*
torque
,
*
labFrameDipoles
,
*
labFrameQuadrupoles
,
*
inducedDipole
,
*
inducedDipolePolar
,
*
dampingAndThole
,
*
covalentFlags
,
*
polarizationGroupFlags
);
// Map torques to force.
void
*
mapTorqueArgs
[]
=
{
&
cu
.
getForce
().
getDevicePointer
(),
&
torque
->
getDevicePointer
(),
&
cu
.
getPosq
().
getDevicePointer
(),
&
multipoleParticles
->
getDevicePointer
()};
cu
.
executeKernel
(
mapTorqueKernel
,
mapTorqueArgs
,
cu
.
getNumAtoms
());
}
}
else
{
else
{
// Reciprocal space calculation.
// Reciprocal space calculation.
...
@@ -1534,13 +1528,13 @@ double CudaCalcAmoebaMultipoleForceKernel::execute(ContextImpl& context, bool in
...
@@ -1534,13 +1528,13 @@ double CudaCalcAmoebaMultipoleForceKernel::execute(ContextImpl& context, bool in
&
inducedDipole
->
getDevicePointer
(),
&
inducedDipolePolar
->
getDevicePointer
(),
&
pmePhi
->
getDevicePointer
(),
&
pmePhid
->
getDevicePointer
(),
&
inducedDipole
->
getDevicePointer
(),
&
inducedDipolePolar
->
getDevicePointer
(),
&
pmePhi
->
getDevicePointer
(),
&
pmePhid
->
getDevicePointer
(),
&
pmePhip
->
getDevicePointer
(),
&
pmePhidp
->
getDevicePointer
(),
cu
.
getInvPeriodicBoxSizePointer
()};
&
pmePhip
->
getDevicePointer
(),
&
pmePhidp
->
getDevicePointer
(),
cu
.
getInvPeriodicBoxSizePointer
()};
cu
.
executeKernel
(
pmeInducedForceKernel
,
pmeInducedForceArgs
,
cu
.
getNumAtoms
());
cu
.
executeKernel
(
pmeInducedForceKernel
,
pmeInducedForceArgs
,
cu
.
getNumAtoms
());
// Map torques to force.
void
*
mapTorqueArgs
[]
=
{
&
cu
.
getForce
().
getDevicePointer
(),
&
torque
->
getDevicePointer
(),
&
cu
.
getPosq
().
getDevicePointer
(),
&
multipoleParticles
->
getDevicePointer
()};
cu
.
executeKernel
(
mapTorqueKernel
,
mapTorqueArgs
,
cu
.
getNumAtoms
());
}
}
// Map torques to force.
void
*
mapTorqueArgs
[]
=
{
&
cu
.
getForce
().
getDevicePointer
(),
&
torque
->
getDevicePointer
(),
&
cu
.
getPosq
().
getDevicePointer
(),
&
multipoleParticles
->
getDevicePointer
()};
cu
.
executeKernel
(
mapTorqueKernel
,
mapTorqueArgs
,
cu
.
getNumAtoms
());
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/platforms/cuda2/src/kernels/amoebaGk.cu
View file @
3c130a24
...
@@ -50,7 +50,7 @@ typedef struct {
...
@@ -50,7 +50,7 @@ typedef struct {
float
radius
,
scaledRadius
,
padding
;
float
radius
,
scaledRadius
,
padding
;
}
AtomData1
;
}
AtomData1
;
__device__
void
computeBornSumOneInteraction
(
AtomData1
&
atom1
,
AtomData1
&
atom2
,
float
&
bornSum
)
{
__device__
void
computeBornSumOneInteraction
(
AtomData1
&
atom1
,
AtomData1
&
atom2
)
{
if
(
atom1
.
radius
<=
0
)
if
(
atom1
.
radius
<=
0
)
return
;
// Ignore this interaction
return
;
// Ignore this interaction
real3
delta
=
atom2
.
pos
-
atom1
.
pos
;
real3
delta
=
atom2
.
pos
-
atom1
.
pos
;
...
@@ -61,7 +61,7 @@ __device__ void computeBornSumOneInteraction(AtomData1& atom1, AtomData1& atom2,
...
@@ -61,7 +61,7 @@ __device__ void computeBornSumOneInteraction(AtomData1& atom1, AtomData1& atom2,
if
(
atom1
.
radius
+
r
<
sk
)
{
if
(
atom1
.
radius
+
r
<
sk
)
{
real
lik
=
atom1
.
radius
;
real
lik
=
atom1
.
radius
;
real
uik
=
sk
-
r
;
real
uik
=
sk
-
r
;
bornSum
-=
RECIP
(
uik
*
uik
*
uik
)
-
RECIP
(
lik
*
lik
*
lik
);
atom1
.
bornSum
-=
RECIP
(
uik
*
uik
*
uik
)
-
RECIP
(
lik
*
lik
*
lik
);
}
}
real
uik
=
r
+
sk
;
real
uik
=
r
+
sk
;
real
lik
;
real
lik
;
...
@@ -80,7 +80,7 @@ __device__ void computeBornSumOneInteraction(AtomData1& atom1, AtomData1& atom2,
...
@@ -80,7 +80,7 @@ __device__ void computeBornSumOneInteraction(AtomData1& atom1, AtomData1& atom2,
real
ur
=
uik
*
r
;
real
ur
=
uik
*
r
;
real
u4r
=
u4
*
r
;
real
u4r
=
u4
*
r
;
real
term
=
(
3
*
(
r2
-
sk2
)
+
6
*
u2
-
8
*
ur
)
/
u4r
-
(
3
*
(
r2
-
sk2
)
+
6
*
l2
-
8
*
lr
)
/
l4r
;
real
term
=
(
3
*
(
r2
-
sk2
)
+
6
*
u2
-
8
*
ur
)
/
u4r
-
(
3
*
(
r2
-
sk2
)
+
6
*
l2
-
8
*
lr
)
/
l4r
;
bornSum
+=
term
/
16
;
atom1
.
bornSum
+=
term
/
16
;
}
}
/**
/**
...
@@ -124,7 +124,7 @@ extern "C" __global__ void computeBornSum(unsigned long long* __restrict__ bornS
...
@@ -124,7 +124,7 @@ extern "C" __global__ void computeBornSum(unsigned long long* __restrict__ bornS
for
(
unsigned
int
j
=
0
;
j
<
TILE_SIZE
;
j
++
)
{
for
(
unsigned
int
j
=
0
;
j
<
TILE_SIZE
;
j
++
)
{
int
atom2
=
y
*
TILE_SIZE
+
j
;
int
atom2
=
y
*
TILE_SIZE
+
j
;
if
(
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
&&
atom1
!=
atom2
)
if
(
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
&&
atom1
!=
atom2
)
computeBornSumOneInteraction
(
data
,
localData
[
tbx
+
j
]
,
data
.
bornSum
);
computeBornSumOneInteraction
(
data
,
localData
[
tbx
+
j
]);
}
}
}
}
else
{
else
{
...
@@ -146,8 +146,8 @@ extern "C" __global__ void computeBornSum(unsigned long long* __restrict__ bornS
...
@@ -146,8 +146,8 @@ extern "C" __global__ void computeBornSum(unsigned long long* __restrict__ bornS
for
(
unsigned
int
j
=
0
;
j
<
TILE_SIZE
;
j
++
)
{
for
(
unsigned
int
j
=
0
;
j
<
TILE_SIZE
;
j
++
)
{
int
atom2
=
y
*
TILE_SIZE
+
tj
;
int
atom2
=
y
*
TILE_SIZE
+
tj
;
if
(
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
)
{
if
(
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
)
{
computeBornSumOneInteraction
(
data
,
localData
[
tbx
+
j
]
,
data
.
bornSum
);
computeBornSumOneInteraction
(
data
,
localData
[
tbx
+
t
j
]);
computeBornSumOneInteraction
(
localData
[
tbx
+
j
],
data
,
localData
[
tbx
+
j
].
bornSum
);
computeBornSumOneInteraction
(
localData
[
tbx
+
t
j
],
data
);
}
}
tj
=
(
tj
+
1
)
&
(
TILE_SIZE
-
1
);
tj
=
(
tj
+
1
)
&
(
TILE_SIZE
-
1
);
}
}
...
...
plugins/amoeba/platforms/cuda2/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
View file @
3c130a24
This diff is collapsed.
Click to expand it.
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