WaSH Docs
Public Types | Public Member Functions | Static Public Attributes | List of all members
wash::io::IOManager Class Reference

Manages the IO options for the simulation. More...

#include <io.hpp>

Public Types

using WriterFuncT = std::function< int(const io::IOManager &, const SimulationData &, const size_t)>
 

Public Member Functions

 IOManager (const std::string format, WriterFuncT writer, const size_t nth, const size_t rank=0, const size_t size=1, const bool timings=true)
 
 IOManager (const std::string format, WriterFuncT writer)
 
 IOManager (const std::string format, WriterFuncT writer, const size_t rank, const size_t size)
 
const std::string get_path () const
 
size_t get_rank () const
 
size_t get_size () const
 
void set_gather (bool value=true)
 
const std::string & expand_label (const std::string &label) const
 Helper function to expand a label if an expansion exists.
 
const SimulationData get_simulation_data ()
 Copies the simulation data at the current point of the simulation. More...
 
void write_iteration (const size_t iteration)
 Dispatches an iteration call to the writer based on the iteration number. More...
 
void write_timings (const std::string &event_name, const int tag, const int64_t time_taken) const
 Write a timing even out to a file. More...
 
void new_timings ()
 Clear the timings output file.
 

Static Public Attributes

static const std::unordered_map< std::string, std::string > label_map
 

Detailed Description

Manages the IO options for the simulation.

Member Function Documentation

◆ get_simulation_data()

const SimulationData wash::io::IOManager::get_simulation_data ( )
inline

Copies the simulation data at the current point of the simulation.

If set to use a gather this will use MPI to gather from all processes

Returns
SimulationData The simulation data

◆ write_iteration()

void wash::io::IOManager::write_iteration ( const size_t  iteration)
inline

Dispatches an iteration call to the writer based on the iteration number.

Parameters
iteration

◆ write_timings()

void wash::io::IOManager::write_timings ( const std::string &  event_name,
const int  tag,
const int64_t  time_taken 
) const
inline

Write a timing even out to a file.

Parameters
event_name
time_taken

Member Data Documentation

◆ label_map

const std::unordered_map< std::string, std::string > wash::io::IOManager::label_map
static
Initial value:
= {
{"id", "ParticleIDs"},
{"pos", "Coordinates"},
{"vel", "Velocities"},
{"acc", "Acceleration"},
{"rho", "Density"},
{"density", "Density"},
{"h", "SmoothingLength"},
{"smoothing_length", "SmoothingLength"},
{"m", "Masses"},
{"mass", "Masses"}
}

The documentation for this class was generated from the following files: