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
a60e9cf1
Commit
a60e9cf1
authored
Oct 04, 2010
by
Peter Eastman
Browse files
Eliminated redundant computation of fixed multipole PME
parent
773dd0f0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
25 deletions
+13
-25
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaKernels.h
...ins/amoeba/platforms/cuda/src/kernels/amoebaCudaKernels.h
+2
-2
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPME.cu
...eba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPME.cu
+9
-21
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
...src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
...ms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
+1
-1
No files found.
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaKernels.h
View file @
a60e9cf1
...
...
@@ -164,9 +164,9 @@ extern void trackMutualInducedIterations( amoebaGpuContext amoebaGpu, int iterat
// PME
extern
void
SetCalculateAmoebaPMESim
(
amoebaGpuContext
amoebaGpu
);
extern
void
kCalculateAmoebaPMEFixedMultipole
Field
(
amoebaGpuContext
amoebaGpu
);
extern
void
kCalculateAmoebaPMEFixedMultipole
s
(
amoebaGpuContext
amoebaGpu
);
extern
void
kCalculateAmoebaPMEInducedDipoleField
(
amoebaGpuContext
amoebaGpu
);
extern
void
kCalculateAmoebaPME
(
amoebaGpuContext
amoebaGpu
);
extern
void
kCalculateAmoebaPME
InducedDipoleForces
(
amoebaGpuContext
amoebaGpu
);
#endif //__AMOEBA_GPU_TYPES_H__
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPME.cu
View file @
a60e9cf1
...
...
@@ -960,9 +960,9 @@ void kRecordInducedDipoleField_kernel(float* output, float* outputPolar)
extern
void
cudaComputeAmoebaMapTorquesAndAddTotalForce2
(
amoebaGpuContext
gpu
,
CUDAStream
<
float
>*
psTorque
,
CUDAStream
<
float4
>*
psOutputForce
);
/**
* Compute the potential due to the reciprocal space PME calculation for fixed multipoles.
* Compute the potential
and forces
due to the reciprocal space PME calculation for fixed multipoles.
*/
void
kCalculateAmoebaPMEFixedMultipole
Field
(
amoebaGpuContext
amoebaGpu
)
void
kCalculateAmoebaPMEFixedMultipole
s
(
amoebaGpuContext
amoebaGpu
)
{
// Compute B-spline coefficients and sort the atoms.
...
...
@@ -987,6 +987,9 @@ void kCalculateAmoebaPMEFixedMultipoleField(amoebaGpuContext amoebaGpu)
LAUNCHERROR
(
"kComputeFixedPotentialFromGrid"
);
kRecordFixedMultipoleField_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
update_threads_per_block
>>>
(
amoebaGpu
->
psE_Field
->
_pDevData
);
LAUNCHERROR
(
"kRecordFixedMultipoleField"
);
kComputeFixedMultipoleForceAndEnergy_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
update_threads_per_block
>>>
();
LAUNCHERROR
(
"kComputeFixedMultipoleForceAndEnergy"
);
cudaComputeAmoebaMapTorquesAndAddTotalForce2
(
amoebaGpu
,
amoebaGpu
->
psTorque
,
gpu
->
psForce4
);
}
/**
...
...
@@ -1011,35 +1014,20 @@ void kCalculateAmoebaPMEInducedDipoleField(amoebaGpuContext amoebaGpu)
}
/**
* Compute the forces due to the reciprocal space PME calculation.
* Compute the forces due to the reciprocal space PME calculation
for induced dipoles
.
*/
void
kCalculateAmoebaPME
(
amoebaGpuContext
amoebaGpu
)
void
kCalculateAmoebaPME
InducedDipoleForces
(
amoebaGpuContext
amoebaGpu
)
{
// Perform PME for the fixed multipoles.
gpuContext
gpu
=
amoebaGpu
->
gpuContext
;
kGridSpreadFixedMultipoles_kernel
<<<
10
*
gpu
->
sim
.
blocks
,
64
>>>
();
LAUNCHERROR
(
"kGridSpreadFixedMultipoles"
);
cufftExecC2C
(
gpu
->
fftplan
,
gpu
->
psPmeGrid
->
_pDevData
,
gpu
->
psPmeGrid
->
_pDevData
,
CUFFT_FORWARD
);
kAmoebaReciprocalConvolution_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
nonbond_threads_per_block
>>>
();
LAUNCHERROR
(
"kAmoebaReciprocalConvolution"
);
cufftExecC2C
(
gpu
->
fftplan
,
gpu
->
psPmeGrid
->
_pDevData
,
gpu
->
psPmeGrid
->
_pDevData
,
CUFFT_INVERSE
);
int
potentialThreads
=
(
gpu
->
sm_version
>=
SM_20
?
384
:
(
gpu
->
sm_version
>=
SM_12
?
192
:
96
));
kComputeFixedPotentialFromGrid_kernel
<<<
gpu
->
sim
.
blocks
,
potentialThreads
>>>
();
LAUNCHERROR
(
"kComputeFixedPotentialFromGrid"
);
kComputeFixedMultipoleForceAndEnergy_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
update_threads_per_block
>>>
();
LAUNCHERROR
(
"kComputeFixedMultipoleForceAndEnergy"
);
cudaComputeAmoebaMapTorquesAndAddTotalForce2
(
amoebaGpu
,
amoebaGpu
->
psTorque
,
gpu
->
psForce4
);
// Perform PME for the induced dipoles.
gpuContext
gpu
=
amoebaGpu
->
gpuContext
;
kGridSpreadInducedDipoles_kernel
<<<
10
*
gpu
->
sim
.
blocks
,
64
>>>
();
LAUNCHERROR
(
"kGridSpreadInducedDipoles"
);
cufftExecC2C
(
gpu
->
fftplan
,
gpu
->
psPmeGrid
->
_pDevData
,
gpu
->
psPmeGrid
->
_pDevData
,
CUFFT_FORWARD
);
kAmoebaReciprocalConvolution_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
nonbond_threads_per_block
>>>
();
LAUNCHERROR
(
"kAmoebaReciprocalConvolution"
);
cufftExecC2C
(
gpu
->
fftplan
,
gpu
->
psPmeGrid
->
_pDevData
,
gpu
->
psPmeGrid
->
_pDevData
,
CUFFT_INVERSE
);
potentialThreads
=
(
gpu
->
sm_version
>=
SM_20
?
256
:
(
gpu
->
sm_version
>=
SM_12
?
128
:
64
));
int
potentialThreads
=
(
gpu
->
sm_version
>=
SM_20
?
256
:
(
gpu
->
sm_version
>=
SM_12
?
128
:
64
));
kComputeInducedPotentialFromGrid_kernel
<<<
gpu
->
sim
.
blocks
,
potentialThreads
>>>
();
LAUNCHERROR
(
"kComputeInducedPotentialFromGrid"
);
kComputeInducedDipoleForceAndEnergy_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
update_threads_per_block
>>>
();
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
View file @
a60e9cf1
...
...
@@ -1315,6 +1315,6 @@ void cudaComputeAmoebaPmeDirectElectrostatic( amoebaGpuContext amoebaGpu )
void
cudaComputeAmoebaPmeElectrostatic
(
amoebaGpuContext
amoebaGpu
)
{
cudaComputeAmoebaPmeDirectElectrostatic
(
amoebaGpu
);
kCalculateAmoebaPME
(
amoebaGpu
);
kCalculateAmoebaPME
InducedDipoleForces
(
amoebaGpu
);
}
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
View file @
a60e9cf1
...
...
@@ -601,6 +601,6 @@ static void cudaComputeAmoebaPmeDirectFixedEField( amoebaGpuContext amoebaGpu )
void
cudaComputeAmoebaPmeFixedEField
(
amoebaGpuContext
amoebaGpu
)
{
kCalculateAmoebaPMEFixedMultipole
Field
(
amoebaGpu
);
kCalculateAmoebaPMEFixedMultipole
s
(
amoebaGpu
);
cudaComputeAmoebaPmeDirectFixedEField
(
amoebaGpu
);
}
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