69 static Time&
localTimer() {
static RCP<Time> t = TimeMonitor::getNewTimer(
"a function that is not called on all procs");
return *t;}
78 int main(
int argc,
char* argv[])
86 MPI_Init(&argc, &argv);
87 MPI_Comm_rank( MPI_COMM_WORLD, &procRank );
91 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
93 if (verbose && procRank==0)
109 for (
int i=0; i<100; i++)
117 for (
int i=0; i<100; i++)
123 for (
int i=0; i<100; i++)
135 for (
int i=0; i<100; i++)
144 for (
int i=0; i<100; i++)
153 catch(std::exception& e)
155 if (verbose && procRank==0)
156 std::cerr <<
"Caught std::exception [expected]: " << e.what() << std::endl;
163 TimeMonitor::format().setRowsBetweenLines(3);
165 TimeMonitor::summarize();
172 if (FailedTests != 0) {
173 std::cout <<
"End Result: TEST FAILED" << std::endl;
177 std::cout <<
"End Result: TEST PASSED" << std::endl;
190 for (
int i=0; i<10000; i++)
193 "throw an std::exception");
209 return std::log(as<double>(x)) +
factFunc(x-1);
220 for (
int i=0; i<10000; i++)
224 "throw an std::exception");
239 for (
int i=0; i<10000; i++)
256 for (
int i=0; i<10000; i++)
273 for (
int i=0; i<10000; i++)
290 for (
int i=0; i<10000; i++)
int main(int argc, char *argv[])
static Time & yetAnotherTimer()
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
This structure defines some basic traits for a scalar field type.
static Time & anotherTimer()
static Time & factTimer()
static Time & yetOneMoreTimer()
static Time & exceptTimer()
std::string Teuchos_Version()
static Time & localTimer()
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
static Time & sqrtTimer()
Defines basic traits for the scalar field type.
Scope protection wrapper for Teuchos::Time, with timer reporting functionality.
Smart reference counting pointer class for automatic garbage collection.
Definition of Teuchos::as, for conversions between types.
A scope-safe timer wrapper class, that can compute global timer statistics.