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
8c465f69
Commit
8c465f69
authored
Jun 16, 2011
by
Philippe Pébay
Browse files
Added command line parser so parallel contingency can be tested parametrically
parent
c6be0306
Changes
1
Hide whitespace changes
Inline
Side-by-side
Infovis/Testing/Cxx/TestRandomPContingencyStatisticsMPI.cxx
View file @
8c465f69
...
...
@@ -39,6 +39,8 @@ PURPOSE. See the above copyright notice for more information.
#include
"vtkTimerLog.h"
#include
"vtkVariantArray.h"
#include
"vtksys/CommandLineArguments.hxx"
struct
RandomContingencyStatisticsArgs
{
int
nVals
;
...
...
@@ -419,6 +421,39 @@ int main( int argc, char** argv )
}
}
// **************************** Parse command line ***************************
// Set default argument values
int
nVals
=
1000000
;
double
stdev
=
5.
;
double
absTol
=
1.e-6
;
// Initialize command line argument parser
vtksys
::
CommandLineArguments
clArgs
;
clArgs
.
Initialize
(
argc
,
argv
);
clArgs
.
StoreUnusedArguments
(
false
);
// Parse per-process cardinality of each pseudo-random sample
clArgs
.
AddArgument
(
"--n-per-proc"
,
vtksys
::
CommandLineArguments
::
SPACE_ARGUMENT
,
&
nVals
,
"Per-process cardinality of each pseudo-random sample"
);
// Parse standard deviation of each pseudo-random sample
clArgs
.
AddArgument
(
"--std-dev"
,
vtksys
::
CommandLineArguments
::
SPACE_ARGUMENT
,
&
stdev
,
"Standard deviation of each pseudo-random sample"
);
// Parse absolute tolerance to verify that final CDF is 1
clArgs
.
AddArgument
(
"--abs-tol"
,
vtksys
::
CommandLineArguments
::
SPACE_ARGUMENT
,
&
stdev
,
"Absolute tolerance to verify that final CDF is 1"
);
// If incorrect arguments were provided, terminate in error.
if
(
!
clArgs
.
Parse
()
)
{
vtkGenericWarningMacro
(
"Incorrect input data arguments were provided."
);
return
1
;
}
// ************************** Initialize test *********************************
if
(
com
->
GetLocalProcessId
()
==
ioRank
)
{
...
...
@@ -431,10 +466,9 @@ int main( int argc, char** argv )
// Parameters for regression test.
int
testValue
=
0
;
RandomContingencyStatisticsArgs
args
;
args
.
nVals
=
1000000
;
args
.
stdev
=
5.
;
args
.
absTol
=
1.e-6
;
args
.
nVals
=
nVals
;
args
.
stdev
=
stdev
;
args
.
absTol
=
absTol
;
args
.
retVal
=
&
testValue
;
args
.
ioRank
=
ioRank
;
...
...
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