20#ifndef PISM_YACOUTPUTWRITER_H
21#define PISM_YACOUTPUTWRITER_H
28#include "pism/util/io/OutputWriter.hh"
29#include "pism/external/nlohmann/json.hpp"
132 void send_action(
int action_id,
const nlohmann::json &metadata);
135 void initialize_impl(
const std::set<VariableMetadata> &array_variables);
138 unsigned int length);
141 const std::vector<std::string> &dims,
io::Type type,
145 const std::map<std::string, std::string> &strings,
146 const std::map<std::string, std::vector<double> > &numbers);
156 void write_array_impl(
const std::string &file_name,
const std::string &variable_name,
157 const std::vector<unsigned int> &start,
158 const std::vector<unsigned int> &
count,
const double *data);
160 void write_text_impl(
const std::string &file_name,
const std::string &variable_name,
161 const std::vector<unsigned int> &start,
162 const std::vector<unsigned int> &
count,
163 const std::string &input);
169 void sync_impl(
const std::string &file_name);
170 void close_impl(
const std::string &file_name);
A class for storing and accessing PISM configuration flags and parameters.
std::vector< std::string > m_text_buffers
buffers used to send text (write_text_impl())
void initialize_impl(const std::set< VariableMetadata > &array_variables)
void define_yac_field(const VariableMetadata &variable)
void set_global_attributes_impl(const std::string &file_name, const std::map< std::string, std::string > &strings, const std::map< std::string, std::vector< double > > &numbers)
void end_yac_definitions()
void define_variable_impl(const std::string &file_name, const std::string &variable_name, const std::vector< std::string > &dims, io::Type type, const VariableAttributes &attributes)
std::map< std::string, int > m_field_ids
YAC field ID corresponding to a particular variable (by name)
std::map< std::string, int > m_variable_tags
std::vector< double * > m_buffers
buffers used to send arrays of double
void define_dimension_impl(const std::string &file_name, const std::string &name, unsigned int length)
void define_yac_grid(const VariableMetadata &variable)
void write_distributed_array_impl(const std::string &file_name, const std::string &variable_name, const double *data)
std::vector< MPI_Request > m_mpi_requests
void close_impl(const std::string &file_name)
void append_impl(const std::string &file_name)
TagTreatment
Tags for MPI messages sending non-gridded variable data.
void write_text_impl(const std::string &file_name, const std::string &variable_name, const std::vector< unsigned int > &start, const std::vector< unsigned int > &count, const std::string &input)
void write_array_impl(const std::string &file_name, const std::string &variable_name, const std::vector< unsigned int > &start, const std::vector< unsigned int > &count, const double *data)
double last_time_value_impl(const std::string &file_name)
unsigned int time_dimension_length_impl(const std::string &file_name)
void waitall()
Call MPI_Waitall() to ensure that all buffers can be freed.
std::map< std::string, int > m_time_length
Length of the time dimension in a file.
bool m_leader
True if the current MPI process is responsible for sending non-gridded data.
void append_history_impl(const std::string &file_name, const std::string &text)
void append_time_impl(const std::string &file_name, double time_seconds)
std::map< std::string, int > m_point_set_id
YAC point set ID corresponding to a grid name.
void sync_impl(const std::string &file_name)
std::map< std::string, std::map< std::string, bool > > m_defined_variable
void send_action(int action_id, const nlohmann::json &metadata)
std::map< std::string, std::map< std::string, bool > > m_defined_dimension
int tag(const std::string &variable_name, TagTreatment flag=GET_EXISTING_TAG)
std::map< std::string, double > m_last_time
last time value in an output file
@ FINISH_YAC_INITIALIZATION