TRUST_2_PDI#
#include <TRUST_2_PDI.h>
classe TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi.dev for more info
How to cite this class in this doc#
:ref:`TRUST\_2\_PDI <class-trust-2-pdi>`
[TRUST\_2\_PDI](#class-trust-2-pdi)
Detailed description#
PDI needs to be initialized with a YAML file, containing all the data that we want to exchange with the outside world (see the class Ecrire_YAML for details). Note that every data that will be handled via PDI first needs to be declared in the YAML file that has been used to initialize it! Here is how PDI works: 1) TRUST makes it known to PDI that some of our data is accessible (ie we start sharing a pointer to the data, no copy here!) 2) PDI notifies the selected plugin that the data is ready 3) The plugin works with the data and behaves just as we described it in the YAML file 4) Once the work is done, TRUST can reclaim the data (which means PDI will no longer be able to reach it) and pursue the simulation These steps can be completed at once in a single operation or asynchronously (ie we share the data, we busy ourselves with some other stuff, then we trigger the IO operations and reclaim the data). An example on how to use it: “””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””” int var = 5; TRUST_2_PDI::init(yaml_filename); TRUST_2_PDI pdi_interface; pdi_interface.start_sharing(“pb_var”, &var); // the YAML file must contain a data named pb_var pdi_interface.trigger(“event”); // there has to be an event in the YAML that tells us what to do with the data pdi_interface.stop_sharing_last_variable(); // data is no more available // the last 3 instructions can be squeezed in one with the methods TRUST_2_PDI::read() /TRUST_2_PDI::write() TRUST_2_PDI::finalize() ; “”””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””
List of Public Static Methods#
List of Public Methods#
Complete Member Function Documentation#
static void TRUST_2_PDI::finalize()
Referenced By
How to cite in this doc:
:ref:`static void TRUST_2_PDI::finalize() <public-static-static-void-trust-2-pdi-finalize>`
[static void TRUST_2_PDI::finalize()](#public-static-static-void-trust-2-pdi-finalize)
static void TRUST_2_PDI::init(std::string IO_config)
References
Referenced By
How to cite in this doc:
:ref:`static void TRUST_2_PDI::init(std::string IO_config) <public-static-static-void-trust-2-pdi-init-std-string-io-config>`
[static void TRUST_2_PDI::init(std::string IO_config)](#public-static-static-void-trust-2-pdi-init-std-string-io-config)
static int TRUST_2_PDI::is_PDI_checkpoint()
How to cite in this doc:
:ref:`static int TRUST_2_PDI::is_PDI_checkpoint() <public-static-static-int-trust-2-pdi-is-pdi-checkpoint>`
[static int TRUST_2_PDI::is_PDI_checkpoint()](#public-static-static-int-trust-2-pdi-is-pdi-checkpoint)
static int TRUST_2_PDI::is_PDI_initialized()
Referenced By
How to cite in this doc:
:ref:`static int TRUST_2_PDI::is_PDI_initialized() <public-static-static-int-trust-2-pdi-is-pdi-initialized>`
[static int TRUST_2_PDI::is_PDI_initialized()](#public-static-static-int-trust-2-pdi-is-pdi-initialized)
static int TRUST_2_PDI::is_PDI_restart()
How to cite in this doc:
:ref:`static int TRUST_2_PDI::is_PDI_restart() <public-static-static-int-trust-2-pdi-is-pdi-restart>`
[static int TRUST_2_PDI::is_PDI_restart()](#public-static-static-int-trust-2-pdi-is-pdi-restart)
static void TRUST_2_PDI::set_PDI_checkpoint(int c)
How to cite in this doc:
:ref:`static void TRUST_2_PDI::set_PDI_checkpoint(int c) <public-static-static-void-trust-2-pdi-set-pdi-checkpoint-int-c>`
[static void TRUST_2_PDI::set_PDI_checkpoint(int c)](#public-static-static-void-trust-2-pdi-set-pdi-checkpoint-int-c)
static void TRUST_2_PDI::set_PDI_restart(int r)
Referenced By
How to cite in this doc:
:ref:`static void TRUST_2_PDI::set_PDI_restart(int r) <public-static-static-void-trust-2-pdi-set-pdi-restart-int-r>`
[static void TRUST_2_PDI::set_PDI_restart(int r)](#public-static-static-void-trust-2-pdi-set-pdi-restart-int-r)
void TRUST_2_PDI::get_type(const Nom &name, Nom &type)
Generic method to read the type of a TRUST object in the HDF5 file.
References
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::get_type(const Nom &name, Nom &type) <public-void-trust-2-pdi-get-type-const-nom-ref-name-nom-ref-type>`
[void TRUST_2_PDI::get_type(const Nom &name, Nom &type)](#public-void-trust-2-pdi-get-type-const-nom-ref-name-nom-ref-type)
void TRUST_2_PDI::prepareRestart(int &last_iteration, double &tinit, int resume_last_time)
Generic method to prepare the restart of a computation.
References
How to cite in this doc:
:ref:`void TRUST_2_PDI::prepareRestart(int &last_iteration, double &tinit, int resume_last_time) <public-void-trust-2-pdi-preparerestart-int-ref-last-iteration-double-ref-tinit-int-resume-last-time>`
[void TRUST_2_PDI::prepareRestart(int &last_iteration, double &tinit, int resume_last_time)](#public-void-trust-2-pdi-preparerestart-int-ref-last-iteration-double-ref-tinit-int-resume-last-time)
void TRUST_2_PDI::read(const std::string &name, void *data)
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::read(const std::string &name, void *data) <public-void-trust-2-pdi-read-const-std-string-ref-name-void-ptr-data>`
[void TRUST_2_PDI::read(const std::string &name, void *data)](#public-void-trust-2-pdi-read-const-std-string-ref-name-void-ptr-data)
void TRUST_2_PDI::share_TRUSTTab_dimensions(const DoubleTab &tab, const Nom &name, int write)
Generic method to share the dimensions of a TRUST DoubleTab with PDI.
References
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::share_TRUSTTab_dimensions(const DoubleTab &tab, const Nom &name, int write) <public-void-trust-2-pdi-share-trusttab-dimensions-const-doubletab-ref-tab-const-nom-ref-name-int-write>`
[void TRUST_2_PDI::share_TRUSTTab_dimensions(const DoubleTab &tab, const Nom &name, int write)](#public-void-trust-2-pdi-share-trusttab-dimensions-const-doubletab-ref-tab-const-nom-ref-name-int-write)
void TRUST_2_PDI::share_type(const Nom &name, const Nom &type)
Generic method to share the type of a TRUST object.
References
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::share_type(const Nom &name, const Nom &type) <public-void-trust-2-pdi-share-type-const-nom-ref-name-const-nom-ref-type>`
[void TRUST_2_PDI::share_type(const Nom &name, const Nom &type)](#public-void-trust-2-pdi-share-type-const-nom-ref-name-const-nom-ref-type)
void TRUST_2_PDI::stop_sharing()
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::stop_sharing() <public-void-trust-2-pdi-stop-sharing>`
[void TRUST_2_PDI::stop_sharing()](#public-void-trust-2-pdi-stop-sharing)
void TRUST_2_PDI::stop_sharing_last_variable()
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::stop_sharing_last_variable() <public-void-trust-2-pdi-stop-sharing-last-variable>`
[void TRUST_2_PDI::stop_sharing_last_variable()](#public-void-trust-2-pdi-stop-sharing-last-variable)
void TRUST_2_PDI::trigger(const std::string &event)
Referenced By
How to cite in this doc:
:ref:`void TRUST_2_PDI::trigger(const std::string &event) <public-void-trust-2-pdi-trigger-const-std-string-ref-event>`
[void TRUST_2_PDI::trigger(const std::string &event)](#public-void-trust-2-pdi-trigger-const-std-string-ref-event)
void TRUST_2_PDI::TRUST_start_sharing(const std::string &name, const void *data)
How to cite in this doc:
:ref:`void TRUST_2_PDI::TRUST_start_sharing(const std::string &name, const void *data) <public-void-trust-2-pdi-trust-start-sharing-const-std-string-ref-name-const-void-ptr-data>`
[void TRUST_2_PDI::TRUST_start_sharing(const std::string &name, const void *data)](#public-void-trust-2-pdi-trust-start-sharing-const-std-string-ref-name-const-void-ptr-data)
void TRUST_2_PDI::write(const std::string &name, const void *data)
How to cite in this doc:
:ref:`void TRUST_2_PDI::write(const std::string &name, const void *data) <public-void-trust-2-pdi-write-const-std-string-ref-name-const-void-ptr-data>`
[void TRUST_2_PDI::write(const std::string &name, const void *data)](#public-void-trust-2-pdi-write-const-std-string-ref-name-const-void-ptr-data)
Attributes Documentation#
int TRUST_2_PDI::PDI_checkpoint_ = 0
int TRUST_2_PDI::PDI_initialized_ = 0
int TRUST_2_PDI::PDI_restart_ = 0
std::vector<std::string> TRUST_2_PDI::shared_data_