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
e2f659ce
Unverified
Commit
e2f659ce
authored
Sep 10, 2024
by
Peter Eastman
Committed by
GitHub
Sep 10, 2024
Browse files
Fixed numeric overflow (#4650)
parent
b28d2e66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
platforms/cpu/src/CpuSETTLE.cpp
platforms/cpu/src/CpuSETTLE.cpp
+4
-4
No files found.
platforms/cpu/src/CpuSETTLE.cpp
View file @
e2f659ce
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2013-20
18
Stanford University and the Authors. *
* Portions copyright (c) 2013-20
24
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -37,13 +37,13 @@ using namespace std;
...
@@ -37,13 +37,13 @@ using namespace std;
CpuSETTLE
::
CpuSETTLE
(
const
System
&
system
,
const
ReferenceSETTLEAlgorithm
&
settle
,
ThreadPool
&
threads
)
:
threads
(
threads
)
{
CpuSETTLE
::
CpuSETTLE
(
const
System
&
system
,
const
ReferenceSETTLEAlgorithm
&
settle
,
ThreadPool
&
threads
)
:
threads
(
threads
)
{
int
numBlocks
=
10
*
threads
.
getNumThreads
();
int
numBlocks
=
10
*
threads
.
getNumThreads
();
int
numClusters
=
settle
.
getNumClusters
();
long
long
numClusters
=
settle
.
getNumClusters
();
vector
<
double
>
mass
(
system
.
getNumParticles
());
vector
<
double
>
mass
(
system
.
getNumParticles
());
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
mass
[
i
]
=
system
.
getParticleMass
(
i
);
mass
[
i
]
=
system
.
getParticleMass
(
i
);
for
(
int
i
=
0
;
i
<
numBlocks
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numBlocks
;
i
++
)
{
int
start
=
i
*
numClusters
/
numBlocks
;
int
start
=
(
int
)
(
i
*
numClusters
/
numBlocks
)
;
int
end
=
(
i
+
1
)
*
numClusters
/
numBlocks
;
int
end
=
(
int
)
(
(
i
+
1
)
*
numClusters
/
numBlocks
)
;
if
(
start
!=
end
)
{
if
(
start
!=
end
)
{
int
numThreadClusters
=
end
-
start
;
int
numThreadClusters
=
end
-
start
;
vector
<
int
>
atom1
(
numThreadClusters
),
atom2
(
numThreadClusters
),
atom3
(
numThreadClusters
);
vector
<
int
>
atom1
(
numThreadClusters
),
atom2
(
numThreadClusters
),
atom3
(
numThreadClusters
);
...
...
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