Code Monkey home page Code Monkey logo

eventtimings's Introduction

EventTimings -- A Framework to measure events in an MPI environment

Usage

Basics

Import the main header

#include "EventTimings/Event.hpp"
#include "EventTimings/EventUtils.hpp"

All classes and functions are in the namespace EventTimings::.

Initialization

Initalize the timing framework at program start:

EventRegistry.instance().initialize("applicationName");

finalize the same way

EventRegistry.instance().finalize();

"applicationName" is optional and is used for naming the output files.

Timings

To start timing, simply instantiate an Event object.

Event e1("My first event");

it is autostarted and stopped on destruction. It can be explicitely stopped or paused

e1.pause();
// do some non-timed stuff
e1.start();
// time stuff
e1.stop(); // Finish the event

Stopping and restarting the Event counts as two events, whereas pausing simply stops and timing. An Event can be instantiated in a stopped state:

Event e2("Another event", false, false);

which calls

Event::Event(std::string eventName, bool barrier, bool autostart);

barrier sets calling of MPI_Barrier when implicitly starting or stopping an event, that is if the Event is started / stopped from the constructor / destructor. When you explictly start an Event and want to invoke a barrier use:

e2.start(true);
e2.stop(true);

The barrier can be used to synchronize measurements across the MPI communicator.

If you don't want an Event to be stopped when it goes out of scope, you can retrieve a so called stored Event

EventRegistry.instance().getStoredEvent("A stored Event");

it needs to be started and stopped explicitly.

Ataching data to Events

You can attach named data to an Event:

Event e1("Testevent");
e1.addData("IterationCount", iterations);

Currently, only integer data is supported. It can be used to store iterations or residuals. The data is collected for each Event and printed with the timings.

Reporting

After calling finalize, a report can be printed to stdout

EventRegistry::instance().printAll();

it also creates or appends to two files applicationName-eventTimings.log which contains aggregated timing information and applicationName-events.log, which logs all state changes of Events and is used by auxiliary scripts for plotting or further statistical insights.

Reporting Scripts

Transform Events to the trace format

events2trace.py can combine arbitrary applicationName-events.json files and output a JSON file in the trace format. The chromium trace tool chrome://tracing can read and display this format. Read more

eventtimings's People

Contributors

fsimonis avatar benjaminrodenberg avatar ajaust avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.