TRUST_2_PDI#

#include <TRUST_2_PDI.h>
Brief description

classe TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi.dev for more info

How to reference this class#

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

: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#

finalize#

Definition
static void TRUST_2_PDI::finalize()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static void TRUST_2_PDI::finalize() <trust-2-pdi-public-static-static-void-trust-2-pdi-finalize>`
[static void TRUST_2_PDI::finalize()](#trust-2-pdi-public-static-static-void-trust-2-pdi-finalize)

init#

Definition
static void TRUST_2_PDI::init(std::string IO_config)
Brief description
Detailed description
References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static void TRUST_2_PDI::init(std::string IO_config) <trust-2-pdi-public-static-static-void-trust-2-pdi-init-std-string-io-config>`
[static void TRUST_2_PDI::init(std::string IO_config)](#trust-2-pdi-public-static-static-void-trust-2-pdi-init-std-string-io-config)

is_PDI_checkpoint#

Definition
static int TRUST_2_PDI::is_PDI_checkpoint()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static int TRUST_2_PDI::is_PDI_checkpoint() <trust-2-pdi-public-static-static-int-trust-2-pdi-is-pdi-checkpoint>`
[static int TRUST_2_PDI::is_PDI_checkpoint()](#trust-2-pdi-public-static-static-int-trust-2-pdi-is-pdi-checkpoint)

is_PDI_initialized#

Definition
static int TRUST_2_PDI::is_PDI_initialized()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static int TRUST_2_PDI::is_PDI_initialized() <trust-2-pdi-public-static-static-int-trust-2-pdi-is-pdi-initialized>`
[static int TRUST_2_PDI::is_PDI_initialized()](#trust-2-pdi-public-static-static-int-trust-2-pdi-is-pdi-initialized)

is_PDI_restart#

Definition
static int TRUST_2_PDI::is_PDI_restart()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static int TRUST_2_PDI::is_PDI_restart() <trust-2-pdi-public-static-static-int-trust-2-pdi-is-pdi-restart>`
[static int TRUST_2_PDI::is_PDI_restart()](#trust-2-pdi-public-static-static-int-trust-2-pdi-is-pdi-restart)

set_PDI_checkpoint#

Definition
static void TRUST_2_PDI::set_PDI_checkpoint(int c)
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static void TRUST_2_PDI::set_PDI_checkpoint(int c) <trust-2-pdi-public-static-static-void-trust-2-pdi-set-pdi-checkpoint-int-c>`
[static void TRUST_2_PDI::set_PDI_checkpoint(int c)](#trust-2-pdi-public-static-static-void-trust-2-pdi-set-pdi-checkpoint-int-c)

set_PDI_restart#

Definition
static void TRUST_2_PDI::set_PDI_restart(int r)
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`static void TRUST_2_PDI::set_PDI_restart(int r) <trust-2-pdi-public-static-static-void-trust-2-pdi-set-pdi-restart-int-r>`
[static void TRUST_2_PDI::set_PDI_restart(int r)](#trust-2-pdi-public-static-static-void-trust-2-pdi-set-pdi-restart-int-r)

get_type#

Definition
void TRUST_2_PDI::get_type(const Nom &name, Nom &type)
Brief description

Generic method to read the type of a TRUST object in the HDF5 file.

Detailed description
References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::get_type(const Nom &name, Nom &type) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-get-type-const-nom-ref-name-nom-ref-type)

prepareRestart#

Definition
void TRUST_2_PDI::prepareRestart(int &last_iteration, double &tinit, int resume_last_time)
Brief description

Generic method to prepare the restart of a computation.

Detailed description
References
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::prepareRestart(int &last_iteration, double &tinit, int resume_last_time) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-preparerestart-int-ref-last-iteration-double-ref-tinit-int-resume-last-time)

read#

Definition
void TRUST_2_PDI::read(const std::string &name, void *data)
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::read(const std::string &name, void *data) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-read-const-std-string-ref-name-void-ptr-data)

share_TRUSTTab_dimensions#

Definition
void TRUST_2_PDI::share_TRUSTTab_dimensions(const DoubleTab &tab, const Nom &name, int write)
Brief description

Generic method to share the dimensions of a TRUST DoubleTab with PDI.

Detailed description
References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::share_TRUSTTab_dimensions(const DoubleTab &tab, const Nom &name, int write) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-share-trusttab-dimensions-const-doubletab-ref-tab-const-nom-ref-name-int-write)

share_type#

Definition
void TRUST_2_PDI::share_type(const Nom &name, const Nom &type)
Brief description

Generic method to share the type of a TRUST object.

Detailed description
References
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::share_type(const Nom &name, const Nom &type) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-share-type-const-nom-ref-name-const-nom-ref-type)

stop_sharing#

Definition
void TRUST_2_PDI::stop_sharing()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::stop_sharing() <trust-2-pdi-public-void-trust-2-pdi-stop-sharing>`
[void TRUST_2_PDI::stop_sharing()](#trust-2-pdi-public-void-trust-2-pdi-stop-sharing)

stop_sharing_last_variable#

Definition
void TRUST_2_PDI::stop_sharing_last_variable()
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::stop_sharing_last_variable() <trust-2-pdi-public-void-trust-2-pdi-stop-sharing-last-variable>`
[void TRUST_2_PDI::stop_sharing_last_variable()](#trust-2-pdi-public-void-trust-2-pdi-stop-sharing-last-variable)

trigger#

Definition
void TRUST_2_PDI::trigger(const std::string &event)
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::trigger(const std::string &event) <trust-2-pdi-public-void-trust-2-pdi-trigger-const-std-string-ref-event>`
[void TRUST_2_PDI::trigger(const std::string &event)](#trust-2-pdi-public-void-trust-2-pdi-trigger-const-std-string-ref-event)

TRUST_start_sharing#

Definition
void TRUST_2_PDI::TRUST_start_sharing(const std::string &name, const void *data)
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::TRUST_start_sharing(const std::string &name, const void *data) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-trust-start-sharing-const-std-string-ref-name-const-void-ptr-data)

write#

Definition
void TRUST_2_PDI::write(const std::string &name, const void *data)
Brief description
Detailed description
Referenced By
How to reference this method:

Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):

:ref:`void TRUST_2_PDI::write(const std::string &name, const void *data) <trust-2-pdi-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)](#trust-2-pdi-public-void-trust-2-pdi-write-const-std-string-ref-name-const-void-ptr-data)

Attributes Documentation#

PDI_checkpoint_ (private)
int TRUST_2_PDI::PDI_checkpoint_ = 0
PDI_initialized_ (private)
int TRUST_2_PDI::PDI_initialized_ = 0
PDI_restart_ (private)
int TRUST_2_PDI::PDI_restart_ = 0
shared_data_ (private)
std::vector<std::string> TRUST_2_PDI::shared_data_