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
a18b750b
Unverified
Commit
a18b750b
authored
Sep 28, 2023
by
Peter Eastman
Committed by
GitHub
Sep 28, 2023
Browse files
Fixed error in accumulating parameter derivatives (#4249)
parent
76be194c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+2
-1
platforms/common/src/kernels/customNonbondedGroups.cc
platforms/common/src/kernels/customNonbondedGroups.cc
+1
-1
No files found.
platforms/common/src/CommonKernels.cpp
View file @
a18b750b
...
...
@@ -2315,7 +2315,7 @@ void CommonCalcCustomNonbondedForceKernel::initInteractionGroups(const CustomNon
initDerivs
<<
"mixed "
<<
derivVariable
<<
" = 0;
\n
"
;
for
(
int
index
=
0
;
index
<
numDerivs
;
index
++
)
if
(
allParamDerivNames
[
index
]
==
paramName
)
saveDerivs<<"energyParamDerivs[GLOBAL_ID*
"<<
numDeriv
s<<"
+"<<index<<"] += "<<derivVariable<<";\n";
saveDerivs
<<
"energyParamDerivs[GLOBAL_ID*numDeriv
atives
+"
<<
index
<<
"] += "
<<
derivVariable
<<
";
\n
"
;
}
replacements
[
"INIT_DERIVATIVES"
]
=
initDerivs
.
str
();
replacements
[
"SAVE_DERIVATIVES"
]
=
saveDerivs
.
str
();
...
...
@@ -2391,6 +2391,7 @@ double CommonCalcCustomNonbondedForceKernel::execute(ContextImpl& context, bool
interactionGroupKernel
->
addArg
((
int
)
useNeighborList
);
for
(
int
i
=
0
;
i
<
5
;
i
++
)
interactionGroupKernel
->
addArg
();
// Periodic box information will be set just before it is executed.
interactionGroupKernel
->
addArg
((
int
)
cc
.
getEnergyParamDerivNames
().
size
());
for
(
auto
&
buffer
:
paramBuffers
)
interactionGroupKernel
->
addArg
(
buffer
.
getArray
());
for
(
auto
&
buffer
:
computedValueBuffers
)
...
...
platforms/common/src/kernels/customNonbondedGroups.cc
View file @
a18b750b
...
...
@@ -39,7 +39,7 @@ KERNEL void computeInteractionGroups(
GLOBAL
mm_ulong
*
RESTRICT
forceBuffers
,
GLOBAL
mixed
*
RESTRICT
energyBuffer
,
GLOBAL
const
real4
*
RESTRICT
posq
,
GLOBAL
const
int4
*
RESTRICT
groupData
,
GLOBAL
const
int
*
RESTRICT
numGroupTiles
,
int
useNeighborList
,
real4
periodicBoxSize
,
real4
invPeriodicBoxSize
,
real4
periodicBoxVecX
,
real4
periodicBoxVecY
,
real4
periodicBoxVecZ
real4
periodicBoxSize
,
real4
invPeriodicBoxSize
,
real4
periodicBoxVecX
,
real4
periodicBoxVecY
,
real4
periodicBoxVecZ
,
int
numDerivatives
PARAMETER_ARGUMENTS
)
{
const
unsigned
int
totalWarps
=
GLOBAL_SIZE
/
TILE_SIZE
;
const
unsigned
int
warp
=
GLOBAL_ID
/
TILE_SIZE
;
// global warpIndex
...
...
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