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
aa7bd1cf
Commit
aa7bd1cf
authored
Feb 24, 2015
by
peastman
Browse files
Fixed problems running in PNaCl
parent
e670188b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
37 deletions
+9
-37
openmmapi/src/Context.cpp
openmmapi/src/Context.cpp
+3
-30
platforms/cpu/src/CpuKernels.cpp
platforms/cpu/src/CpuKernels.cpp
+4
-5
platforms/cpu/src/CpuNonbondedForce.cpp
platforms/cpu/src/CpuNonbondedForce.cpp
+1
-1
platforms/cpu/tests/TestCpuNeighborList.cpp
platforms/cpu/tests/TestCpuNeighborList.cpp
+1
-1
No files found.
openmmapi/src/Context.cpp
View file @
aa7bd1cf
...
@@ -143,42 +143,15 @@ State Context::getState(int types, bool enforcePeriodicBox, int groups) const {
...
@@ -143,42 +143,15 @@ State Context::getState(int types, bool enforcePeriodicBox, int groups) const {
}
}
void
Context
::
setState
(
const
State
&
state
)
{
void
Context
::
setState
(
const
State
&
state
)
{
// Determine what information the state contains.
bool
hasPositions
=
false
,
hasVelocities
=
false
,
hasParameters
=
false
;
try
{
state
.
getPositions
();
hasPositions
=
true
;
}
catch
(
OpenMMException
&
ex
)
{
// The State does not include positions.
}
try
{
state
.
getVelocities
();
hasVelocities
=
true
;
}
catch
(
OpenMMException
&
ex
)
{
// The State does not include velocities.
}
try
{
state
.
getParameters
();
hasParameters
=
true
;
}
catch
(
OpenMMException
&
ex
)
{
// The State does not include parameters.
}
// Copy it over.
setTime
(
state
.
getTime
());
setTime
(
state
.
getTime
());
Vec3
a
,
b
,
c
;
Vec3
a
,
b
,
c
;
state
.
getPeriodicBoxVectors
(
a
,
b
,
c
);
state
.
getPeriodicBoxVectors
(
a
,
b
,
c
);
setPeriodicBoxVectors
(
a
,
b
,
c
);
setPeriodicBoxVectors
(
a
,
b
,
c
);
if
(
has
Positions
)
if
(
(
state
.
getDataTypes
()
&
State
::
Positions
)
!=
0
)
setPositions
(
state
.
getPositions
());
setPositions
(
state
.
getPositions
());
if
(
has
Velocities
)
if
(
(
state
.
getDataTypes
()
&
State
::
Velocities
)
!=
0
)
setVelocities
(
state
.
getVelocities
());
setVelocities
(
state
.
getVelocities
());
if
(
has
Parameters
)
if
(
(
state
.
getDataTypes
()
&
State
::
Parameters
)
!=
0
)
for
(
map
<
string
,
double
>::
const_iterator
iter
=
state
.
getParameters
().
begin
();
iter
!=
state
.
getParameters
().
end
();
++
iter
)
for
(
map
<
string
,
double
>::
const_iterator
iter
=
state
.
getParameters
().
begin
();
iter
!=
state
.
getParameters
().
end
();
++
iter
)
setParameter
(
iter
->
first
,
iter
->
second
);
setParameter
(
iter
->
first
,
iter
->
second
);
}
}
...
...
platforms/cpu/src/CpuKernels.cpp
View file @
aa7bd1cf
...
@@ -508,13 +508,12 @@ double CpuCalcNonbondedForceKernel::execute(ContextImpl& context, bool includeFo
...
@@ -508,13 +508,12 @@ double CpuCalcNonbondedForceKernel::execute(ContextImpl& context, bool includeFo
if
(
nonbondedMethod
==
PME
)
{
if
(
nonbondedMethod
==
PME
)
{
// If available, use the optimized PME implementation.
// If available, use the optimized PME implementation.
try
{
vector
<
string
>
kernelNames
;
kernelNames
.
push_back
(
"CalcPmeReciprocalForce"
);
useOptimizedPme
=
getPlatform
().
supportsKernels
(
kernelNames
);
if
(
useOptimizedPme
)
{
optimizedPme
=
getPlatform
().
createKernel
(
CalcPmeReciprocalForceKernel
::
Name
(),
context
);
optimizedPme
=
getPlatform
().
createKernel
(
CalcPmeReciprocalForceKernel
::
Name
(),
context
);
optimizedPme
.
getAs
<
CalcPmeReciprocalForceKernel
>
().
initialize
(
gridSize
[
0
],
gridSize
[
1
],
gridSize
[
2
],
numParticles
,
ewaldAlpha
);
optimizedPme
.
getAs
<
CalcPmeReciprocalForceKernel
>
().
initialize
(
gridSize
[
0
],
gridSize
[
1
],
gridSize
[
2
],
numParticles
,
ewaldAlpha
);
useOptimizedPme
=
true
;
}
catch
(
OpenMMException
&
ex
)
{
// The CPU PME plugin isn't available.
}
}
}
}
}
}
...
...
platforms/cpu/src/CpuNonbondedForce.cpp
View file @
aa7bd1cf
...
@@ -216,7 +216,7 @@ void CpuNonbondedForce::calculateReciprocalIxn(int numberOfAtoms, float* posq, c
...
@@ -216,7 +216,7 @@ void CpuNonbondedForce::calculateReciprocalIxn(int numberOfAtoms, float* posq, c
// setup reciprocal box
// setup reciprocal box
float
recipBoxSize
[
3
]
=
{
TWO_PI
/
periodicBoxVectors
[
0
][
0
],
TWO_PI
/
periodicBoxVectors
[
1
][
1
],
TWO_PI
/
periodicBoxVectors
[
2
][
2
]};
float
recipBoxSize
[
3
]
=
{
(
float
)
(
TWO_PI
/
periodicBoxVectors
[
0
][
0
]
)
,
(
float
)
(
TWO_PI
/
periodicBoxVectors
[
1
][
1
]
)
,
(
float
)
(
TWO_PI
/
periodicBoxVectors
[
2
][
2
]
)
};
// setup K-vectors
// setup K-vectors
...
...
platforms/cpu/tests/TestCpuNeighborList.cpp
View file @
aa7bd1cf
...
@@ -62,7 +62,7 @@ void testNeighborList(bool periodic, bool triclinic) {
...
@@ -62,7 +62,7 @@ void testNeighborList(bool periodic, bool triclinic) {
boxVectors
[
1
]
=
RealVec
(
0
,
15
,
0
);
boxVectors
[
1
]
=
RealVec
(
0
,
15
,
0
);
boxVectors
[
2
]
=
RealVec
(
0
,
0
,
22
);
boxVectors
[
2
]
=
RealVec
(
0
,
0
,
22
);
}
}
const
float
boxSize
[
3
]
=
{
boxVectors
[
0
][
0
],
boxVectors
[
1
][
1
],
boxVectors
[
2
][
2
]};
const
float
boxSize
[
3
]
=
{
(
float
)
boxVectors
[
0
][
0
],
(
float
)
boxVectors
[
1
][
1
],
(
float
)
boxVectors
[
2
][
2
]};
const
int
blockSize
=
8
;
const
int
blockSize
=
8
;
OpenMM_SFMT
::
SFMT
sfmt
;
OpenMM_SFMT
::
SFMT
sfmt
;
init_gen_rand
(
0
,
sfmt
);
init_gen_rand
(
0
,
sfmt
);
...
...
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