19#include <Teuchos_DefaultComm.hpp>
44void goToSleep(
const RCP<const Zoltan2::Environment> &env)
46 env->timerStart(MICRO_TIMERS,
string(
"sleep for 5 seconds"));
48 env->timerStop(MICRO_TIMERS,
string(
"sleep for 5 seconds"));
50 env->timerStart(MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
52 env->timerStop(MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
54 env->timerStart(MICRO_TIMERS,
string(
"sleep for 2 seconds"));
56 env->timerStop(MICRO_TIMERS,
string(
"sleep for 2 seconds"));
58 env->timerStart(MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
60 env->timerStop(MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
64int main(
int narg,
char *arg[])
66 Tpetra::ScopeGuard tscope(&narg, &arg);
67 Teuchos::RCP<const Teuchos::Comm<int> > comm = Tpetra::getDefaultComm();
71 Teuchos::ParameterList pl(
"test list");
72 pl.set(
"timer_output_stream" ,
"std::cout");
73 pl.set(
"timer_type" ,
"both_timers");
74 std::vector<const zscalar_t * >
weights;
75 std::vector<int> strides;
76 Array<zgno_t> someIds(10,1);
79 inputAdapter_t ia(10, someIds.getRawPtr(),
weights, strides);
85 const RCP<const Zoltan2::Environment> &env = problem.
getEnvironment();
87 if (comm->getRank() == 0)
88 std::cout <<
"Sleeping..." << std::endl;
90 env->timerStart(MACRO_TIMERS,
string(
"Do the sleep test"));
92 env->timerStop(MACRO_TIMERS,
string(
"Do the sleep test"));
97 env->timerStop(MACRO_TIMERS,
string(
"unstarted timer"));
101 if (comm->getRank() == 0)
102 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.