54 #include <Teuchos_DefaultComm.hpp> 65 void goToSleep(
const RCP<const Zoltan2::Environment> &env)
67 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 5 seconds"));
69 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 5 seconds"));
71 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
73 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
75 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 2 seconds"));
77 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 2 seconds"));
79 env->timerStart(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
81 env->timerStop(
MICRO_TIMERS,
string(
"sleep for 3 seconds (twice)"));
85 int main(
int argc,
char *argv[])
87 Teuchos::GlobalMPISession session(&argc, &argv);
88 Teuchos::RCP<const Teuchos::Comm<int> > comm =
89 Teuchos::DefaultComm<int>::getComm();
93 Teuchos::ParameterList pl(
"test list");
94 pl.set(
"timer_output_stream" ,
"std::cout");
95 pl.set(
"timer_type" ,
"both_timers");
96 std::vector<const scalar_t * >weights;
97 std::vector<int> strides;
98 Array<gno_t> someIds(10,1);
101 #ifdef HAVE_ZOLTAN2_MPI 110 const RCP<const Zoltan2::Environment> &env = problem.
getEnvironment();
112 if (comm->getRank() == 0)
113 std::cout <<
"Sleeping..." << std::endl;
115 env->timerStart(
MACRO_TIMERS,
string(
"Do the sleep test"));
117 env->timerStop(
MACRO_TIMERS,
string(
"Do the sleep test"));
122 env->timerStop(
MACRO_TIMERS,
string(
"unstarted timer"));
126 if (comm->getRank() == 0)
127 std::cout <<
"PASS" << std::endl;
Time an algorithm (or other entity) as a whole.
Zoltan2::BasicUserTypes< scalar_t, gno_t, lno_t, gno_t > myTypes_t
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)
const RCP< const Environment > & getEnvironment() const
Get the current Environment. Useful for testing.
Run both MACRO and MICRO timers.
void printTimers() const
If timer data was collected, print out global data.
PartitioningProblem sets up partitioning problems for the user.
Defines the PartitioningProblem class.
Declarations for TimerManager.
Zoltan2::BasicIdentifierInput< myTypes_t > inputAdapter_t
int main(int argc, char *argv[])