Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
c2d350b3
Commit
c2d350b3
authored
Jun 16, 2011
by
Philippe Pébay
Browse files
Added absolute threshold for testing to parallel order statistics
parent
02c06925
Changes
2
Hide whitespace changes
Inline
Side-by-side
Infovis/Testing/Cxx/TestRandomPContingencyStatisticsMPI.cxx
View file @
c2d350b3
...
...
@@ -468,9 +468,9 @@ int main( int argc, char** argv )
RandomContingencyStatisticsArgs
args
;
args
.
nVals
=
nVals
;
args
.
stdev
=
stdev
;
args
.
absTol
=
absTol
;
args
.
retVal
=
&
testValue
;
args
.
ioRank
=
ioRank
;
args
.
absTol
=
absTol
;
// Check how many processes have been made available
int
numProcs
=
controller
->
GetNumberOfProcesses
();
...
...
Infovis/Testing/Cxx/TestRandomPOrderStatisticsMPI.cxx
View file @
c2d350b3
...
...
@@ -46,6 +46,7 @@ struct RandomOrderStatisticsArgs
double
stdev
;
bool
quantize
;
int
maxHistoSize
;
double
absTol
;
int
*
retVal
;
int
ioRank
;
};
...
...
@@ -223,7 +224,10 @@ void RandomOrderStatistics( vtkMultiProcessController* controller, void* arg )
// Print out and verify global extrema
if
(
com
->
GetLocalProcessId
()
==
args
->
ioRank
)
{
cout
<<
"
\n
## Verifying that calculated global extrema are correct.
\n
"
;
cout
<<
"
\n
## Verifying that calculated global extrema are correct (within "
<<
args
->
absTol
<<
" absolute tolerance).
\n
"
;
double
min_c
=
outputQuantiles
->
GetValueByName
(
0
,
columnNames
[
0
]
).
ToDouble
();
...
...
@@ -236,13 +240,13 @@ void RandomOrderStatistics( vtkMultiProcessController* controller, void* arg )
<<
max_c
<<
"
\n
"
;
if
(
fabs
(
min_c
-
min_g
)
>
1.e-6
)
if
(
fabs
(
min_c
-
min_g
)
>
args
->
absTol
)
{
vtkGenericWarningMacro
(
"Incorrect minimum."
);
*
(
args
->
retVal
)
=
1
;
}
if
(
fabs
(
max_c
-
max_g
)
>
1.e-6
)
if
(
fabs
(
max_c
-
max_g
)
>
args
->
absTol
)
{
vtkGenericWarningMacro
(
"Incorrect maximum."
);
*
(
args
->
retVal
)
=
1
;
...
...
@@ -321,6 +325,7 @@ int main( int argc, char** argv )
double
stdev
=
50.
;
bool
quantize
=
false
;
int
maxHistoSize
=
500
;
double
absTol
=
1.e-6
;
// Initialize command line argument parser
vtksys
::
CommandLineArguments
clArgs
;
...
...
@@ -347,6 +352,11 @@ int main( int argc, char** argv )
vtksys
::
CommandLineArguments
::
NO_ARGUMENT
,
&
quantize
,
"Allow re-quantizing"
);
// Parse absolute tolerance to verify extrema
clArgs
.
AddArgument
(
"--abs-tol"
,
vtksys
::
CommandLineArguments
::
SPACE_ARGUMENT
,
&
stdev
,
"Absolute tolerance to verify extrema"
);
// If incorrect arguments were provided, terminate in error.
if
(
!
clArgs
.
Parse
()
)
{
...
...
@@ -372,6 +382,7 @@ int main( int argc, char** argv )
args
.
maxHistoSize
=
maxHistoSize
;
args
.
retVal
=
&
testValue
;
args
.
ioRank
=
ioRank
;
args
.
absTol
=
absTol
;
// Check how many processes have been made available
int
numProcs
=
controller
->
GetNumberOfProcesses
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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