88int main(
int argc,
char* argv[])
96 MPI_Init(&argc, &argv);
97 MPI_Comm_rank( MPI_COMM_WORLD, &procRank );
101 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
103 if (verbose && procRank==0)
108 for (
int i=0; i<100; i++)
116 for (
int i = 0; i < 100; ++i) {
121 for (
int i = 0; i < 100; ++i) {
131 for (
int i = 0; i < 100; ++i) {
139 for (
int i = 0; i < 100; ++i) {
145 catch (std::exception& e) {
148 if (verbose && procRank==0) {
149 std::cerr <<
"Caught std::exception [expected]: " << e.what() << std::endl;
166 if (FailedTests != 0) {
167 std::cout <<
"End Result: TEST FAILED" << std::endl;
171 std::cout <<
"End Result: TEST PASSED" << std::endl;
184 for (
int i=0; i<10000; i++)
187 "throw an std::exception");
203 return std::log(as<double>(x)) +
factFunc(x-1);
214 for (
int i=0; i<10000; i++)
218 "throw an std::exception");
233 for (
int i=0; i<10000; i++)
250 for (
int i=0; i<10000; i++)
267 for (
int i=0; i<10000; i++)
284 for (
int i=0; i<10000; i++)
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Defines basic traits for the scalar field type.
Scope guard for Teuchos::Time, with MPI collective timer reporting.
Definition of Teuchos::as, for conversions between types.
Smart reference counting pointer class for automatic garbage collection.
Scope guard for Time, that can compute MPI collective timer statistics.
static void summarize(Ptr< const Comm< int > > comm, std::ostream &out=std::cout, const bool alwaysWriteLocal=false, const bool writeGlobalStats=true, const bool writeZeroTimers=true, const ECounterSetOp setOp=Intersection, const std::string &filter="", const bool ignoreZeroTimers=false)
Print summary statistics for all timers on the given communicator.
static RCP< Time > getNewTimer(const std::string &name)
Return a new timer with the given name (class method).
static Time & yetAnotherTimer()
static Time & exceptTimer()
static Time & anotherTimer()
static Time & factTimer()
static Time & yetOneMoreTimer()
static Time & localTimer()
static Time & sqrtTimer()
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
std::string Teuchos_Version()
This structure defines some basic traits for a scalar field type.
static T squareroot(T x)
Returns a number of magnitudeType that is the square root of this scalar type x.