54 #include <Teuchos_DefaultComm.hpp> 79 void goToSleep(
const RCP<const Zoltan2::Environment> &env)
81 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 5 seconds"));
83 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 5 seconds"));
85 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
87 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
89 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 2 seconds"));
91 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 2 seconds"));
93 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
95 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
99 int main(
int argc,
char *argv[])
101 Teuchos::GlobalMPISession session(&argc, &argv);
102 Teuchos::RCP<const Teuchos::Comm<int> > comm =
103 Teuchos::DefaultComm<int>::getComm();
107 Teuchos::ParameterList pl(
"test list");
108 pl.set(
"timer_output_stream" ,
"std::cout");
109 pl.set(
"timer_type" ,
"both_timers");
110 std::vector<const zscalar_t * >
weights;
111 std::vector<int> strides;
112 Array<zgno_t> someIds(10,1);
115 inputAdapter_t ia(10, someIds.getRawPtr(),
weights, strides);
121 const RCP<const Zoltan2::Environment> &env = problem.getEnvironment();
123 if (comm->getRank() == 0)
124 std::cout <<
"Sleeping..." << std::endl;
126 env->timerStart(
MACRO_TIMERS,
string(
"Do the sleep test"));
128 env->timerStop(
MACRO_TIMERS,
string(
"Do the sleep test"));
133 env->timerStop(
MACRO_TIMERS,
string(
"unstarted timer"));
135 problem.printTimers();
137 if (comm->getRank() == 0)
138 std::cout <<
"PASS" << std::endl;
Time an algorithm (or other entity) as a whole.
static void sleep_wrap(unsigned int seconds)
A simple class that can be the User template argument for an InputAdapter.
common code used by tests
Time the substeps of an entity.
void goToSleep(const RCP< const Zoltan2::Environment > &env)
Zoltan2::BasicUserTypes< zscalar_t, zlno_t, zgno_t > myTypes_t
Run both MACRO and MICRO timers.
This class represents a collection of global Identifiers and their associated weights, if any.
Defines the BasicIdentifierAdapter class.
PartitioningProblem sets up partitioning problems for the user.
Defines the PartitioningProblem class.
Declarations for TimerManager.
int main(int argc, char *argv[])