QuIDS: Quantum Irregular Dynamic Simulator
Public Member Functions | Data Fields | Friends
quids::mpi::mpi_iteration Class Reference

mpi iteration (wave function) class, ineriting from the quids::iteration class More...

#include <quids_mpi.hpp>

Inheritance diagram for quids::mpi::mpi_iteration:
quids::iteration

Public Member Functions

 mpi_iteration ()
 simple empty wavefunction constructor.
 
 mpi_iteration (char *object_begin_, char *object_end_)
 constructor that insert a single object with magnitude 1 More...
 
size_t get_total_num_object (MPI_Comm communicator) const
 getter for the total amount of distributed objects. More...
 
size_t get_total_num_symbolic_object (MPI_Comm communicator) const
 getter for the total amount of distributed symbolic objects. More...
 
PROBA_TYPE average_value (const quids::observable_t observable) const
 function to get the average local value of a custom observable. More...
 
PROBA_TYPE average_value (const quids::observable_t observable, MPI_Comm communicator) const
 function to get the average value of a custom observable accross the total distributed wave function. More...
 
void send_objects (size_t num_object_sent, int node, MPI_Comm communicator, bool send_num_child=false)
 function to send objects (from the "tail" of the memory representation). More...
 
void receive_objects (int node, MPI_Comm communicator, bool receive_num_child=false, size_t max_mem=-1)
 function to receive objects (at the "tail" of the memory representation). More...
 
void equalize (MPI_Comm communicator)
 equalize the number of object across node pairs. More...
 
void distribute_objects (MPI_Comm communicator, int node_id)
 distribute objects eqaully from a single node to all others. More...
 
void gather_objects (MPI_Comm communicator, int node_id)
 gather objects to a single node from all others. More...
 
- Public Member Functions inherited from quids::iteration
 iteration ()
 simple empty wavefunction constructor
 
 iteration (char *object_begin_, char *object_end_)
 constructor that insert a single object with magnitude 1 More...
 
void append (char const *object_begin_, char const *object_end_, mag_t const mag=1)
 function that insert a single object with a given magnitude More...
 
void pop (size_t n=1, bool normalize_=true)
 function that removes a given number of object from the "tail" of the memory representation More...
 
PROBA_TYPE average_value (const observable_t observable) const
 function to get the average value of a custom observable More...
 
void get_object (size_t const object_id, char *&object_begin_, uint &object_size_, mag_t *&mag)
 function to access a particular object (read-write access) More...
 
void get_object (size_t const object_id, char const *&object_begin_, uint &object_size_, mag_t &mag) const
 function to access a particular object (read-only access) More...
 

Data Fields

PROBA_TYPE node_total_proba = 0
 total probability retained locally after previous truncation (if any).
 
- Data Fields inherited from quids::iteration
size_t num_object = 0
 number of objects contained in the wave function
 
PROBA_TYPE total_proba = 1
 total probability retained after previous truncation (if any).
 

Friends

void simulate (mpi_it_t &iteration, quids::rule_t const *rule, mpi_it_t &next_iteration, mpi_sy_it_t &symbolic_iteration, MPI_Comm communicator, size_t max_num_object, quids::debug_t mid_step_function)
 function to apply a dynamic to a wave function distributed accross multiple nodes More...
 

Additional Inherited Members

- Protected Attributes inherited from quids::iteration
size_t truncated_num_object = 0
 
uint ub_symbolic_object_size = 0
 
utils::fast_vector< mag_tmagnitude
 
utils::fast_vector< char > objects
 
utils::fast_vector< size_t > object_begin
 
utils::fast_vector< uint > object_size
 
utils::fast_vector< uint > num_childs
 
utils::fast_vector< size_t > child_begin
 
utils::fast_vector< size_t > truncated_oid
 
utils::fast_vector< float > random_selector
 

Detailed Description

mpi iteration (wave function) class, ineriting from the quids::iteration class

Constructor & Destructor Documentation

◆ mpi_iteration()

