TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Schema_Comm Class Reference

#include <Schema_Comm.h>

Inheritance diagram for Schema_Comm:
[legend]
Collaboration diagram for Schema_Comm:
[legend]

Public Member Functions

 Schema_Comm ()
 Constructs a new communication schema.
 Schema_Comm (const Schema_Comm &)
 Copy constructor (new schema placed in RESET mode).
 ~Schema_Comm ()
 Destructs a communication schema.
void set_group (const Comm_Group &group)
 Obsolete method. The group associated with the schema is the current group at the time the schema is created.
const Comm_Groupget_group () const
 Returns the group associated with the schema.
const Schema_Commoperator= (const Schema_Comm &)
 Copy operator: copies the list of communicating processors.
void set_send_recv_pe_list (const ArrOfInt &send_pe_list, const ArrOfInt &recv_pe_list, const int me_to_me=0)
 Defines the list of processors to send data to and receive data from.
void begin_comm () const
 Reserves communication buffers for a new communication.
Sortiesend_buffer (int num_PE) const
 Returns the buffer corresponding to processor num_PE to stack data to send.
void echange_taille_et_messages () const
 Launches the data exchange between all processors.
void echange_messages (const ArrOfInt &recv_size) const
 Launches the data exchange.
Entreerecv_buffer (int num_PE) const
 Returns the buffer corresponding to processor num_PE to read received data.
void end_comm () const
 Clears the buffers and releases resources: reading of received data from buffers is complete.
const ArrOfInt & get_send_pe_list () const
const ArrOfInt & get_recv_pe_list () const
void set_all_to_allv_flag (int x)

Protected Types

enum  Static_Status { UNINITIALIZED , RESET , WRITING , EXCHANGED }

Protected Member Functions

void echange_taille (const ArrOfInt &send_size, ArrOfInt &recv_size) const
 Transmits the size of messages to send to the processors that will receive them.
void echange_messages (const ArrOfInt &send_size, const ArrOfInt &recv_size) const
 Launches the data exchange between all processors.
void check_send_recv_pe_list () const
 Verifies that send/recv_pe_list satisfy the property "you listen when I speak".
 OBS_PTR (Comm_Group) ref_group_

Static Protected Member Functions

static OutputCommBufferobuffer (int pe)
 Accessor to a member of the obuffers_ array (with verification).
static InputCommBufferebuffer (int pe)
 Accessor to a member of the ebuffers_ array (with verification).

Protected Attributes

ArrOfInt send_pe_list_
ArrOfInt recv_pe_list_
int me_to_me_
int use_all_to_allv_

Static Protected Attributes

static Static_Status status_ = UNINITIALIZED

Detailed Description

Definition at line 78 of file Schema_Comm.h.

Member Enumeration Documentation

◆ Static_Status

Enumerator
UNINITIALIZED 
RESET 
WRITING 
EXCHANGED 

Definition at line 115 of file Schema_Comm.h.

Constructor & Destructor Documentation

◆ Schema_Comm() [1/2]

Schema_Comm::Schema_Comm ( )

Constructs a new communication schema.

Definition at line 62 of file Schema_Comm.cpp.

◆ Schema_Comm() [2/2]

Schema_Comm::Schema_Comm ( const Schema_Comm & schema)

Copy constructor (new schema placed in RESET mode).

Warning: all members of the Comm_Group must execute this function simultaneously.

Definition at line 92 of file Schema_Comm.cpp.

◆ ~Schema_Comm()

Schema_Comm::~Schema_Comm ( )

Destructs a communication schema.

Definition at line 83 of file Schema_Comm.cpp.

Member Function Documentation

◆ begin_comm()

void Schema_Comm::begin_comm ( ) const

Reserves communication buffers for a new communication.

The schema transitions from RESET to WRITING; send_buffer() may now be called. It is forbidden to call begin_comm() again on all communication objects before finishing this communication with end_comm().

Definition at line 167 of file Schema_Comm.cpp.

◆ check_send_recv_pe_list()

void Schema_Comm::check_send_recv_pe_list ( ) const
protected

Verifies that send/recv_pe_list satisfy the property "you listen when I speak".

Definition at line 558 of file Schema_Comm.cpp.

◆ ebuffer()

InputCommBuffer & Schema_Comm::ebuffer ( int pe)
inlinestaticprotected

Accessor to a member of the ebuffers_ array (with verification).

Parameters
peProcessor index.
Returns
Reference to the InputCommBuffer for processor pe.

Definition at line 46 of file Schema_Comm.cpp.

◆ echange_messages() [1/2]

void Schema_Comm::echange_messages ( const ArrOfInt & recv_size) const

Launches the data exchange.

The size in bytes of received messages is provided in recv_size (array of the same size as recv_pe_list). In check_enabled mode, verifies that the size is correct.

