19 #include <Teuchos_DefaultComm.hpp>
44 void 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)"));
64 int 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"));
99 problem.printTimers();
101 if (comm->getRank() == 0)
102 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)
Run both MACRO and MICRO timers.
This class represents a collection of global Identifiers and their associated weights, if any.
Zoltan2::BasicUserTypes< zscalar_t, zlno_t, zgno_t > myTypes_t
Defines the BasicIdentifierAdapter class.
PartitioningProblem sets up partitioning problems for the user.
Defines the PartitioningProblem class.
Declarations for TimerManager.