69 static Time&
localTimer() {
static RCP<Time> t = TimeMonitor::getNewTimer(
"a function that is not called on all procs");
return *t;}
88 int 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;
156 TimeMonitor::format ().setRowsBetweenLines (3);
158 TimeMonitor::summarize ();
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++)
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.