Ecrire_YAML#
#include <Ecrire_YAML.h>
classe Ecrire_YAML Use this to generate a yaml file that will then be read by the PDI library (for checkpoint/restart or for domain partitioning)
How to cite this class in this doc#
:ref:`Ecrire\_YAML <class-ecrire-yaml>`
[Ecrire\_YAML](#class-ecrire-yaml)
Detailed description#
The data that will be written are the ones that have been set in Equation_base::data_a_sauvegarder() ( + overloads) and Postraitement_base::data_a_sauvegarder() ( + overloads) These data must then be shared with PDI (during the simulation) in order to trigger the wanted IO operations, see also the class TRUST_2_PDI The structure of the file is as follows (indentation matters!): Metadata: mdata1 : type # for scalar mdata2 : { type: array, subtype: …, size: … } # for arrays … Data: data1 : type … Plugins: plugin1: plugin2: … We’re using the HDF5 plugin. Here is an example of how to declare a HDF5 dataset (structure gathering data of the same type) and write our TRUST data into it:
List of Public Methods#
List of Private Methods#
Complete Member Function Documentation#
void Ecrire_YAML::add_field(Nom pb, Nom nom, int nb_dim)
Adds a field (name + dimension) to the block of the problem pb_name in the YAML file.
References
How to cite in this doc:
:ref:`void Ecrire_YAML::add_field(Nom pb, Nom nom, int nb_dim) <public-void-ecrire-yaml-add-field-nom-pb-nom-nom-int-nb-dim>`
[void Ecrire_YAML::add_field(Nom pb, Nom nom, int nb_dim)](#public-void-ecrire-yaml-add-field-nom-pb-nom-nom-int-nb-dim)
void Ecrire_YAML::add_pb_base(const Probleme_base &pb_base, const Nom &file_name)
References
Referenced By
How to cite in this doc:
:ref:`void Ecrire_YAML::add_pb_base(const Probleme_base &pb_base, const Nom &file_name) <public-void-ecrire-yaml-add-pb-base-const-probleme-base-ref-pb-base-const-nom-ref-file-name>`
[void Ecrire_YAML::add_pb_base(const Probleme_base &pb_base, const Nom &file_name)](#public-void-ecrire-yaml-add-pb-base-const-probleme-base-ref-pb-base-const-nom-ref-file-name)
void Ecrire_YAML::add_scalar(Nom pb, Nom nom, Nom type, bool is_local)
Adds a scalar (name + type) to the block of the problem pb_name in the YAML file.
How to cite in this doc:
:ref:`void Ecrire_YAML::add_scalar(Nom pb, Nom nom, Nom type, bool is_local) <public-void-ecrire-yaml-add-scalar-nom-pb-nom-nom-nom-type-bool-is-local>`
[void Ecrire_YAML::add_scalar(Nom pb, Nom nom, Nom type, bool is_local)](#public-void-ecrire-yaml-add-scalar-nom-pb-nom-nom-nom-type-bool-is-local)
Ecrire_YAML::Ecrire_YAML()
How to cite in this doc:
:ref:`Ecrire_YAML::Ecrire_YAML() <public-ecrire-yaml-ecrire-yaml>`
[Ecrire_YAML::Ecrire_YAML()](#public-ecrire-yaml-ecrire-yaml)
void Ecrire_YAML::write_champ_fonc_restart_file(const std::string &filename)
Generate the YAML file that will be read with champ_fonc_reprise.
References
How to cite in this doc:
:ref:`void Ecrire_YAML::write_champ_fonc_restart_file(const std::string &filename) <public-void-ecrire-yaml-write-champ-fonc-restart-file-const-std-string-ref-filename>`
[void Ecrire_YAML::write_champ_fonc_restart_file(const std::string &filename)](#public-void-ecrire-yaml-write-champ-fonc-restart-file-const-std-string-ref-filename)
void Ecrire_YAML::write_checkpoint_file(const std::string &yaml_fname)
Generate the YAML file that will be read for checkpoint.
References
Referenced By
How to cite in this doc:
:ref:`void Ecrire_YAML::write_checkpoint_file(const std::string &yaml_fname) <public-void-ecrire-yaml-write-checkpoint-file-const-std-string-ref-yaml-fname>`
[void Ecrire_YAML::write_checkpoint_file(const std::string &yaml_fname)](#public-void-ecrire-yaml-write-checkpoint-file-const-std-string-ref-yaml-fname)
void Ecrire_YAML::write_restart_file(const std::string &yaml_fname)
Generate the YAML file that will be read for restart.
References
How to cite in this doc:
:ref:`void Ecrire_YAML::write_restart_file(const std::string &yaml_fname) <public-void-ecrire-yaml-write-restart-file-const-std-string-ref-yaml-fname>`
[void Ecrire_YAML::write_restart_file(const std::string &yaml_fname)](#public-void-ecrire-yaml-write-restart-file-const-std-string-ref-yaml-fname)
void Ecrire_YAML::add_line(const std::string &line, std::string &text)
How to cite in this doc:
:ref:`void Ecrire_YAML::add_line(const std::string &line, std::string &text) <private-void-ecrire-yaml-add-line-const-std-string-ref-line-std-string-ref-text>`
[void Ecrire_YAML::add_line(const std::string &line, std::string &text)](#private-void-ecrire-yaml-add-line-const-std-string-ref-line-std-string-ref-text)
void Ecrire_YAML::begin_bloc(const std::string &line, std::string &text)
How to cite in this doc:
:ref:`void Ecrire_YAML::begin_bloc(const std::string &line, std::string &text) <private-void-ecrire-yaml-begin-bloc-const-std-string-ref-line-std-string-ref-text>`
[void Ecrire_YAML::begin_bloc(const std::string &line, std::string &text)](#private-void-ecrire-yaml-begin-bloc-const-std-string-ref-line-std-string-ref-text)
void Ecrire_YAML::declare_array(const std::string &name, const std::string &type, const std::string &size, std::string &text)
Declaring a one-dimensional array in the YAML file.
How to cite in this doc:
:ref:`void Ecrire_YAML::declare_array(const std::string &name, const std::string &type, const std::string &size, std::string &text) <private-void-ecrire-yaml-declare-array-const-std-string-ref-name-const-std-string-ref-type-const-std-string-ref-size-std-string-ref-text>`
[void Ecrire_YAML::declare_array(const std::string &name, const std::string &type, const std::string &size, std::string &text)](#private-void-ecrire-yaml-declare-array-const-std-string-ref-name-const-std-string-ref-type-const-std-string-ref-size-std-string-ref-text)
void Ecrire_YAML::declare_data(int save, std::string &text)
Declaring all data in the YAML file.
How to cite in this doc:
:ref:`void Ecrire_YAML::declare_data(int save, std::string &text) <private-void-ecrire-yaml-declare-data-int-save-std-string-ref-text>`
[void Ecrire_YAML::declare_data(int save, std::string &text)](#private-void-ecrire-yaml-declare-data-int-save-std-string-ref-text)
void Ecrire_YAML::declare_dtab(const std::string &dname, const std::string &name, const std::string &type, int nb_dim, std::string &text)
Declaring a multi - dimensional array (ie TRUSTTab ) in the YAML file.
How to cite in this doc:
:ref:`void Ecrire_YAML::declare_dtab(const std::string &dname, const std::string &name, const std::string &type, int nb_dim, std::string &text) <private-void-ecrire-yaml-declare-dtab-const-std-string-ref-dname-const-std-string-ref-name-const-std-string-ref-type-int-nb-dim-std-string-ref-text>`
[void Ecrire_YAML::declare_dtab(const std::string &dname, const std::string &name, const std::string &type, int nb_dim, std::string &text)](#private-void-ecrire-yaml-declare-dtab-const-std-string-ref-dname-const-std-string-ref-name-const-std-string-ref-type-int-nb-dim-std-string-ref-text)
void Ecrire_YAML::declare_metadata(int save, std::string &text)
Declaring all metadata (ie data that will be kept in PDI memory) in the YAML file.
How to cite in this doc:
:ref:`void Ecrire_YAML::declare_metadata(int save, std::string &text) <private-void-ecrire-yaml-declare-metadata-int-save-std-string-ref-text>`
[void Ecrire_YAML::declare_metadata(int save, std::string &text)](#private-void-ecrire-yaml-declare-metadata-int-save-std-string-ref-text)
void Ecrire_YAML::declare_scalar(const std::string &name, const std::string &type, std::string &text)
Declaring a scalar in the YAML file.
How to cite in this doc:
:ref:`void Ecrire_YAML::declare_scalar(const std::string &name, const std::string &type, std::string &text) <private-void-ecrire-yaml-declare-scalar-const-std-string-ref-name-const-std-string-ref-type-std-string-ref-text>`
[void Ecrire_YAML::declare_scalar(const std::string &name, const std::string &type, std::string &text)](#private-void-ecrire-yaml-declare-scalar-const-std-string-ref-name-const-std-string-ref-type-std-string-ref-text)
void Ecrire_YAML::declare_TRUST_dataset(const std::string &dname, const std::string &name, const std::string &type, int nb_dim, bool is_parallel, std::string &text)
Declaring a dataset that will contain a data (unknown field or scalar) coming from TRUST in the YAML file: 1st dimension is that of the process rank in the node for parallel computation, 2nd dimension is that of the various iterations to be saved, 3rd dimension of the dataset actually corresponds to the first dimension of the field (we take the largest first dimension of the node so that it can fit the data of every process) remaining dimensions of the dataset are those of the field.
How to cite in this doc:
:ref:`void Ecrire_YAML::declare_TRUST_dataset(const std::string &dname, const std::string &name, const std::string &type, int nb_dim, bool is_parallel, std::string &text) <private-void-ecrire-yaml-declare-trust-dataset-const-std-string-ref-dname-const-std-string-ref-name-const-std-string-ref-type-int-nb-dim-bool-is-parallel-std-string-ref-text>`
[void Ecrire_YAML::declare_TRUST_dataset(const std::string &dname, const std::string &name, const std::string &type, int nb_dim, bool is_parallel, std::string &text)](#private-void-ecrire-yaml-declare-trust-dataset-const-std-string-ref-dname-const-std-string-ref-name-const-std-string-ref-type-int-nb-dim-bool-is-parallel-std-string-ref-text)
void Ecrire_YAML::end_bloc()
How to cite in this doc:
:ref:`void Ecrire_YAML::end_bloc() <private-void-ecrire-yaml-end-bloc>`
[void Ecrire_YAML::end_bloc()](#private-void-ecrire-yaml-end-bloc)
void Ecrire_YAML::set_data()
Parse every added problems to collect the data that we need to save/restore.
How to cite in this doc:
:ref:`void Ecrire_YAML::set_data() <private-void-ecrire-yaml-set-data>`
[void Ecrire_YAML::set_data()](#private-void-ecrire-yaml-set-data)
void Ecrire_YAML::write_attributes(const std::vector< std::string > &attributes, std::string &text)
Writes the block in the YAML file that contains all attributes to current dataset WARNING: with PDI, HDF5 - attributes are necessarily attached to a dataset (for now)
How to cite in this doc:
:ref:`void Ecrire_YAML::write_attributes(const std::vector< std::string > &attributes, std::string &text) <private-void-ecrire-yaml-write-attributes-const-std-vector-std-string-ref-attributes-std-string-ref-text>`
[void Ecrire_YAML::write_attributes(const std::vector< std::string > &attributes, std::string &text)](#private-void-ecrire-yaml-write-attributes-const-std-vector-std-string-ref-attributes-std-string-ref-text)
void Ecrire_YAML::write_checkpoint_restart_file(int save, const std::string &yaml_fname)
Private method to generate the whole YAML file for checkpoint/restart Here is how the checkpoint file is organized:
How to cite in this doc:
:ref:`void Ecrire_YAML::write_checkpoint_restart_file(int save, const std::string &yaml_fname) <private-void-ecrire-yaml-write-checkpoint-restart-file-int-save-const-std-string-ref-yaml-fname>`
[void Ecrire_YAML::write_checkpoint_restart_file(int save, const std::string &yaml_fname)](#private-void-ecrire-yaml-write-checkpoint-restart-file-int-save-const-std-string-ref-yaml-fname)
void Ecrire_YAML::write_data_for_checkpoint(int pb_i, bool is_parallel, std::string &text)
Writes the block in the YAML file that describes how the parallel data of the problem pb_i to be saved will be dumped in a dataset.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_data_for_checkpoint(int pb_i, bool is_parallel, std::string &text) <private-void-ecrire-yaml-write-data-for-checkpoint-int-pb-i-bool-is-parallel-std-string-ref-text>`
[void Ecrire_YAML::write_data_for_checkpoint(int pb_i, bool is_parallel, std::string &text)](#private-void-ecrire-yaml-write-data-for-checkpoint-int-pb-i-bool-is-parallel-std-string-ref-text)
void Ecrire_YAML::write_data_for_restart(int pb_i, std::string &text)
Writes the block in the YAML file that describes how the data of the problem pb_i to be restored will be read from the checkpoint file.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_data_for_restart(int pb_i, std::string &text) <private-void-ecrire-yaml-write-data-for-restart-int-pb-i-std-string-ref-text>`
[void Ecrire_YAML::write_data_for_restart(int pb_i, std::string &text)](#private-void-ecrire-yaml-write-data-for-restart-int-pb-i-std-string-ref-text)
void Ecrire_YAML::write_fields_types_for_checkpoint(int pb_i, std::string &text)
Writes the block in the YAML file that describes how to write the types of the fields of pb_i we want to save.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_fields_types_for_checkpoint(int pb_i, std::string &text) <private-void-ecrire-yaml-write-fields-types-for-checkpoint-int-pb-i-std-string-ref-text>`
[void Ecrire_YAML::write_fields_types_for_checkpoint(int pb_i, std::string &text)](#private-void-ecrire-yaml-write-fields-types-for-checkpoint-int-pb-i-std-string-ref-text)
void Ecrire_YAML::write_fields_types_for_restart(int pb_i, std::string &text)
Writes the block in the YAML file that describes how to read the types of the fields of pb_i we want to save.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_fields_types_for_restart(int pb_i, std::string &text) <private-void-ecrire-yaml-write-fields-types-for-restart-int-pb-i-std-string-ref-text>`
[void Ecrire_YAML::write_fields_types_for_restart(int pb_i, std::string &text)](#private-void-ecrire-yaml-write-fields-types-for-restart-int-pb-i-std-string-ref-text)
void Ecrire_YAML::write_file_initialization(int pb_i, std::string &text)
Writes the block in the YAML file that will trigger the creation of the checkpoint file for the problem pb_i.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_file_initialization(int pb_i, std::string &text) <private-void-ecrire-yaml-write-file-initialization-int-pb-i-std-string-ref-text>`
[void Ecrire_YAML::write_file_initialization(int pb_i, std::string &text)](#private-void-ecrire-yaml-write-file-initialization-int-pb-i-std-string-ref-text)
void Ecrire_YAML::write_format(int save, const std::string &fname, std::string &text)
Writes the block in the YAML file that will specify the format of the checkpoint file named fname.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_format(int save, const std::string &fname, std::string &text) <private-void-ecrire-yaml-write-format-int-save-const-std-string-ref-fname-std-string-ref-text>`
[void Ecrire_YAML::write_format(int save, const std::string &fname, std::string &text)](#private-void-ecrire-yaml-write-format-int-save-const-std-string-ref-fname-std-string-ref-text)
void Ecrire_YAML::write_impl_dataset(const std::string &dname, const std::string &fname, const std::vector< std::string > &attribute, std::string &text)
Writes the block in the YAML file to dump the data in an implicit dataset ie a dataset that does not need to be declared as its dimension corresponds to those of the data.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_impl_dataset(const std::string &dname, const std::string &fname, const std::vector< std::string > &attribute, std::string &text) <private-void-ecrire-yaml-write-impl-dataset-const-std-string-ref-dname-const-std-string-ref-fname-const-std-vector-std-string-ref-attribute-std-string-ref-text>`
[void Ecrire_YAML::write_impl_dataset(const std::string &dname, const std::string &fname, const std::vector< std::string > &attribute, std::string &text)](#private-void-ecrire-yaml-write-impl-dataset-const-std-string-ref-dname-const-std-string-ref-fname-const-std-vector-std-string-ref-attribute-std-string-ref-text)
void Ecrire_YAML::write_impl_dataset(const std::string &dname, const std::string &fname, std::string &text)
Writes the block in the YAML file to dump the data in an implicit dataset ie a dataset that does not need to be declared as its dimension corresponds to those of the data.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_impl_dataset(const std::string &dname, const std::string &fname, std::string &text) <private-void-ecrire-yaml-write-impl-dataset-const-std-string-ref-dname-const-std-string-ref-fname-std-string-ref-text>`
[void Ecrire_YAML::write_impl_dataset(const std::string &dname, const std::string &fname, std::string &text)](#private-void-ecrire-yaml-write-impl-dataset-const-std-string-ref-dname-const-std-string-ref-fname-std-string-ref-text)
void Ecrire_YAML::write_time_scheme(int save, const std::string &fname, std::string &text)
Writes the block in the YAML file regarding the time scheme for the checkpoint file fname.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_time_scheme(int save, const std::string &fname, std::string &text) <private-void-ecrire-yaml-write-time-scheme-int-save-const-std-string-ref-fname-std-string-ref-text>`
[void Ecrire_YAML::write_time_scheme(int save, const std::string &fname, std::string &text)](#private-void-ecrire-yaml-write-time-scheme-int-save-const-std-string-ref-fname-std-string-ref-text)
void Ecrire_YAML::write_TRUST_dataset(const std::string &dname, const std::string &name, int nb_dim, const std::string &cond, bool is_parallel, const std::vector< std::string > &attribute, std::string &text)
Writes the block in the YAML file to dump a TRUST data in a dataset.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_TRUST_dataset(const std::string &dname, const std::string &name, int nb_dim, const std::string &cond, bool is_parallel, const std::vector< std::string > &attribute, std::string &text) <private-void-ecrire-yaml-write-trust-dataset-const-std-string-ref-dname-const-std-string-ref-name-int-nb-dim-const-std-string-ref-cond-bool-is-parallel-const-std-vector-std-string-ref-attribute-std-string-ref-text>`
[void Ecrire_YAML::write_TRUST_dataset(const std::string &dname, const std::string &name, int nb_dim, const std::string &cond, bool is_parallel, const std::vector< std::string > &attribute, std::string &text)](#private-void-ecrire-yaml-write-trust-dataset-const-std-string-ref-dname-const-std-string-ref-name-int-nb-dim-const-std-string-ref-cond-bool-is-parallel-const-std-vector-std-string-ref-attribute-std-string-ref-text)
void Ecrire_YAML::write_TRUST_dataset_selection(const std::string &name, int nb_dim, bool is_parallel, std::string &text)
Writes the block in the YAML file to select the section in the dataset where the data will be written.
How to cite in this doc:
:ref:`void Ecrire_YAML::write_TRUST_dataset_selection(const std::string &name, int nb_dim, bool is_parallel, std::string &text) <private-void-ecrire-yaml-write-trust-dataset-selection-const-std-string-ref-name-int-nb-dim-bool-is-parallel-std-string-ref-text>`
[void Ecrire_YAML::write_TRUST_dataset_selection(const std::string &name, int nb_dim, bool is_parallel, std::string &text)](#private-void-ecrire-yaml-write-trust-dataset-selection-const-std-string-ref-name-int-nb-dim-bool-is-parallel-std-string-ref-text)
Attributes Documentation#
int Ecrire_YAML::indent_
std::vector<Pb2Save> Ecrire_YAML::pbs_