|
TRUST 1.9.8
HPC thermohydraulic platform
|
classe TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi.dev for more info More...
#include <TRUST_2_PDI.h>
Public Member Functions | |
| void | read (const std::string &name, void *data) |
| void | write (const std::string &name, const void *data) |
| void | TRUST_start_sharing (const std::string &name, const void *data) |
| void | trigger (const std::string &event) |
| void | stop_sharing_last_variable () |
| void | stop_sharing () |
| void | share_type (const Nom &name, const Nom &type) |
| Generic method to share the type of a TRUST object. | |
| void | get_type (const Nom &name, Nom &type) |
| Generic method to read the type of a TRUST object in the HDF5 file. | |
| void | share_TRUSTTab_dimensions (const DoubleTab &tab, const Nom &name, int write) |
| Generic method to share the dimensions of a TRUST DoubleTab with PDI. | |
| void | prepareRestart (OWN_PTR(Comm_Group)&nodeGroup, int &last_iteration, double &tinit, int resume_last_time) |
| Generic method to prepare the restart of a computation. | |
Static Public Member Functions | |
| static void | init (std::string IO_config) |
| static void | finalize () |
| static void | share_node_parallelism () |
| static void | share_parallelism (const Comm_Group &grp, int group_rank) |
| static void | set_PDI_checkpoint (int c) |
| static void | set_PDI_restart (int r) |
| static int | is_PDI_initialized () |
| static int | is_PDI_checkpoint () |
| static int | is_PDI_restart () |
classe TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi.dev for more info
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(); """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Definition at line 58 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 83 of file TRUST_2_PDI.h.
Generic method to read the type of a TRUST object in the HDF5 file.
| (Nom | name) the name of the object |
| (Nom | type) type of the object |
Definition at line 78 of file TRUST_2_PDI.cpp.
|
inlinestatic |
Definition at line 63 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 131 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 130 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 132 of file TRUST_2_PDI.h.
| void TRUST_2_PDI::prepareRestart | ( | OWN_PTR(Comm_Group)& | nodeGroup, |
| int & | last_iteration, | ||
| double & | tinit, | ||
| int | resume_last_time ) |
Generic method to prepare the restart of a computation.
| (OWN_PTR(Comm_Group)& | nodeGroup) communicator that will be used to read data from the checkpoint files |
| (int& | last_iteration) the index of the backup iteration we want to recover from |
| (double& | tinit) the time from which we want to resume the calculation |
| (int | resume_last_time) flag to specify if we want to resume from the last time or we want to recover from a specific time |
Definition at line 110 of file TRUST_2_PDI.cpp.
|
inline |
Definition at line 135 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 127 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 128 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 98 of file TRUST_2_PDI.h.
|
inlinestatic |
Definition at line 118 of file TRUST_2_PDI.h.
| 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.
| (const | DoubleTab& tab) the array we want to share with PDI |
| (Nom | name) the name of the array |
| (int | write) flag to specify if we want to write the dimensions or read into it |
Definition at line 30 of file TRUST_2_PDI.cpp.
Generic method to share the type of a TRUST object.
| (Nom | name) the name of the object |
| (Nom | type) type of the object |
Definition at line 59 of file TRUST_2_PDI.cpp.
|
inline |
Definition at line 180 of file TRUST_2_PDI.h.
|
inline |
Definition at line 171 of file TRUST_2_PDI.h.
|
inline |
Definition at line 162 of file TRUST_2_PDI.h.
|
inline |
Definition at line 153 of file TRUST_2_PDI.h.
|
inline |
Definition at line 143 of file TRUST_2_PDI.h.