73int main(
int argc,
char* argv[])
77 MPI_Init(&argc, &argv);
79 MPI_Comm_rank( MPI_COMM_WORLD, &procRank );
81 std::cout << Teuchos::Teuchos_Version() << std::endl << std::endl;
83 std::cout << Teuchos::Teuchos_Version() << std::endl << std::endl;
87 Teuchos::CommandLineProcessor My_CLP;
96 My_CLP.setOption(
"iterations", &NumIters,
"Number of iterations");
98 double Tolerance = 1e-10;
99 My_CLP.setOption(
"tolerance", &Tolerance,
"Tolerance");
101 std::string Solver =
"GMRES";
102 My_CLP.setOption(
"solver", &Solver,
"Linear solver");
105 My_CLP.setOption(
"precondition",
"no-precondition",
106 &Precondition,
"Preconditioning flag");
108 const int num_speed_values = 3;
110 const char* speed_opt_names[] = {
"slow",
"medium",
"fast" };
114 num_speed_values, speed_opt_values, speed_opt_names,
115 "Speed of our solver"
123 My_CLP.recogniseAllOptions(
true);
132 My_CLP.throwExceptions(
false);
139 Teuchos::CommandLineProcessor::EParseCommandLineReturn
140 parseReturn= My_CLP.parse( argc, argv );
141 if( parseReturn == Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED ) {
147 if( parseReturn != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
158 std::cout <<
"\nPrinting help message with new values of command-line arguments ...\n\n";
159 My_CLP.printHelpMessage(argv[0],std::cout);
165 std::cout <<
"\nPrinting user options after parsing ...\n\n";
166 std::cout <<
"NumIters = " << NumIters << std::endl;
167 std::cout <<
"Tolerance = " << Tolerance << std::endl;
168 std::cout <<
"Solver = \"" << Solver <<
"\"\n";
169 std::cout <<
"Precondition = " << Precondition << std::endl;
170 std::cout <<
"Speed = " << Speed << std::endl;