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 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"));
134 problem.printTimers();
136 if (comm->getRank() == 0)
137 std::cout <<
"PASS" << std::endl;
Time an algorithm (or other entity) as a whole.
static void sleep_wrap(unsigned int seconds)
int main(int narg, char *arg[])
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.