Definition at line 408 of file Schema_Comm.cpp.

◆ echange_messages() [2/2]

void Schema_Comm::echange_messages ( const ArrOfInt & send_size,
const ArrOfInt & recv_size ) const
protected

Launches the data exchange between all processors.

The size of received messages must already be known. The schema transitions from WRITING to EXCHANGED.

Definition at line 315 of file Schema_Comm.cpp.

◆ echange_taille()

void Schema_Comm::echange_taille ( const ArrOfInt & send_size,
ArrOfInt & recv_size ) const
protected

Transmits the size of messages to send to the processors that will receive them.

The size is the number of bytes of the obuffers. send_pe_list and recv_pe_list must be initialized. The schema must be in the WRITING state.

Definition at line 264 of file Schema_Comm.cpp.

◆ echange_taille_et_messages()

void Schema_Comm::echange_taille_et_messages ( ) const

Launches the data exchange between all processors.

The size of received messages does not need to be known a priori; it is transmitted. The schema transitions from WRITING to EXCHANGED.

Definition at line 383 of file Schema_Comm.cpp.

◆ end_comm()

void Schema_Comm::end_comm ( ) const

Clears the buffers and releases resources: reading of received data from buffers is complete.

The schema transitions from EXCHANGED to RESET.

Definition at line 436 of file Schema_Comm.cpp.

◆ get_group()

const Comm_Group & Schema_Comm::get_group ( ) const

Returns the group associated with the schema.

Definition at line 134 of file Schema_Comm.cpp.

◆ get_recv_pe_list()

const ArrOfInt & Schema_Comm::get_recv_pe_list ( ) const

Definition at line 523 of file Schema_Comm.cpp.

◆ get_send_pe_list()

const ArrOfInt & Schema_Comm::get_send_pe_list ( ) const

Definition at line 517 of file Schema_Comm.cpp.

◆ OBS_PTR()

Schema_Comm::OBS_PTR ( Comm_Group )
protected

◆ obuffer()

OutputCommBuffer & Schema_Comm::obuffer ( int pe)
inlinestaticprotected

Accessor to a member of the obuffers_ array (with verification).

Parameters
peProcessor index.
Returns
Reference to the OutputCommBuffer for processor pe.

Definition at line 35 of file Schema_Comm.cpp.

◆ operator=()

const Schema_Comm & Schema_Comm::operator= ( const Schema_Comm & schema)

Copy operator: copies the list of communicating processors.

The new schema is placed in the RESET state. Note: all members of the Comm_Group must execute this function simultaneously.

Definition at line 105 of file Schema_Comm.cpp.

◆ recv_buffer()

Entree & Schema_Comm::recv_buffer ( int num_PE) const

Returns the buffer corresponding to processor num_PE to read received data.

The schema must be in the EXCHANGED state.

Definition at line 504 of file Schema_Comm.cpp.

◆ send_buffer()

Sortie & Schema_Comm::send_buffer ( int num_PE) const

Returns the buffer corresponding to processor num_PE to stack data to send.

The schema must be in the WRITING state.

Definition at line 485 of file Schema_Comm.cpp.

◆ set_all_to_allv_flag()

void Schema_Comm::set_all_to_allv_flag ( int x)
inline

Definition at line 103 of file Schema_Comm.h.

◆ set_group()

void Schema_Comm::set_group ( const Comm_Group & group)

Obsolete method. The group associated with the schema is the current group at the time the schema is created.

This method is only valid with the same group as the original group. The method does nothing.

Definition at line 125 of file Schema_Comm.cpp.

◆ set_send_recv_pe_list()

void Schema_Comm::set_send_recv_pe_list ( const ArrOfInt & send_pe_list,
const ArrOfInt & recv_pe_list,
const int me_to_me = 0 )

Defines the list of processors to send data to and receive data from.

If me_to_me is non-zero, messages to oneself are allowed; otherwise not (optional argument: default me_to_me=0).

Definition at line 146 of file Schema_Comm.cpp.

Member Data Documentation

◆ me_to_me_

int Schema_Comm::me_to_me_
protected

Definition at line 122 of file Schema_Comm.h.

◆ recv_pe_list_

ArrOfInt Schema_Comm::recv_pe_list_
protected

Definition at line 121 of file Schema_Comm.h.

◆ send_pe_list_

ArrOfInt Schema_Comm::send_pe_list_
protected

Definition at line 120 of file Schema_Comm.h.

◆ status_

Schema_Comm::Static_Status Schema_Comm::status_ = UNINITIALIZED
staticprotected

Definition at line 116 of file Schema_Comm.h.

◆ use_all_to_allv_

int Schema_Comm::use_all_to_allv_
protected

Definition at line 125 of file Schema_Comm.h.


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