57 MPI_Comm myComm = MPI_COMM_WORLD;
59 int rank = communicator.
Rank();
60 int nproc = communicator.
Size();
61 bool do_stdout = !rank;
79 std::cout << comline.
LongUsage() << std::endl;
81 std::cout <<
"PlasCom2::ParallelTest: Exiting test function (success)" 86 if(communicator.
Check())
91 << std::endl << comline.
ShortUsage() << std::endl;
93 std::cout <<
"PlasCom2::ParallelTest: Exiting test function (fail)" << std::endl;
97 if(communicator.
Check())
103 std::ostream *Out = NULL;
109 std::string OutFileName(comline.
GetOption(
"output"));
110 std::string TestName(comline.
GetOption(
"name"));
111 std::string ListName(comline.
GetOption(
"list"));
112 std::string sverb(comline.
GetOption(
"verblevel"));
117 if(sverb !=
".true."){
118 std::istringstream Istr(sverb);
126 std::ostringstream outStream;
127 if(!OutFileName.empty()){
132 if(verblevel > 1 && Out)
133 *Out <<
"PlasCom2::ParallelTest: Entering test function" << std::endl;
141 if(!TestName.empty()){
143 test.
RunTest(TestName,results);
147 else if(!ListName.empty()){
148 std::ifstream ListInf;
149 ListInf.open(ListName.c_str());
152 *Out <<
"PlasCom2::ParallelTest> Error: Could not open list of tests in file " 153 << ListName <<
". Exiting (fail)." << std::endl;
156 if(communicator.
Check())
158 std::string testname;
159 while(std::getline(ListInf,testname))
160 test.
RunTest(testname,results);
168 *Out << results << std::endl;
173 if((verblevel > 1) && Out)
174 *Out <<
"PlasCom2::ParallelTest: Exiting test function (success)" << std::endl;
176 if(!OutFileName.empty()){
178 Ouf.open(OutFileName.c_str(),std::ios::app);
180 std::cout <<
"PlasCom2::ParallelTest> Error: Could not open output file, " 181 << OutFileName <<
" for test output. Exiting (fail)." << std::endl;
184 Ouf << outStream.str();
189 if(communicator.
Check())
197 int main(
int argc,
char *argv[])
203 MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided);
204 assert(provided == MPI_THREAD_FUNNELED);
208 atexit((
void (*)())MPI_Finalize);
int ProcessOptions()
Processes all command line tokens.
std::string ErrorReport()
Error reporting.
int ParallelTest(int argc, char *argv[])
Drives the PlasCom2::TestObject.
std::string GetOption(const char &s)
Get the value of an option.
virtual void Process(ResultsType &result)
Runs all tests implemented by the PlasCom2::TestingObject.
Project-specific parallel testing object.
Encapsulating class for collections of test results.
int Check(comm::Ops op=comm::MAXOP)
Main encapsulation of MPI.
void Initialize()
virtual function for program specific Initialization.
ComLineObject for PlasCom2 testing command-line interface.
int main(int argc, char *argv[])
Testing utilities for PlasCom2.
std::string LongUsage()
Generate long usage string.
virtual void RunTest(const std::string &name, ResultsType &result)
Runs a test specified by name.
ix::comm::CommunicatorObject CommType
Convenience typedef for CommunicatorObject.
std::string ShortUsage()
Generate short usage string.