quids::mpi::mpi_iteration::mpi_iteration ( char *  object_begin_,
char *  object_end_ 
)
inline

constructor that insert a single object with magnitude 1

Parameters
[in]object_begin_,object_end_delimitations of the object to insert.

Member Function Documentation

◆ average_value() [1/2]

PROBA_TYPE quids::mpi::mpi_iteration::average_value ( const quids::observable_t  observable) const
inline

function to get the average local value of a custom observable.

Parameters
[in]observableobservable that should be computed.

◆ average_value() [2/2]

PROBA_TYPE quids::mpi::mpi_iteration::average_value ( const quids::observable_t  observable,
MPI_Comm  communicator 
) const
inline

function to get the average value of a custom observable accross the total distributed wave function.

Parameters
[in]observableobservable that should be computed.
[in]communicatorMPI communcator.

◆ distribute_objects()

void quids::mpi::mpi_iteration::distribute_objects ( MPI_Comm  communicator,
int  node_id = 0 
)

distribute objects eqaully from a single node to all others.

Parameters
[in]communicatorMPI communcator.
[in]nodenode identifier that objects should be distributed from.

◆ equalize()

void quids::mpi::mpi_iteration::equalize ( MPI_Comm  communicator)

equalize the number of object across node pairs.

Parameters
[in]communicatorMPI communcator.

◆ gather_objects()

void quids::mpi::mpi_iteration::gather_objects ( MPI_Comm  communicator,
int  node_id = 0 
)

gather objects to a single node from all others.

Parameters
[in]communicatorMPI communcator.
[in]nodenode identifier that objects should be gathered to.

◆ get_total_num_object()

size_t quids::mpi::mpi_iteration::get_total_num_object ( MPI_Comm  communicator) const
inline

getter for the total amount of distributed objects.

Parameters
[in]communicatorMPI communcator.

◆ get_total_num_symbolic_object()

size_t quids::mpi::mpi_iteration::get_total_num_symbolic_object ( MPI_Comm  communicator) const
inline

getter for the total amount of distributed symbolic objects.

Parameters
[in]communicatorMPI communcator.

◆ receive_objects()

void quids::mpi::mpi_iteration::receive_objects ( int  node,
MPI_Comm  communicator,
bool  receive_num_child = false,
size_t  max_mem = -1 
)
inline

function to receive objects (at the "tail" of the memory representation).

Parameters
[in]nodenode identifier that objects should be received from. @params[in] communicator MPI communcator. @params[in] receive_num_child wether to also receive the number of children per object or not. @params[in] max_mem the maximum amount of memory that can be received, -1 means no limits.

◆ send_objects()

void quids::mpi::mpi_iteration::send_objects ( size_t  num_object_sent,
int  node,
MPI_Comm  communicator,
bool  send_num_child = false 
)
inline

function to send objects (from the "tail" of the memory representation).

Parameters
[in]num_object_sentnumber of object to be sent.
[in]nodenode identifier that objects should be sent to. @params[in] communicator MPI communcator. @params[in] send_num_child wether to also send the number of children per object or not.

Friends And Related Function Documentation

◆ simulate

void simulate ( mpi_it_t iteration,
quids::rule_t const *  rule,
mpi_it_t next_iteration,
mpi_sy_it_t symbolic_iteration,
MPI_Comm  communicator,
size_t  max_num_object = 0,
quids::debug_t  mid_step_function = [](const char*){} 
)
friend

function to apply a dynamic to a wave function distributed accross multiple nodes

Parameters
[in]iterationwavefunction that the dynamic will be applied to.
[in]ruledynamic that will be applied.
[out]next_iterationwave function that will be overwritten to then contained the final wave function.
[out]symbolic_iterationsymbolic iteration that will be used.
[in]communicatorMPI communcator.
[in]max_num_objectmaximum number of objects to be kept per node, -1 means no maximum, 0 means automaticaly finding the maximum ammount of objects that can be kept in memory.
[in]mid_step_functiondebuging function called between steps.

The documentation for this class was generated from the following file: