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
e854f8f3
Unverified
Commit
e854f8f3
authored
Dec 20, 2023
by
Peter Eastman
Committed by
GitHub
Dec 20, 2023
Browse files
Fixed error in barostat (#4364)
parent
0e9ef3f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
platforms/common/include/openmm/common/CommonKernels.h
platforms/common/include/openmm/common/CommonKernels.h
+1
-1
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+3
-0
No files found.
platforms/common/include/openmm/common/CommonKernels.h
View file @
e854f8f3
...
...
@@ -1693,7 +1693,7 @@ private:
ComputeContext
&
cc
;
bool
hasInitializedKernels
,
rigidMolecules
,
atomsWereReordered
;
int
numMolecules
;
ComputeArray
savedPositions
,
savedFloatForces
,
savedLongForces
;
ComputeArray
savedPositions
,
savedFloatForces
,
savedLongForces
,
savedVelocities
;
ComputeArray
moleculeAtoms
;
ComputeArray
moleculeStartIndex
;
ComputeKernel
kernel
;
...
...
platforms/common/src/CommonKernels.cpp
View file @
e854f8f3
...
...
@@ -8034,6 +8034,7 @@ void CommonApplyMonteCarloBarostatKernel::initialize(const System& system, const
this
->
rigidMolecules
=
rigidMolecules
;
ContextSelector
selector
(
cc
);
savedPositions
.
initialize
(
cc
,
cc
.
getPaddedNumAtoms
(),
cc
.
getUseDoublePrecision
()
?
sizeof
(
mm_double4
)
:
sizeof
(
mm_float4
),
"savedPositions"
);
savedVelocities
.
initialize
(
cc
,
cc
.
getPaddedNumAtoms
(),
cc
.
getUseDoublePrecision
()
||
cc
.
getUseMixedPrecision
()
?
sizeof
(
mm_double4
)
:
sizeof
(
mm_float4
),
"savedVelocities"
);
savedLongForces
.
initialize
<
long
long
>
(
cc
,
cc
.
getPaddedNumAtoms
()
*
3
,
"savedLongForces"
);
try
{
cc
.
getFloatForceBuffer
();
// This will throw an exception on the CUDA platform.
...
...
@@ -8049,6 +8050,7 @@ void CommonApplyMonteCarloBarostatKernel::initialize(const System& system, const
void
CommonApplyMonteCarloBarostatKernel
::
saveCoordinates
(
ContextImpl
&
context
)
{
ContextSelector
selector
(
cc
);
cc
.
getPosq
().
copyTo
(
savedPositions
);
cc
.
getVelm
().
copyTo
(
savedVelocities
);
cc
.
getLongForceBuffer
().
copyTo
(
savedLongForces
);
if
(
savedFloatForces
.
isInitialized
())
cc
.
getFloatForceBuffer
().
copyTo
(
savedFloatForces
);
...
...
@@ -8112,6 +8114,7 @@ void CommonApplyMonteCarloBarostatKernel::scaleCoordinates(ContextImpl& context,
void
CommonApplyMonteCarloBarostatKernel
::
restoreCoordinates
(
ContextImpl
&
context
)
{
ContextSelector
selector
(
cc
);
savedPositions
.
copyTo
(
cc
.
getPosq
());
savedVelocities
.
copyTo
(
cc
.
getVelm
());
savedLongForces
.
copyTo
(
cc
.
getLongForceBuffer
());
cc
.
setPosCellOffsets
(
lastPosCellOffsets
);
if
(
savedFloatForces
.
isInitialized
())
...
...
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