22 AddOption(
'h',
"help");
23 AddOption(
'p',
"partition",2,
"number");
24 AddOption(
'v',
"verb",1,
"level");
25 AddOption(
'c',
"clone",2,
"number");
26 AddOption(
'a',
"assembly");
27 AddOption(
'm',
"mesh");
28 AddOption(
'd',
"debug");
29 AddOption(
'k',
"checking");
30 AddOption(
'r',
"reorient");
31 AddOption(
'g',
"generate");
32 AddOption(
's',
"sparse");
33 AddOption(
't',
"metis");
34 AddOption(
'n',
"renumber");
35 AddArgument(
"input",1);
36 AddHelp(
"metis",
"Metis testing stub.");
37 AddHelp(
"sparse",
"Write out the sparse matrix for visualization.");
38 AddHelp(
"clone",
"Generate <number> of partitions identical to the input mesh.");
39 AddHelp(
"generate",
"Generate a uniform mesh with N nodes and quit.");
40 AddHelp(
"checking",
"Paranoid and insanely verbose dumping of all important arrays to Log.");
41 AddHelp(
"partition",
"Performs Metis partitioning of input mesh into <number> partitions.");
42 AddHelp(
"assembly",
"Performs assembly test.");
43 AddHelp(
"mesh",
"Performs mesh tests.");
44 AddHelp(
"help",
"Prints this long version of help.");
45 AddHelp(
"verb",
"Makes the test more verbose. Default level is 1.");
46 AddHelp(
"config",
"Specifies the name of the configuration file.");
47 AddHelp(
"out",
"Specifies the name of the output file.");
48 AddHelp(
"renumber",
"Uses ParMETIS to do optimal graph reordering.");
49 AddArgHelp(
"input",
"Mode dependent arguments");
50 std::ostringstream Ostr;
54 Ostr <<
"Test tool for exercising the mesh library.";
55 _description.assign(Ostr.str());
59 typedef Global::ParallelGlobalObj<Comm::CommunicatorObject,std::string,int,Profiler::ProfilerObj>
TestGlobal;
77 int retval = Global::Program<TestGlobal,TestComLine>::Initialize();
78 sverb = _command_line.GetOption(
"verb");
79 spart = _command_line.GetOption(
"partition");
80 sclone = _command_line.GetOption(
"clone");
81 do_part = !_command_line.GetOption(
"partition").empty();
82 do_meshtest = !_command_line.GetOption(
"mesh").empty();
83 do_assem = !_command_line.GetOption(
"assembly").empty();
84 do_orient = !_command_line.GetOption(
"reorient").empty();
85 debug = !_command_line.GetOption(
"debug").empty();
86 do_check = !_command_line.GetOption(
"checking").empty();
87 do_gen = !_command_line.GetOption(
"generate").empty();
88 do_clone = !_command_line.GetOption(
"clone").empty();
89 do_renum = !_command_line.GetOption(
"renumber").empty();
90 do_dump = !_command_line.GetOption(
"sparse").empty();
91 if(!_command_line.GetOption(
"help").empty()){
93 *_OutStream << _command_line.LongUsage() << std::endl;
94 _communicator.SetExit(1);
96 if(_communicator.Check())
100 *_ErrStream << _command_line.ErrorReport() << std::endl
101 << std::endl << _command_line.ShortUsage() << std::endl;
102 _communicator.SetExit(1);
104 if(_communicator.Check())
111 int main(
int argc,
char *argv[])
116 MyProgram.OutStream() <<
"Calling RUN." << std::endl;
117 MyProgram.StdOut(
"Testing\n");
120 std::cout <<
"Calling Finalize." << std::endl;
121 if(MyProgram.Finalize())
123 std::cout <<
"All done." << std::endl;
TestComLine(const char *args[])
A struct that holds all the global program data.
TestProgram(int nargs, char **args)
int main(int argc, char *argv[])
ComLineObject for testing app.
Global::ParallelGlobalObj< Comm::CommunicatorObject, std::string, int, Profiler::ProfilerObj > TestGlobal