Skip to content
Snippets Groups Projects
  • Ben Cumming's avatar
    Metering support with time meter (#217) · 54f47392
    Ben Cumming authored
      * An abstract `meter` class that defines interface for taking a reading, and returning the meter results as a json object.
      * A `time_meter` implementation of the `meter` that measures wall time.
      * To generate metering reports with global information, the global communication policy interfaces were extended to support `gather` and `barrier` operations. These are trivial for serial and dry run policies, and wrap the appropriate MPI calls for the MPI policy.
      * a `meter_manager` type that stores a list of meters was created
        * will also have memory and power meters soon.
      * a meter manager was added to the miniapp and now records startup, model initialization, time stepping and final file io times.
    54f47392
meter.cpp 419 B
#include "meter.hpp"

namespace nest {
namespace mc {
namespace util {

nlohmann::json to_json(const measurement& mnt) {
    nlohmann::json measurements;
    for (const auto& m: mnt.measurements) {
        measurements.push_back(m);
    }

    return {
        {"name", mnt.name},
        {"units", mnt.units},
        {"measurements", measurements}
    };
}

} // namespace util
} // namespace mc
} // namespace nest