Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testTeuchosTestForTermination.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
13 
14 int main(int argc, char* argv[])
15 {
16 
18  GlobalMPISession mpiSession(&argc,&argv);
19 
21  int terminate_on_procid = 0;
22  clp.setOption("terminate-on-procid", &terminate_on_procid);
23  (void)clp.parse(argc, argv);
24 
26  GlobalMPISession::getRank() == terminate_on_procid,
27  "Bingo, we are terminating on procid == "
28  "terminate_on_procid = "<<GlobalMPISession::getRank()<<"!"
29  );
30 
31  return 1; // Will never be called!
32 
33 }
Initialize, finalize, and query the global MPI session.
void setOption(const char option_true[], const char option_false[], bool *option_val, const char documentation[]=NULL)
Set a boolean option.
EParseCommandLineReturn parse(int argc, char *argv[], std::ostream *errout=&std::cerr) const
Parse a command line.
int main(int argc, char *argv[])
A MPI utilities class, providing methods for initializing, finalizing, and querying the global MPI se...
Basic command line parser for input from (argc,argv[])
#define TEUCHOS_TEST_FOR_TERMINATION(terminate_test, msg)
This macro is to be used instead of TEUCHOS_TEST_FOR_EXCEPTION() to report an error in situations whe...
Standard test and throw macros.
Class that helps parse command line input arguments from (argc,argv[]) and set options.