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
d8c88e74
Commit
d8c88e74
authored
Aug 12, 2010
by
Mark Friedrichs
Browse files
Moved diagnostic check for nans
parent
0ba57257
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
+25
-23
No files found.
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
View file @
d8c88e74
...
...
@@ -4139,8 +4139,8 @@ void trackMutualInducedIterations( amoebaGpuContext amoebaGpu, int iteration){
// ---------------------------------------------------------------------------------------
if
(
amoebaGpu
->
log
==
NULL
||
currentStep
>
20000
)
return
;
//
if( amoebaGpu->log == NULL )return;
//
if( amoebaGpu->log == NULL || currentStep > 20000 )return;
if
(
amoebaGpu
->
log
==
NULL
)
return
;
gpuContext
gpu
=
amoebaGpu
->
gpuContext
;
currentStep
++
;
...
...
@@ -4159,6 +4159,26 @@ void trackMutualInducedIterations( amoebaGpuContext amoebaGpu, int iteration){
methodName
.
c_str
(),
currentStep
,
average
,
stddev
,
iterationStat
[
2
],
iterationStat
[
3
],
iterationStat
[
4
],
amoebaGpu
->
mutualInducedCurrentEpsilon
);
(
void
)
fflush
(
amoebaGpu
->
log
);
iterationStat
[
0
]
=
iterationStat
[
1
]
=
iterationStat
[
4
]
=
0.0
;
int
nansPresent
=
isNanOrInfinity
(
amoebaGpu
->
mutualInducedCurrentEpsilon
);
if
(
nansPresent
==
0
){
for
(
int
ii
=
0
;
ii
<
gpu
->
natoms
&&
nansPresent
==
0
;
ii
++
){
if
(
isNanOrInfinity
(
gpu
->
psPosq4
->
_pSysStream
[
0
][
ii
].
x
)
||
isNanOrInfinity
(
gpu
->
psPosq4
->
_pSysStream
[
0
][
ii
].
y
)
||
isNanOrInfinity
(
gpu
->
psPosq4
->
_pSysStream
[
0
][
ii
].
z
)
||
isNanOrInfinity
(
gpu
->
psVelm4
->
_pSysStream
[
0
][
ii
].
x
)
||
isNanOrInfinity
(
gpu
->
psVelm4
->
_pSysStream
[
0
][
ii
].
y
)
||
isNanOrInfinity
(
gpu
->
psVelm4
->
_pSysStream
[
0
][
ii
].
z
)
){
nansPresent
=
1
;
}
}
}
if
(
nansPresent
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"epsilon nan - exiting
\n
"
);
(
void
)
fflush
(
amoebaGpu
->
log
);
exit
(
-
1
);
}
}
if
(
0
){
std
::
vector
<
int
>
fileId
;
...
...
@@ -4182,24 +4202,6 @@ void trackMutualInducedIterations( amoebaGpuContext amoebaGpu, int iteration){
cudaLoadCudaFloatArray( gpu->natoms, 3, amoebaGpu->psInducedDipolePolarS,outputVector );
*/
cudaWriteVectorOfDoubleVectorsToFile
(
"CudaMI"
,
fileId
,
outputVector
);
int
nansPresent
=
isNanOrInfinity
(
amoebaGpu
->
mutualInducedCurrentEpsilon
);
if
(
nansPresent
==
0
){
for
(
int
ii
=
0
;
ii
<
gpu
->
natoms
&&
nansPresent
==
0
;
ii
++
){
if
(
isNanOrInfinity
(
gpu
->
psPosq4
->
_pSysStream
[
0
][
ii
].
x
)
||
isNanOrInfinity
(
gpu
->
psPosq4
->
_pSysStream
[
0
][
ii
].
y
)
||
isNanOrInfinity
(
gpu
->
psPosq4
->
_pSysStream
[
0
][
ii
].
z
)
||
isNanOrInfinity
(
gpu
->
psVelm4
->
_pSysStream
[
0
][
ii
].
x
)
||
isNanOrInfinity
(
gpu
->
psVelm4
->
_pSysStream
[
0
][
ii
].
y
)
||
isNanOrInfinity
(
gpu
->
psVelm4
->
_pSysStream
[
0
][
ii
].
z
)
){
nansPresent
=
1
;
}
}
}
if
(
nansPresent
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"epsilon nan - exiting
\n
"
);
(
void
)
fflush
(
amoebaGpu
->
log
);
exit
(
-
1
);
}
}
}
...
...
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