Пример #1
0
 PerformanceTester(MPI_Comm comm) :
         enabledTimerSet(CHILDMASK1),
         rootTimer(createRootTimer("totalTestRuntime", enabledTimerSet)),
         childTimer("timed algorithm", CHILDMASK1, rootTimer),
         communicator(comm),
         duration(0.0)
 {
     rootTimer.start();
 }
Пример #2
0
ImbalanceTimings measure_imbalance(MPI_Comm communicator, FUNCTION do_work)
{
    enum {CHILDMASK1 = 1};
    stk::diag::TimerSet enabledTimerSet(CHILDMASK1);
    stk::diag::Timer rootTimer = createRootTimer("totalTestRuntime", enabledTimerSet);
    rootTimer.start();
    stk::diag::Timer childTimer1("childTimer1", CHILDMASK1, rootTimer);

    {
        stk::diag::TimeBlockSynchronized timerStartSynchronizedAcrossProcessors(childTimer1, communicator);
        do_work();
    }

    float time = childTimer1.getMetric<stk::diag::WallTime>().getAccumulatedLap(false);
    ImbalanceTimings timings(communicator, time);
    stk::diag::deleteRootTimer(rootTimer);

    return timings;
}