37 static Time&
localTimer() {
static RCP<Time> t = TimeMonitor::getNewTimer(
"a function that is not called on all procs");
return *t;}
56 int main(
int argc,
char* argv[])
64 MPI_Init(&argc, &argv);
65 MPI_Comm_rank( MPI_COMM_WORLD, &procRank );
69 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
71 if (verbose && procRank==0)
76 for (
int i=0; i<100; i++)
84 for (
int i = 0; i < 100; ++i) {
89 for (
int i = 0; i < 100; ++i) {
99 for (
int i = 0; i < 100; ++i) {
107 for (
int i = 0; i < 100; ++i) {
113 catch (std::exception& e) {
116 if (verbose && procRank==0) {
117 std::cerr <<
"Caught std::exception [expected]: " << e.what() << std::endl;
124 TimeMonitor::format ().setRowsBetweenLines (3);
126 TimeMonitor::summarize ();
134 if (FailedTests != 0) {
135 std::cout <<
"End Result: TEST FAILED" << std::endl;
139 std::cout <<
"End Result: TEST PASSED" << std::endl;
152 for (
int i=0; i<10000; i++)
155 "throw an std::exception");
171 return std::log(as<double>(x)) +
factFunc(x-1);
182 for (
int i=0; i<10000; i++)
186 "throw an std::exception");
201 for (
int i=0; i<10000; i++)
218 for (
int i=0; i<10000; i++)
235 for (
int i=0; i<10000; i++)
252 for (
int i=0; i<10000; i++)
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()
int main(int argc, char *argv[])
Defines basic traits for the scalar field type.
Scope guard for Teuchos::Time, with MPI collective timer reporting.
Smart reference counting pointer class for automatic garbage collection.
Definition of Teuchos::as, for conversions between types.
Scope guard for Time, that can compute MPI collective timer statistics.