54#include <Teuchos_DefaultComm.hpp>
79void 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)"));
99int main(
int narg,
char *arg[])
101 Tpetra::ScopeGuard tscope(&narg, &arg);
102 Teuchos::RCP<const Teuchos::Comm<int> > comm = Tpetra::getDefaultComm();
106 Teuchos::ParameterList pl(
"test list");
107 pl.set(
"timer_output_stream" ,
"std::cout");
108 pl.set(
"timer_type" ,
"both_timers");
109 std::vector<const zscalar_t * >
weights;
110 std::vector<int> strides;
111 Array<zgno_t> someIds(10,1);
114 inputAdapter_t ia(10, someIds.getRawPtr(),
weights, strides);
120 const RCP<const Zoltan2::Environment> &env = problem.
getEnvironment();
122 if (comm->getRank() == 0)
123 std::cout <<
"Sleeping..." << std::endl;
125 env->timerStart(MACRO_TIMERS,
string(
"Do the sleep test"));
127 env->timerStop(MACRO_TIMERS,
string(
"Do the sleep test"));
132 env->timerStop(MACRO_TIMERS,
string(
"unstarted timer"));
136 if (comm->getRank() == 0)
137 std::cout <<
"PASS" << std::endl;
void goToSleep(const RCP< const Zoltan2::Environment > &env)
static void sleep_wrap(unsigned int seconds)
Defines the BasicIdentifierAdapter class.
Zoltan2::BasicUserTypes< zscalar_t, zlno_t, zgno_t > myTypes_t
Defines the PartitioningProblem class.
common code used by tests
Declarations for TimerManager.
This class represents a collection of global Identifiers and their associated weights,...
A simple class that can be the User template argument for an InputAdapter.
PartitioningProblem sets up partitioning problems for the user.
const RCP< const Environment > & getEnvironment() const
Get the current Environment. Useful for testing.
void printTimers() const
Return the communicator passed to the problem.
@ MACRO_TIMERS
Time an algorithm (or other entity) as a whole.
@ MICRO_TIMERS
Time the substeps of an entity.
@ BOTH_TIMERS
Run both MACRO and MICRO timers.