11#ifndef MILUPHPC_H5PROFILER_H
12#define MILUPHPC_H5PROFILER_H
16#include <unordered_map>
20#include <highfive/H5File.hpp>
21#include <highfive/H5DataSet.hpp>
22#include <highfive/H5DataSpace.hpp>
31 const char*
const ranges {
"/general/ranges" };
34 namespace SendLengths {
37 const char*
const sph {
"/sending/sph" };
41 namespace ReceiveLengths {
44 const char*
const sph {
"/receiving/sph" };
50 const char *
const rhs {
"/time/rhs" };
53 const char *
const reset {
"/time/reset" };
57 const char *
const tree {
"/time/tree" };
59 const char *
const gravity {
"/time/gravity" };
60 const char *
const sph {
"/time/sph" };
62 const char *
const IO {
"/time/IO" };
68 namespace BoundingBox {
72 namespace AssignParticles {
78 const char *
const tree {
"/time/tree_buildTree" };
79 const char *
const buildDomain {
"/time/tree_buildDomainTree" };
82 namespace PseudoParticles {
87 const char *
const compTheta {
"/time/gravity_compTheta" };
89 const char *
const sending {
"/time/gravity_gravitySendingParticles" };
92 const char *
const force {
"/time/gravity_force" };
93 const char *
const repairTree {
"/time/gravity_repairTree" };
97 const char *
const compTheta {
"/time/sph_compTheta" };
100 const char *
const sending {
"/time/sph_sendingParticles" };
103 const char *
const density {
"/time/sph_density" };
105 const char *
const pressure {
"/time/sph_pressure" };
106 const char *
const resend {
"/time/sph_resendingParticles" };
185 void createValueDataSet(
const std::string& path,
int steps, std::size_t maxSteps=HighFive::DataSpace::UNLIMITED){
186 HighFive::DataSetCreateProps props;
187 props.add(HighFive::Chunking(std::vector<hsize_t>{1, 1}));
188 dataSets[path] =
h5file.createDataSet<T>(path, HighFive::DataSpace({std::size_t(steps), std::size_t(
numProcs)},
189 {maxSteps, std::size_t(
numProcs)}), props);
227 std::size_t maxSteps=HighFive::DataSpace::UNLIMITED){
228 HighFive::DataSetCreateProps props;
229 props.add(HighFive::Chunking(std::vector<hsize_t>{1, 1, size}));
230 dataSets[path] =
h5file.createDataSet<T>(path, HighFive::DataSpace({std::size_t(steps),
232 {maxSteps, std::size_t(
numProcs), size}),
269 std::vector<T> dataVector;
271 dataVector.push_back(data[i]);
287 std::unordered_map<std::string, HighFive::DataSet>
dataSets;
Singleton class for HDF5 profiler.
void operator=(H5Profiler const &)=delete
H5Profiler(H5Profiler const &)=delete
std::unordered_map< std::string, std::size_t > vectorSizes
static H5Profiler & getInstance(const std::string &outfile="")
Constructor/Instance getter for HDF5 profiler.
void vector2file(const std::string &path, T *data)
std::unordered_map< std::string, int > totalSteps
void const setNumProcs(const int &_numProcs)
Set number of MPI processes.
void vector2file(const std::string &path, std::vector< T > data)
void createVectorDataSet(const std::string &path, int steps, std::size_t size, std::size_t maxSteps=HighFive::DataSpace::UNLIMITED)
Track vector values (per MPI rank).
void createValueDataSet(const std::string &path, int steps, std::size_t maxSteps=HighFive::DataSpace::UNLIMITED)
Track single value (per MPI rank).
void const setStep(const int &_step)
Set current step of profiler.
void const setRank(const int &_myRank)
Set MPI rank.
std::unordered_map< std::string, double > timeStart
std::unordered_map< std::string, HighFive::DataSet > dataSets
std::unordered_map< std::string, int > currentSteps
void const disableWrite()
Disable write to output file.
std::unordered_map< std::string, double > timeElapsed
void value2file(const std::string &path, T value)
Write value to single value data set.
void const enableWrite()
Enable write to output file.
Gravity related kernels/functions.
const char *const gravityParticles
const char *const gravityPseudoParticles
const char *const gravityPseudoParticles
const char *const gravityParticles
const char *const compTheta
const char *const repairTree
const char *const symbolicForce
const char *const insertReceivedParticles
const char *const insertReceivedPseudoParticles
const char *const sending
const char *const insertReceivedParticles
const char *const internalForces
const char *const soundSpeed
const char *const symbolicForce
const char *const sending
const char *const fixedRadiusNN
const char *const determineSearchRadii
const char *const repairTree
const char *const compTheta
const char *const buildDomain
const char *const createDomain
const char *const pseudoParticle
const char *const gravity
const char *const removeParticles
const char *const loadBalancing
const char *const assignParticles
const char *const boundingBox
const char *const integrate
const char *const rhsElapsed
const char *const numParticlesLocal
const char *const numParticles
SPH related functions and kernels.