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
813275a0
Commit
813275a0
authored
Jun 03, 2016
by
peastman
Browse files
Fixed incorrect checkpointing of reference random number generator
parent
32e08b87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
libraries/sfmt/src/SFMT.cpp
libraries/sfmt/src/SFMT.cpp
+2
-4
platforms/reference/src/SimTKReference/SimTKOpenMMUtilities.cpp
...rms/reference/src/SimTKReference/SimTKOpenMMUtilities.cpp
+3
-0
No files found.
libraries/sfmt/src/SFMT.cpp
View file @
813275a0
...
@@ -124,14 +124,12 @@ public:
...
@@ -124,14 +124,12 @@ public:
};
};
void
SFMT
::
createCheckpoint
(
std
::
ostream
&
stream
)
{
void
SFMT
::
createCheckpoint
(
std
::
ostream
&
stream
)
{
stream
.
write
((
char
*
)
&
data
->
baseData
,
sizeof
(
data
->
baseData
));
stream
.
write
((
char
*
)
data
->
sfmt
,
N
*
sizeof
(
w128_t
));
stream
.
write
((
char
*
)
&
data
->
sfmt
,
sizeof
(
data
->
sfmt
));
stream
.
write
((
char
*
)
&
data
->
idx
,
sizeof
(
data
->
idx
));
stream
.
write
((
char
*
)
&
data
->
idx
,
sizeof
(
data
->
idx
));
}
}
void
SFMT
::
loadCheckpoint
(
std
::
istream
&
stream
)
{
void
SFMT
::
loadCheckpoint
(
std
::
istream
&
stream
)
{
stream
.
read
((
char
*
)
&
data
->
baseData
,
sizeof
(
data
->
baseData
));
stream
.
read
((
char
*
)
data
->
sfmt
,
N
*
sizeof
(
w128_t
));
stream
.
read
((
char
*
)
&
data
->
sfmt
,
sizeof
(
data
->
sfmt
));
stream
.
read
((
char
*
)
&
data
->
idx
,
sizeof
(
data
->
idx
));
stream
.
read
((
char
*
)
&
data
->
idx
,
sizeof
(
data
->
idx
));
}
}
...
...
platforms/reference/src/SimTKReference/SimTKOpenMMUtilities.cpp
View file @
813275a0
...
@@ -383,8 +383,11 @@ void SimTKOpenMMUtilities::createCheckpoint(std::ostream& stream) {
...
@@ -383,8 +383,11 @@ void SimTKOpenMMUtilities::createCheckpoint(std::ostream& stream) {
void
SimTKOpenMMUtilities
::
loadCheckpoint
(
std
::
istream
&
stream
)
{
void
SimTKOpenMMUtilities
::
loadCheckpoint
(
std
::
istream
&
stream
)
{
stream
.
read
((
char
*
)
&
_randomNumberSeed
,
sizeof
(
uint32_t
));
stream
.
read
((
char
*
)
&
_randomNumberSeed
,
sizeof
(
uint32_t
));
bool
prevInitialized
=
_randomInitialized
;
stream
.
read
((
char
*
)
&
_randomInitialized
,
sizeof
(
bool
));
stream
.
read
((
char
*
)
&
_randomInitialized
,
sizeof
(
bool
));
if
(
_randomInitialized
)
{
if
(
_randomInitialized
)
{
if
(
!
prevInitialized
)
init_gen_rand
(
0
,
sfmt
);
stream
.
read
((
char
*
)
&
nextGaussianIsValid
,
sizeof
(
bool
));
stream
.
read
((
char
*
)
&
nextGaussianIsValid
,
sizeof
(
bool
));
stream
.
read
((
char
*
)
&
nextGaussian
,
sizeof
(
RealOpenMM
));
stream
.
read
((
char
*
)
&
nextGaussian
,
sizeof
(
RealOpenMM
));
sfmt
.
loadCheckpoint
(
stream
);
sfmt
.
loadCheckpoint
(
stream
);
...
...
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