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
12680294
Commit
12680294
authored
Jul 28, 2010
by
Mark Friedrichs
Browse files
Fixed parameter scaling issue w/ AmoebaHarmonicBondForce
Test use env variable OPENMM_PLUGIN_DIR to find plugin
parent
192670e9
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
220 additions
and
87 deletions
+220
-87
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
+46
-46
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
...c/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
+21
-5
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
...amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
+145
-6
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaForceFromParameterFile.cpp
...forms/cuda/tests/TestCudaAmoebaForceFromParameterFile.cpp
+0
-14
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicAngleForce.cpp
...platforms/cuda/tests/TestCudaAmoebaHarmonicAngleForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
.../platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicInPlaneAngleForce.cpp
...ms/cuda/tests/TestCudaAmoebaHarmonicInPlaneAngleForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
...latforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
...eba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
...a/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionForce.cpp
...moeba/platforms/cuda/tests/TestCudaAmoebaTorsionForce.cpp
+1
-2
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
...latforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
+1
-2
No files found.
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
View file @
12680294
...
...
@@ -212,8 +212,8 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
gpuPrintCudaStreamFloat2
(
amoebaGpu
->
psAmoebaBondParameter
,
log
);
(
void
)
fprintf
(
log
,
" amoebaBonds %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaBonds
);
(
void
)
fprintf
(
log
,
" amoebaBond_offset %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaBond_offset
);
(
void
)
fprintf
(
log
,
" cubic %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaBondCubicParameter
);
(
void
)
fprintf
(
log
,
" quartic %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaBondQuarticicParameter
);
(
void
)
fprintf
(
log
,
" cubic %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaBondCubicParameter
);
(
void
)
fprintf
(
log
,
" quartic %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaBondQuarticicParameter
);
(
void
)
fprintf
(
log
,
" pAmoebaBondID %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaBondID
);
(
void
)
fprintf
(
log
,
" pAmoebaBondParameter %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaBondParameter
);
...
...
@@ -223,10 +223,10 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
(
void
)
fprintf
(
log
,
"
\n
"
);
(
void
)
fprintf
(
log
,
" amoebaAngles %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngles
);
(
void
)
fprintf
(
log
,
" amoebaAngle_offset %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngle_offset
);
(
void
)
fprintf
(
log
,
" amoebaAngleCubicK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngleCubicK
);
(
void
)
fprintf
(
log
,
" amoebaAngleQuarticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngleQuarticK
);
(
void
)
fprintf
(
log
,
" amoebaAnglePenticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAnglePenticK
);
(
void
)
fprintf
(
log
,
" amoebaAngleSexticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngleSexticK
);
(
void
)
fprintf
(
log
,
" amoebaAngleCubicK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngleCubicK
);
(
void
)
fprintf
(
log
,
" amoebaAngleQuarticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngleQuarticK
);
(
void
)
fprintf
(
log
,
" amoebaAnglePenticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAnglePenticK
);
(
void
)
fprintf
(
log
,
" amoebaAngleSexticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaAngleSexticK
);
(
void
)
fprintf
(
log
,
" pAmoebaAngleID1 %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaAngleID1
);
(
void
)
fprintf
(
log
,
" pAmoebaAngleID2 %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaAngleID2
);
(
void
)
fprintf
(
log
,
" pAmoebaAngleParameter %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaAngleParameter
);
...
...
@@ -238,10 +238,10 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
(
void
)
fprintf
(
log
,
"
\n
"
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngles %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngles
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngle_offset %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngle_offset
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngleCubicK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngleCubicK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngleQuarticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngleQuarticK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAnglePenticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAnglePenticK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngleSexticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngleSexticK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngleCubicK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngleCubicK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngleQuarticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngleQuarticK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAnglePenticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAnglePenticK
);
(
void
)
fprintf
(
log
,
" amoebaInPlaneAngleSexticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaInPlaneAngleSexticK
);
(
void
)
fprintf
(
log
,
" pAmoebaInPlaneAngleID1 %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaInPlaneAngleID1
);
(
void
)
fprintf
(
log
,
" pAmoebaInPlaneAngleID2 %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaInPlaneAngleID2
);
(
void
)
fprintf
(
log
,
" pAmoebaInPlaneAngleParameter %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaInPlaneAngleParameter
);
...
...
@@ -288,10 +288,10 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
gpuPrintCudaStreamFloat
(
amoebaGpu
->
psAmoebaOutOfPlaneBendParameter
,
log
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBend %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBends
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBend_offset %u
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBend_offset
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendCubicK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendCubicK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendQuarticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendQuarticK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendPenticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendPenticK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendSexticK %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendSexticK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendCubicK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendCubicK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendQuarticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendQuarticK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendPenticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendPenticK
);
(
void
)
fprintf
(
log
,
" amoebaOutOfPlaneBendSexticK %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
amoebaOutOfPlaneBendSexticK
);
(
void
)
fprintf
(
log
,
" pAmoebaOutOfPlaneBendID1 %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaOutOfPlaneBendID1
);
(
void
)
fprintf
(
log
,
" pAmoebaOutOfPlaneBendID2 %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaOutOfPlaneBendID2
);
(
void
)
fprintf
(
log
,
" pAmoebaOutOfPlaneBendParameter %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pAmoebaOutOfPlaneBendParameter
);
...
...
@@ -323,19 +323,19 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
(
void
)
fprintf
(
log
,
" solventDielectric %10.3f
\n
"
,
amoebaGpu
->
solventDielectric
);
(
void
)
fprintf
(
log
,
" pGamma %10.3f
\n
"
,
amoebaGpu
->
pGamma
);
(
void
)
fprintf
(
log
,
" scalingDistanceCutoff %10.3f
\n
"
,
amoebaGpu
->
scalingDistanceCutoff
);
(
void
)
fprintf
(
log
,
" scalingDistanceCutoff %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
scalingDistanceCutoff
);
(
void
)
fprintf
(
log
,
" scalingDistanceCutoff %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
scalingDistanceCutoff
);
(
void
)
fprintf
(
log
,
" pDampingFactorAndThole %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pDampingFactorAndThole
);
(
void
)
fprintf
(
log
,
" pScaleIndicesIndex %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pScaleIndicesIndex
);
(
void
)
fprintf
(
log
,
" pD_ScaleIndices %p
\n
"
,
amoebaGpu
->
amoebaSim
.
pD_ScaleIndices
);
(
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
,
" electric %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
electric
);
(
void
)
fprintf
(
log
,
" gkc %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
gkc
);
(
void
)
fprintf
(
log
,
" dielec %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
dielec
);
(
void
)
fprintf
(
log
,
" dwater %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
dwater
);
(
void
)
fprintf
(
log
,
" fc %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
fc
);
(
void
)
fprintf
(
log
,
" fd %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
fd
);
(
void
)
fprintf
(
log
,
" fq %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
fq
);
(
void
)
fprintf
(
log
,
" electric %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
electric
);
(
void
)
fprintf
(
log
,
" gkc %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
gkc
);
(
void
)
fprintf
(
log
,
" dielec %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
dielec
);
(
void
)
fprintf
(
log
,
" dwater %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
dwater
);
(
void
)
fprintf
(
log
,
" fc %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
fc
);
(
void
)
fprintf
(
log
,
" fd %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
fd
);
(
void
)
fprintf
(
log
,
" fq %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
fq
);
gpuPrintCudaStreamFloat2
(
amoebaGpu
->
psDampingFactorAndThole
,
log
);
...
...
@@ -375,9 +375,9 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
gpuPrintCudaStreamFloat
(
amoebaGpu
->
psKirkwoodForce
,
log
);
gpuPrintCudaStreamFloat
(
amoebaGpu
->
psKirkwoodEDiffForce
,
log
);
(
void
)
fprintf
(
log
,
" includeObcCavityTerm %d
\n
"
,
amoebaGpu
->
includeObcCavityTerm
);
(
void
)
fprintf
(
log
,
" dielectricOffset %1
4
.7e
\n
"
,
gpu
->
sim
.
dielectricOffset
);
(
void
)
fprintf
(
log
,
" probeRadius %1
4
.7e
\n
"
,
gpu
->
sim
.
probeRadius
);
(
void
)
fprintf
(
log
,
" surfaceAreaFactor %1
4
.7e
\n
"
,
gpu
->
sim
.
surfaceAreaFactor
);
(
void
)
fprintf
(
log
,
" dielectricOffset %1
5
.7e
\n
"
,
gpu
->
sim
.
dielectricOffset
);
(
void
)
fprintf
(
log
,
" probeRadius %1
5
.7e
\n
"
,
gpu
->
sim
.
probeRadius
);
(
void
)
fprintf
(
log
,
" surfaceAreaFactor %1
5
.7e
\n
"
,
gpu
->
sim
.
surfaceAreaFactor
);
(
void
)
fprintf
(
log
,
"
\n
"
);
...
...
@@ -404,14 +404,14 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
gpuPrintCudaStreamFloat2
(
amoebaGpu
->
psWcaDispersionRadiusEpsilon
,
log
);
(
void
)
fprintf
(
log
,
"
\n
"
);
(
void
)
fprintf
(
log
,
" epso %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
epso
);
(
void
)
fprintf
(
log
,
" epsh %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
epsh
);
(
void
)
fprintf
(
log
,
" rmino %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
rmino
);
(
void
)
fprintf
(
log
,
" rminh %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
rminh
);
(
void
)
fprintf
(
log
,
" awater %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
awater
);
(
void
)
fprintf
(
log
,
" shctd %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
shctd
);
(
void
)
fprintf
(
log
,
" dispoff %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
dispoff
);
(
void
)
fprintf
(
log
,
" totalMaxWcaDispersionEnergy %1
4
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
totalMaxWcaDispersionEnergy
);
(
void
)
fprintf
(
log
,
" epso %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
epso
);
(
void
)
fprintf
(
log
,
" epsh %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
epsh
);
(
void
)
fprintf
(
log
,
" rmino %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
rmino
);
(
void
)
fprintf
(
log
,
" rminh %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
rminh
);
(
void
)
fprintf
(
log
,
" awater %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
awater
);
(
void
)
fprintf
(
log
,
" shctd %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
shctd
);
(
void
)
fprintf
(
log
,
" dispoff %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
dispoff
);
(
void
)
fprintf
(
log
,
" totalMaxWcaDispersionEnergy %1
5
.7e
\n
"
,
amoebaGpu
->
amoebaSim
.
totalMaxWcaDispersionEnergy
);
(
void
)
fflush
(
log
);
...
...
@@ -448,7 +448,7 @@ void gpuSetAmoebaBondParameters(amoebaGpuContext amoebaGpu, const std::vector<in
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
amoebaGpu
->
log
&&
(
i
<
DUMP_PARAMETERS
||
i
>
bonds
-
(
DUMP_PARAMETERS
+
1
)
)
)
fprintf
(
amoebaGpu
->
log
,
"Bonds: %5d [%5d %5d %5d %5d] L=%1
4
.7e k[%1
4
.7e %1
4
.7e %1
4
.7e] [%5d %5d]
\n
"
,
fprintf
(
amoebaGpu
->
log
,
"Bonds: %5d [%5d %5d %5d %5d] L=%1
5
.7e k[%1
5
.7e %1
5
.7e %1
5
.7e] [%5d %5d]
\n
"
,
i
,
(
*
psBondID
)[
i
].
x
,
(
*
psBondID
)[
i
].
y
,
(
*
psBondID
)[
i
].
z
,
(
*
psBondID
)[
i
].
w
,
(
*
psBondParameter
)[
i
].
x
,
(
*
psBondParameter
)[
i
].
y
,
cubic
,
quartic
,
gpu
->
pOutputBufferCounter
[(
*
psBondID
)[
i
].
x
],
...
...
@@ -503,7 +503,7 @@ void gpuSetAmoebaAngleParameters(amoebaGpuContext amoebaGpu, const std::vector<i
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
bond_angles
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"Angles: %5d [%5d %5d %5d] [%5d %5d %5d] A=%1
4
.7e k[%1
4
.7e %1
4
.7e] [%5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"Angles: %5d [%5d %5d %5d] [%5d %5d %5d] A=%1
5
.7e k[%1
5
.7e %1
5
.7e] [%5d %5d %5d]
\n
"
,
i
,
(
*
psAngleID1
)[
i
].
x
,
(
*
psAngleID1
)[
i
].
y
,
(
*
psAngleID1
)[
i
].
z
,
(
*
psAngleID1
)[
i
].
w
,
(
*
psAngleID2
)[
i
].
x
,
(
*
psAngleID2
)[
i
].
y
,
(
*
psAngleParameter
)[
i
].
x
,
(
*
psAngleParameter
)[
i
].
y
,
...
...
@@ -563,7 +563,7 @@ void gpuSetAmoebaInPlaneAngleParameters(amoebaGpuContext amoebaGpu, const std::v
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
bond_angles
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"InPlaneAngles: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] A=%1
4
.7e k[%1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e] [%5d %5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"InPlaneAngles: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] A=%1
5
.7e k[%1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e] [%5d %5d %5d %5d]
\n
"
,
i
,
(
*
psAngleID1
)[
i
].
x
,
(
*
psAngleID1
)[
i
].
y
,
(
*
psAngleID1
)[
i
].
z
,
(
*
psAngleID1
)[
i
].
w
,
(
*
psAngleID2
)[
i
].
x
,
(
*
psAngleID2
)[
i
].
y
,
(
*
psAngleID2
)[
i
].
z
,
(
*
psAngleID2
)[
i
].
w
,
(
*
psAngleParameter
)[
i
].
x
,
(
*
psAngleParameter
)[
i
].
y
,
...
...
@@ -632,7 +632,7 @@ void gpuSetAmoebaTorsionParameters(amoebaGpuContext amoebaGpu, const std::vector
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
torsions
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"Torsions: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] 0[%1
4
.7e %1
4
.7e] 1[%1
4
.7e %1
4
.7e] 2[%1
4
.7e %1
4
.7e] [%5d %5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"Torsions: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] 0[%1
5
.7e %1
5
.7e] 1[%1
5
.7e %1
5
.7e] 2[%1
5
.7e %1
5
.7e] [%5d %5d %5d %5d]
\n
"
,
i
,
(
*
psTorsionID1
)[
i
].
x
,
(
*
psTorsionID1
)[
i
].
y
,
(
*
psTorsionID1
)[
i
].
z
,
(
*
psTorsionID1
)[
i
].
w
,
(
*
psTorsionID2
)[
i
].
x
,
(
*
psTorsionID2
)[
i
].
y
,
(
*
psTorsionID2
)[
i
].
z
,
(
*
psTorsionID2
)[
i
].
w
,
(
*
psTorsionParameter1
)[
i
].
x
,
(
*
psTorsionParameter1
)[
i
].
y
,
(
*
psTorsionParameter1
)[
i
].
z
,
(
*
psTorsionParameter1
)[
i
].
w
,
...
...
@@ -700,7 +700,7 @@ void gpuSetAmoebaPiTorsionParameters(amoebaGpuContext amoebaGpu, const std::vect
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
piTorsions
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"PiTorsions: %5d [%5d %5d %5d %5d %5d %5d [%5d %5d %5d %5d %5d %5d] k=%1
4
.7e [%5d %5d %5d %5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"PiTorsions: %5d [%5d %5d %5d %5d %5d %5d [%5d %5d %5d %5d %5d %5d] k=%1
5
.7e [%5d %5d %5d %5d %5d %5d]
\n
"
,
i
,
(
*
psPiTorsionID1
)[
i
].
x
,
(
*
psPiTorsionID1
)[
i
].
y
,
(
*
psPiTorsionID1
)[
i
].
z
,
(
*
psPiTorsionID1
)[
i
].
w
,
(
*
psPiTorsionID2
)[
i
].
x
,
(
*
psPiTorsionID2
)[
i
].
y
,
(
*
psPiTorsionID2
)[
i
].
z
,
(
*
psPiTorsionID2
)[
i
].
w
,
(
*
psPiTorsionID3
)[
i
].
x
,
(
*
psPiTorsionID3
)[
i
].
y
,
(
*
psPiTorsionID3
)[
i
].
z
,
(
*
psPiTorsionID3
)[
i
].
w
,
...
...
@@ -760,7 +760,7 @@ void gpuSetAmoebaStretchBendParameters(amoebaGpuContext amoebaGpu, const std::ve
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
stretchBends
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"StretchBends: %5d [%5d %5d %5d] [%5d %5d %5d] [%1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e [%5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"StretchBends: %5d [%5d %5d %5d] [%5d %5d %5d] [%1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e [%5d %5d %5d]
\n
"
,
i
,
(
*
psStretchBendID1
)[
i
].
x
,
(
*
psStretchBendID1
)[
i
].
y
,
(
*
psStretchBendID1
)[
i
].
z
,
(
*
psStretchBendID1
)[
i
].
w
,
(
*
psStretchBendID2
)[
i
].
x
,
(
*
psStretchBendID2
)[
i
].
y
,
(
*
psStretchBendParameter
)[
i
].
x
,
(
*
psStretchBendParameter
)[
i
].
y
,
(
*
psStretchBendParameter
)[
i
].
z
,
(
*
psStretchBendParameter
)[
i
].
w
,
...
...
@@ -806,7 +806,7 @@ void gpuSetAmoebaOutOfPlaneBendParameters(amoebaGpuContext amoebaGpu, const std:
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"OutOfPlaneBends: global ks[%1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e]
\n
"
,
cubicK
,
quarticK
,
penticK
,
sexticK
);
fprintf
(
amoebaGpu
->
log
,
"OutOfPlaneBends: global ks[%1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e]
\n
"
,
cubicK
,
quarticK
,
penticK
,
sexticK
);
#endif
for
(
int
i
=
0
;
i
<
outOfPlaneBends
;
i
++
)
...
...
@@ -823,7 +823,7 @@ void gpuSetAmoebaOutOfPlaneBendParameters(amoebaGpuContext amoebaGpu, const std:
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
outOfPlaneBends
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"OutOfPlaneBends: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] k=%1
4
.7e [%5d %5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"OutOfPlaneBends: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] k=%1
5
.7e [%5d %5d %5d %5d]
\n
"
,
i
,
(
*
psOutOfPlaneBendID1
)[
i
].
x
,
(
*
psOutOfPlaneBendID1
)[
i
].
y
,
(
*
psOutOfPlaneBendID1
)[
i
].
z
,
(
*
psOutOfPlaneBendID1
)[
i
].
w
,
(
*
psOutOfPlaneBendID2
)[
i
].
x
,
(
*
psOutOfPlaneBendID2
)[
i
].
y
,
(
*
psOutOfPlaneBendID2
)[
i
].
z
,
(
*
psOutOfPlaneBendID2
)[
i
].
w
,
(
*
psOutOfPlaneBendParameter
)[
i
],
...
...
@@ -957,7 +957,7 @@ void gpuSetAmoebaTorsionTorsionGrids(amoebaGpuContext amoebaGpu, const std::vect
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
if
(
(
index
<
DUMP_PARAMETERS
||
index
>
totalEntries
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"TorsionTorsionGrid: %d %5d [%5d %5d ] [%10.3f %10.3f] [%1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e]
\n
"
,
index
,
ii
,
jj
,
kk
,
fprintf
(
amoebaGpu
->
log
,
"TorsionTorsionGrid: %d %5d [%5d %5d ] [%10.3f %10.3f] [%1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e]
\n
"
,
index
,
ii
,
jj
,
kk
,
floatGrids
[
ii
][
jj
][
kk
][
0
],
floatGrids
[
ii
][
jj
][
kk
][
1
],
(
*
psTorsionTorsionGrids
)[
index
].
x
,
(
*
psTorsionTorsionGrids
)[
index
].
y
,
(
*
psTorsionTorsionGrids
)[
index
].
z
,
(
*
psTorsionTorsionGrids
)[
index
].
w
);
#endif
...
...
@@ -1004,7 +1004,7 @@ if( (index < DUMP_PARAMETERS || index > totalEntries - (DUMP_PARAMETERS + 1)) &&
fabsf( values[1] - floatGrids[ii][jj][kk][3] ) > epsilon ||
fabsf( values[2] - floatGrids[ii][jj][kk][4] ) > epsilon ||
fabsf( values[3] - floatGrids[ii][jj][kk][5] ) > epsilon ){
(void) fprintf( amoebaGpu->log, "Error %u %u %u [%10.3f %10.3f] [%1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e] lk=[%1
4
.7e %1
4
.7e %1
4
.7e %1
4
.7e]\n", ii, jj, kk,
(void) fprintf( amoebaGpu->log, "Error %u %u %u [%10.3f %10.3f] [%1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e] lk=[%1
5
.7e %1
5
.7e %1
5
.7e %1
5
.7e]\n", ii, jj, kk,
floatGrids[ii][jj][kk][0], floatGrids[ii][jj][kk][1],
floatGrids[ii][jj][kk][2], floatGrids[ii][jj][kk][3], floatGrids[ii][jj][kk][4], floatGrids[ii][jj][kk][5],
values[0], values[1], values[2], values[3] );
...
...
@@ -2113,7 +2113,7 @@ void gpuSetAmoebaVdwParameters( amoebaGpuContext amoebaGpu,
amoebaGpu
->
vdwSigmaCombiningRule
,
amoebaGpu
->
vdwEpsilonCombiningRule
);
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
natoms
;
ii
++
)
{
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %1
4
.7e %1
4
.7e
\n
"
,
ii
,
sigmas
[
ii
],
epsilons
[
ii
]
);
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %1
5
.7e %1
5
.7e
\n
"
,
ii
,
sigmas
[
ii
],
epsilons
[
ii
]
);
if
(
ii
==
maxPrint
&&
ii
<
(
amoebaGpu
->
paddedNumberOfAtoms
-
maxPrint
)
)
{
ii
=
(
amoebaGpu
->
paddedNumberOfAtoms
-
maxPrint
);
...
...
@@ -2409,7 +2409,7 @@ void gpuSetAmoebaWcaDispersionParameters( amoebaGpuContext amoebaGpu,
methodName
,
radii
.
size
(),
totalMaxWcaDisperionEnergy
,
epso
,
epsh
,
rmino
,
rminh
,
awater
,
shctd
,
dispoff
);
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
natoms
;
ii
++
)
{
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %1
4
.7e %1
4
.7e
\n
"
,
ii
,
radii
[
ii
],
epsilons
[
ii
]
);
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %1
5
.7e %1
5
.7e
\n
"
,
ii
,
radii
[
ii
],
epsilons
[
ii
]
);
if
(
ii
==
maxPrint
&&
ii
<
(
amoebaGpu
->
paddedNumberOfAtoms
-
maxPrint
)
)
{
ii
=
(
amoebaGpu
->
paddedNumberOfAtoms
-
maxPrint
);
...
...
@@ -2476,7 +2476,7 @@ float scaleRadius = 10.0f;
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%s probeRadius=%12.3f
\n
"
,
methodName
,
probeRadius
);
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
natoms
;
ii
++
)
{
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %1
4
.7e %1
4
.7e
\n
"
,
ii
,
radii
[
ii
],
weights
[
ii
]
);
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %1
5
.7e %1
5
.7e
\n
"
,
ii
,
radii
[
ii
],
weights
[
ii
]
);
if
(
ii
==
maxPrint
&&
ii
<
(
amoebaGpu
->
paddedNumberOfAtoms
-
maxPrint
)
)
{
ii
=
(
amoebaGpu
->
paddedNumberOfAtoms
-
maxPrint
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
View file @
12680294
...
...
@@ -759,6 +759,7 @@ static void cudaComputeAmoebaMutualInducedAndGkFieldBySOR( amoebaGpuContext amoe
static
int
timestep
=
0
;
timestep
++
;
static
const
char
*
methodName
=
"cudaComputeAmoebaMutualInducedAndGkFieldBySOR"
;
static
double
iterationStat
[
6
]
=
{
0.0
,
0.0
,
1000.0
,
0.0
,
0.0
,
0.0
};
#ifdef AMOEBA_DEBUG
std
::
vector
<
int
>
fileId
;
fileId
.
resize
(
2
);
...
...
@@ -981,9 +982,24 @@ time_t start = clock();
amoebaGpu
->
mutualInducedConverged
=
(
!
done
||
iteration
>
amoebaGpu
->
mutualInducedMaxIterations
)
?
0
:
1
;
if
(
amoebaGpu
->
log
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%s done=%d converged=%d iteration=%d eps=%14.7e
\n
"
,
methodName
,
done
,
amoebaGpu
->
mutualInducedConverged
,
iteration
,
amoebaGpu
->
mutualInducedCurrentEpsilon
);
static
int
count
=
0
;
count
++
;
double
interationD
=
static_cast
<
double
>
(
iteration
);
iterationStat
[
0
]
+=
interationD
;
iterationStat
[
1
]
+=
interationD
*
interationD
;
iterationStat
[
2
]
=
interationD
<
iterationStat
[
2
]
?
interationD
:
iterationStat
[
2
];
iterationStat
[
3
]
=
interationD
>
iterationStat
[
3
]
?
interationD
:
iterationStat
[
3
];
iterationStat
[
4
]
+=
1.0
;
if
(
count
==
100
){
double
average
=
iterationStat
[
0
]
/
iterationStat
[
4
];
double
stddev
=
iterationStat
[
1
]
-
average
*
average
*
iterationStat
[
4
];
stddev
=
sqrt
(
stddev
)
/
(
iterationStat
[
4
]
-
1.0
);
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%s iteration=%10.3f stddev=%10.3f min/max[%10.3f %10.3f] %10.1f eps=%14.7e
\n
"
,
methodName
,
average
,
stddev
,
iterationStat
[
2
],
iterationStat
[
3
],
iterationStat
[
4
],
amoebaGpu
->
mutualInducedCurrentEpsilon
);
(
void
)
fflush
(
amoebaGpu
->
log
);
iterationStat
[
0
]
=
iterationStat
[
1
]
=
iterationStat
[
4
]
=
0.0
;
count
=
0
;
}
}
#ifdef AMOEBA_DEBUG
...
...
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
View file @
12680294
...
...
@@ -88,7 +88,6 @@ static char* strsepLocal( char** lineBuffer, const char* delimiter ){
}
while
(
sc
!=
0
);
}
}
/**---------------------------------------------------------------------------------------
Tokenize a string
...
...
@@ -128,6 +127,31 @@ printf( "%c", *endOfLine ); fflush( stdout );
return
(
int
)
tokenArray
.
size
();
}
/**---------------------------------------------------------------------------------------
Tokenize a string
@param lineBuffer string to tokenize
@param tokenArray upon return vector of tokens
@param delimiter token delimter
@return number of tokens
--------------------------------------------------------------------------------------- */
int
tokenizeStringFromLineString
(
std
::
string
&
line
,
StringVector
&
tokenArray
,
const
std
::
string
delimiter
){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMUtilities::tokenizeString";
// ---------------------------------------------------------------------------------------
char
buffer
[
4096
];
(
void
)
strcpy
(
buffer
,
line
.
c_str
()
);
return
tokenizeString
(
buffer
,
tokenArray
,
delimiter
);
}
/**---------------------------------------------------------------------------------------
* Set field if in map
*
...
...
@@ -801,7 +825,9 @@ static int readAmoebaHarmonicBondParameters( FILE* filePtr, MapStringInt& forceM
if
(
useOpenMMUnits
){
double
cubic
=
bondForce
->
getAmoebaGlobalHarmonicBondCubic
()
/
AngstromToNm
;
double
quartic
=
bondForce
->
getAmoebaGlobalHarmonicBondQuartic
()
/
AngstromToNm
*
AngstromToNm
;
double
quartic
=
bondForce
->
getAmoebaGlobalHarmonicBondQuartic
()
/
(
AngstromToNm
*
AngstromToNm
);
//double cubic = bondForce->getAmoebaGlobalHarmonicBondCubic();
//double quartic = bondForce->getAmoebaGlobalHarmonicBondQuartic();
bondForce
->
setAmoebaGlobalHarmonicBondCubic
(
cubic
);
bondForce
->
setAmoebaGlobalHarmonicBondQuartic
(
quartic
);
...
...
@@ -822,7 +848,7 @@ static int readAmoebaHarmonicBondParameters( FILE* filePtr, MapStringInt& forceM
int
particle1
,
particle2
;
double
length
,
k
;
bondForce
->
getBondParameters
(
ii
,
particle1
,
particle2
,
length
,
k
);
(
void
)
fprintf
(
log
,
"%8d %8d %8d %15.7e
%15.7e %15.7e
%15.7e
\n
"
,
ii
,
particle1
,
particle2
,
length
,
k
,
cubic
,
quartic
);
(
void
)
fprintf
(
log
,
"%8d %8d %8d %15.7e %15.7e
\n
"
,
ii
,
particle1
,
particle2
,
length
,
k
);
// skip to end
...
...
@@ -4587,6 +4613,112 @@ Context* createContext( const std::string& amoebaTinkerParameterFileName, MapStr
}
void
checkIntermediateStatesUsingAmoebaTinkerParameterFile
(
const
std
::
string
&
amoebaTinkerParameterFileName
,
MapStringInt
&
forceMap
,
int
useOpenMMUnits
,
MapStringString
&
inputArgumentMap
,
FILE
*
summaryFile
,
FILE
*
log
)
{
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"checkIntermediateStatesUsingAmoebaTinkerParameterFile"
;
std
::
string
statesFileName
=
"states.txt"
;
// ---------------------------------------------------------------------------------------
setStringFromMap
(
inputArgumentMap
,
"states"
,
statesFileName
);
StringVector
forceList
;
std
::
string
activeForceNames
;
for
(
MapStringInt
::
const_iterator
ii
=
forceMap
.
begin
();
ii
!=
forceMap
.
end
();
ii
++
){
if
(
ii
->
second
){
forceList
.
push_back
(
ii
->
first
);
activeForceNames
+=
ii
->
first
+
":"
;
}
}
if
(
forceList
.
size
()
>=
11
){
activeForceNames
=
ALL_FORCES
;
}
MapStringVec3
tinkerForces
;
MapStringDouble
tinkerEnergies
;
MapStringVectorOfVectors
supplementary
;
MapStringIntI
isPresent
=
forceMap
.
find
(
AMOEBA_GK_FORCE
);
bool
gkIsActive
;
if
(
isPresent
!=
forceMap
.
end
()
&&
isPresent
->
second
!=
0
){
forceMap
[
AMOEBA_MULTIPOLE_FORCE
]
=
1
;
gkIsActive
=
true
;
}
else
{
gkIsActive
=
false
;
}
// read parameters into system and coord/velocities into appropriate arrays
// and create context
Context
*
context
=
createContext
(
amoebaTinkerParameterFileName
,
forceMap
,
useOpenMMUnits
,
inputArgumentMap
,
supplementary
,
tinkerForces
,
tinkerEnergies
,
log
);
StringVectorVector
fileContents
;
readFile
(
statesFileName
,
fileContents
,
log
);
unsigned
int
lineIndex
=
0
;
unsigned
int
stateIndex
=
0
;
//fprintf( log, "%8u total lines\n", fileContents.size() );
while
(
lineIndex
<
(
fileContents
.
size
()
-
1
)
){
/*
fprintf( log, "%8u Line %u state=%u ", lineIndex, fileContents[lineIndex].size(), stateIndex );
for( int ii = 0; ii < fileContents[lineIndex].size(); ii++ ){
fprintf( log, "%s ", fileContents[lineIndex][ii].c_str() );
}
fprintf( log, "\n" ); fflush( log ); */
int
numberOfAtoms
=
atoi
(
fileContents
[
lineIndex
++
][
0
].
c_str
()
);
stateIndex
++
;
std
::
vector
<
Vec3
>
coordinates
;
coordinates
.
resize
(
numberOfAtoms
);
int
skip
=
0
;
for
(
int
ii
=
0
;
ii
<
numberOfAtoms
;
ii
++
){
StringVector
&
stateTokenArray
=
fileContents
[
lineIndex
++
];
/*
fprintf( log, "%8u xLine %u state=%u ", lineIndex, fileContents[lineIndex-1].size(), stateIndex );
for( int ii = 0; ii < fileContents[lineIndex-1].size(); ii++ ){
fprintf( log, "%s ", fileContents[lineIndex-1][ii].c_str() );
}
fprintf( log, "\n" ); fflush( log ); */
if
(
stateTokenArray
[
1
]
==
"nan"
||
stateTokenArray
[
2
]
==
"nan"
||
stateTokenArray
[
3
]
==
"nan"
){
skip
=
1
;
}
else
{
coordinates
[
ii
]
=
Vec3
(
atof
(
stateTokenArray
[
1
].
c_str
()
),
atof
(
stateTokenArray
[
2
].
c_str
()
),
atof
(
stateTokenArray
[
3
].
c_str
()
)
);
}
}
if
(
skip
){
(
void
)
fprintf
(
log
,
"Skipping state=%u line=%u
\n
"
,
stateIndex
,
lineIndex
);
}
else
{
(
void
)
fprintf
(
log
,
"State=%u coordinates=%u
\n
"
,
stateIndex
,
coordinates
.
size
()
);
context
->
setPositions
(
coordinates
);
State
state
=
context
->
getState
(
State
::
Forces
|
State
::
Energy
);
System
&
system
=
context
->
getSystem
();
//std::vector<Vec3> forces = state.getForces();
//double kineticEnergy = state.getPotentialEnergy();
double
potentialEnergy
=
state
.
getPotentialEnergy
();
if
(
summaryFile
){
int
lastIndex
=
coordinates
.
size
()
-
1
;
FILE
*
filePtr
=
summaryFile
;
(
void
)
fprintf
(
filePtr
,
"%8u %15.7e %30s [%15.7e %15.7e %15.7e] [%15.7e %15.7e %15.7e]
\n
"
,
stateIndex
,
potentialEnergy
,
activeForceNames
.
c_str
(),
coordinates
[
0
][
0
],
coordinates
[
0
][
1
],
coordinates
[
0
][
2
],
coordinates
[
lastIndex
][
0
],
coordinates
[
lastIndex
][
1
],
coordinates
[
lastIndex
][
2
]
);
(
void
)
fflush
(
filePtr
);
}
}
}
}
void
testUsingAmoebaTinkerParameterFile
(
const
std
::
string
&
amoebaTinkerParameterFileName
,
MapStringInt
&
forceMap
,
int
useOpenMMUnits
,
MapStringString
&
inputArgumentMap
,
FILE
*
summaryFile
,
FILE
*
log
)
{
...
...
@@ -5443,7 +5575,7 @@ void testEnergyConservation( std::string parameterFileName, MapStringInt& forceM
// check that energy fluctuation is within tolerance
ASSERT_EQUAL_TOL
(
stddevE
,
0.0
,
energyTolerance
);
//
ASSERT_EQUAL_TOL( stddevE, 0.0, energyTolerance );
}
...
...
@@ -5489,6 +5621,7 @@ int runTestsUsingAmoebaTinkerParameterFile( MapStringString& argumentMap ){
int
checkForces
=
1
;
int
checkEnergyForceConsistency
=
0
;
int
checkEnergyConservation
=
0
;
int
checkIntermediateStates
=
0
;
// parse arguments
...
...
@@ -5510,10 +5643,10 @@ int runTestsUsingAmoebaTinkerParameterFile( MapStringString& argumentMap ){
useOpenMMUnits
=
atoi
(
value
.
c_str
()
);
}
else
if
(
key
==
"checkEnergyForceConsistency"
){
checkEnergyForceConsistency
=
atoi
(
value
.
c_str
()
);
//if( checkEnergyForceConsistency )checkForces = 0;
}
else
if
(
key
==
"checkEnergyConservation"
){
checkEnergyConservation
=
atoi
(
value
.
c_str
()
);
//if( checkEnergyForceConsistency )checkForces = 0;
}
else
if
(
key
==
"checkIntermediateStates"
){
checkIntermediateStates
=
atoi
(
value
.
c_str
()
);
}
else
if
(
key
==
"log"
){
logControl
=
atoi
(
value
.
c_str
()
);
}
else
if
(
key
==
ALL_FORCES
){
...
...
@@ -5601,6 +5734,12 @@ int runTestsUsingAmoebaTinkerParameterFile( MapStringString& argumentMap ){
testEnergyConservation
(
parameterFileName
,
forceMap
,
useOpenMMUnits
,
inputArgumentMap
,
log
,
summaryFile
);
}
else
if
(
checkIntermediateStates
){
// args:
checkIntermediateStatesUsingAmoebaTinkerParameterFile
(
parameterFileName
,
forceMap
,
useOpenMMUnits
,
inputArgumentMap
,
summaryFile
,
log
);
}
else
{
// args:
// tolerance
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaForceFromParameterFile.cpp
View file @
12680294
...
...
@@ -45,21 +45,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
/*
//std::string openmmPluginDirectory = "/cygdrive/c/cygwin/home/friedrim/src/openmm/trunk/OpenMM/bin/release";
std::vector<std::string> pluginDirectories;
pluginDirectories.push_back( "C:\\cygwin\\home\\friedrim\\src\\openmm\\trunk\\OpenMM\\bin\\Release" );
//pluginDirectories.push_back( "C:\\cygwin\\home\\friedrim\\src\\openmm\\trunk\\OpenMM\\bin" );
//pluginDirectories.push_back( "/cygdrive/c/cygwin/home/friedrim/src/openmm/trunk/OpenMM/bin/Release" );
//pluginDirectories.push_back( "/cygdrive/c/cygwin/home/friedrim/src/openmm/trunk/OpenMM/bin" );
for( unsigned int ii = 0; ii < pluginDirectories.size(); ii++ ){
std::string openmmPluginDirectory = pluginDirectories[ii];
std::cout << "Plugin directory: " << openmmPluginDirectory << std::endl;
Platform::loadPluginsFromDirectory( openmmPluginDirectory );
}
*/
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
if
(
numberOfArguments
>
1
){
MapStringString
argumentMap
;
appendInputArgumentsToArgumentMap
(
numberOfArguments
,
argv
,
argumentMap
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicAngleForce.cpp
View file @
12680294
...
...
@@ -294,8 +294,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
fopen
(
"AmoebaHarmonicAngleForce.log"
,
"w"
);;
testOneAngle
(
log
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
View file @
12680294
...
...
@@ -200,8 +200,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
stderr
;
testOneBond
(
log
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicInPlaneAngleForce.cpp
View file @
12680294
...
...
@@ -371,8 +371,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
fopen
(
"AmoebaHarmonicInPlaneAngleForce.log"
,
"w"
);;
testOneAngle
(
NULL
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
View file @
12680294
...
...
@@ -493,8 +493,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
fopen
(
"AmoebaOutOfPlaneBendForce1.log"
,
"w"
);;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
View file @
12680294
...
...
@@ -302,8 +302,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
fopen
(
"AmoebaPiTorsionForce1.log"
,
"w"
);;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
View file @
12680294
...
...
@@ -284,8 +284,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
fopen
(
"AmoebaStretchBendForce1.log"
,
"w"
);;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionForce.cpp
View file @
12680294
...
...
@@ -331,8 +331,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
fopen
(
"AmoebaTorsionForce1.log"
,
"w"
);;
testOneTorsion
(
log
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
View file @
12680294
...
...
@@ -305,8 +305,7 @@ int main( int numberOfArguments, char* argv[] ) {
try
{
std
::
cout
<<
"Running test..."
<<
std
::
endl
;
std
::
string
openmmPluginDirectory
=
"/home/friedrim/src/openmm/trunk/OpenMM/bin"
;
Platform
::
loadPluginsFromDirectory
(
openmmPluginDirectory
);
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaTorsionTorsionForce1.log", "w" );;
...
...
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