ygm::io::daily_output

template<typename Partitioner = ygm::container::detail::old_hash_partitioner<std::string>>
class daily_output

Class for writing output to a file for each day based on a timestamp provided at the time of writing.

Template Parameters:

Partitioner – Type used to assign filenames to ranks for writing

Public Types

using self_type = daily_output<Partitioner>
using ptr_type = typename ygm::ygm_ptr<self_type>

Public Functions

inline daily_output(ygm::comm &comm, const std::string &filename_prefix, size_t buffer_length = 1024 * 1024, bool append = false)

Construct a daily_output object.

Parameters:
  • comm – Communicator to use for communication

  • filename_prefix – Prefix used when creating filenames

  • buffer_length – Length of buffers to use before writing

  • append – If false, existing files are overwritten. Otherwise, output is appended to existing files.

template<typename ...Args>
inline void async_write_line(const uint64_t timestamp, Args&&... args)

Write a line of output.

Template Parameters:

Args... – Variadic types of output

Parameters:
  • timestamp – Linux timestamp associated to use when assigning output to a file

  • args... – Variadic arguments to write to output file

inline ygm::ygm_ptr<self_type> get_ygm_ptr()

Access to own ygm_ptr.

Returns:

ygm_ptr used by the container when identifying itself in async calls on the ygm::comm

inline const ygm::ygm_ptr<self_type> get_ygm_ptr() const

Const access to own ygm ptr.

Returns:

ygm_ptr to const version of container