COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
#include <CommPattern.hpp>
Inherits Component.
Classes | |
class | dist_struct |
helper struct for setup function More... | |
class | temp_buffer_item |
typedef for the temporary buffer More... | |
Public Types | |
TYPEDEFS | |
enum | dist_struct_flags { NOFLAGS =0x0, GHOST =0x1, UPDATABLE =0x2, UNUSED =0x4, DELETED =0x8, ALLDELETE =0x16 } |
enum for flags in dist_struct More... | |
typedef int | CPint |
type of integer to use internally in commpattern, to avoid mess of changing type when mpi allows unsigned ints More... | |
typedef std::vector< temp_buffer_item > | temp_buffer_array |
typedef for the temporary buffer array More... | |
Public Types inherited from Component | |
typedef ComponentIterator< Component > | iterator |
type of the iterator to Component More... | |
typedef ComponentIterator< Component const > | const_iterator |
type of the iterator to constant Component More... | |
Public Types inherited from SignalHandler | |
typedef std::vector< SignalPtr > | storage_t |
storage type for signals More... | |
Public Member Functions | |
DATA REGISTRATION | |
template<typename T > | |
void | insert (const std::string &name, T *&data, const int size, const unsigned int stride=1, const bool needs_update=true) |
template<typename T > | |
void | insert (const std::string &name, T **data, const int size, const unsigned int stride=1, const bool needs_update=true) |
template<typename T > | |
void | insert (const std::string &name, std::vector< T > &data, const unsigned int stride=1, const bool needs_update=true) |
template<typename ValueT , std::size_t NDims> | |
void | insert (const std::string &name, boost::multi_array< ValueT, NDims > &data, const bool needs_update=true) |
template<typename T > | |
void | insert (const std::string &name, std::vector< T > *data, const unsigned int stride=1, const bool needs_update=true) |
void | clear (const std::string &name) |
removes data by name More... | |
COMMPATTERN HANDLING | |
void | setup (const Handle< CommWrapper > &gid, std::vector< Uint > &rank) |
void | setup (const Handle< CommWrapper > &gid, boost::multi_array< Uint, 1 > &rank) |
void | setup () |
void | synchronize_all () |
synchronize the all parallel objects More... | |
void | synchronize (const std::string &name) |
void | synchronize (const CommWrapper &pobj) |
void | add_global (Uint gid, Uint rank) |
Uint | add_local (bool as_ghost=false) |
void | move_local (Uint lid, Uint rank, bool keep_as_ghost=true) |
void | remove_local (Uint lid, bool on_all_ranks=false) |
ACCESSORS | |
bool | isUpToDate () const |
bool | isFreeze () const |
const Handle< CommWrapper > | gid () const |
std::vector< bool > & | isUpdatable () |
int | rank (const Uint lid) const |
Return the rank associated with the given local ID. More... | |
Public Member Functions inherited from Component | |
Component (const std::string &name) | |
virtual | ~Component () |
Virtual destructor. More... | |
const std::string & | name () const |
Access the name of the component. More... | |
void | rename (const std::string &name) |
Rename the component. More... | |
URI | uri () const |
Construct the full path. More... | |
void | complete_path (URI &path) const |
Handle< Component > | access_component (const URI &path) const |
Handle< Component > | access_component_checked (const URI &path) |
Handle< Component const > | access_component_checked (const URI &path) const |
Handle< Component > | handle () |
Get a handle to the component. More... | |
Handle< Component const > | handle () const |
template<typename ComponentT > | |
Handle< ComponentT > | handle () |
template<typename ComponentT > | |
Handle< ComponentT const > | handle () const |
Handle< Component > | parent () const |
Handle< Component const > | root () const |
Handle< Component > | root () |
Handle< Component > | get_child (const std::string &name) |
Handle< Component const > | get_child (const std::string &name) const |
Handle< Component > | get_child_checked (const std::string &name) |
Handle< Component const > | get_child_checked (const std::string &name) const |
Handle< Component > | create_component (const std::string &name, const std::string &builder) |
Build a (sub)component of this component using the extended type_name of the component. More... | |
template<typename T > | |
Handle< T > | create_component (const std::string &name) |
Create a (sub)component of this component automatically cast to the specified type. More... | |
template<typename T > | |
Handle< T > | create_static_component (const std::string &name) |
Create a static "always there" subcomponent. More... | |
Component & | add_component (const boost::shared_ptr< Component > &subcomp) |
Add the passed component as a subcomponent. More... | |
void | add_link (Component &linked_component) |
boost::shared_ptr< Component > | remove_component (const std::string &name) |
Remove a (sub)component of this component. More... | |
boost::shared_ptr< Component > | remove_component (Component &subcomp) |
Remove a (sub)component of this component. More... | |
void | clear () |
Remove all sub-components of this component, except for the static ones. More... | |
void | move_to (Component &to_parent) |
std::string | tree (bool basic_mode=false, Uint depth=0, Uint recursion_level=0) const |
std::string | info (const std::string &what=std::string("cospt")) const |
size_t | count_children () const |
virtual std::string | derived_type_name () const =0 |
PropertyList & | properties () |
const PropertyList & | properties () const |
OptionList & | options () |
const OptionList & | options () const |
void | reset_options () |
Reset all options to their default value. More... | |
void | configure_option_recursively (const std::string &optname, const boost::any &val) |
Component & | mark_basic () |
marks this component as basic. More... | |
template<typename ComponentT > | |
void | put_components (std::vector< boost::shared_ptr< ComponentT > > &vec, const bool recurse) |
template<typename ComponentT > | |
void | put_components (std::vector< boost::shared_ptr< ComponentT const > > &vec, const bool recurse) const |
template<> | |
void | put_components (std::vector< boost::shared_ptr< Component > > &vec, const bool recurse) |
template<> | |
void | put_components (std::vector< boost::shared_ptr< Component const > > &vec, const bool recurse) const |
Component::iterator | begin () |
The begin iterator for a range containing Components. More... | |
Component::iterator | end () |
The end iterator for a range containing Components. More... | |
Component::const_iterator | begin () const |
The begin iterator for a range containing Components (const version) More... | |
Component::const_iterator | end () const |
The end iterator for a range containing Components (const version) More... | |
Component::iterator | recursive_begin () |
The begin iterator for a recursive range containing Components. More... | |
Component::iterator | recursive_end () |
The end iterator for a recursive range containing Components. More... | |
Component::const_iterator | recursive_begin () const |
The begin iterator for a recursive range containing Components (const version) More... | |
Component::const_iterator | recursive_end () const |
The end iterator for a recursive range containing Components (const version) More... | |
template<typename T > | |
Handle< T > | create_component (const std::string &name, const std::string &builder) |
Create a component using the reduced builder name. More... | |
void | signal_configure (SignalArgs &args) |
configures all the options on this class More... | |
void | signal_create_component (SignalArgs &args) |
creates a component from this component More... | |
void | signal_delete_component (SignalArgs &args) |
delete this component More... | |
void | signal_move_component (SignalArgs &args) |
moves a component from this component to another More... | |
void | signal_list_tree (SignalArgs &args) const |
lists the sub components and puts them on the xml_tree More... | |
void | signal_list_tree_recursive (SignalArgs &args) const |
prints tree recursively More... | |
void | signal_list_properties (SignalArgs &args) const |
lists the properties of this component More... | |
void | signal_list_options (SignalArgs &args) const |
lists the properties of this component More... | |
void | signal_list_options_recursive (SignalArgs &args) const |
prints all options recursive More... | |
void | signal_list_signals (SignalArgs &args) const |
lists the signals of this component More... | |
void | signal_list_signals_recursive (SignalArgs &args) const |
prints all signals recursive More... | |
void | signal_print_info (SignalArgs &args) const |
gets info on this component More... | |
void | signal_print_tree (SignalArgs &args) const |
signal to print the tree More... | |
void | signature_print_tree (SignalArgs &args) const |
signature to signal_print_tree More... | |
void | signal_rename_component (SignalArgs &args) |
renames this component More... | |
void | signal_save_tree (SignalArgs &args) |
dumps the tree to a file More... | |
void | signal_list_content (SignalArgs &args) |
gives information about this component such as options, signals, ... More... | |
void | signal_signature (SignalArgs &args) |
Gives a signal signature, if any. More... | |
void | signature_create_component (SignalArgs &args) |
void | signature_rename_component (SignalArgs &args) |
void | signature_move_component (SignalArgs &args) |
void | signal_store_timings (SignalArgs &args) |
Signal to store the timings (if enabled) into properties, i.e. for readout from python or the GUI. More... | |
void | signal_clear (SignalArgs &args) |
Signal to remove all sub-components. More... | |
void | signal_reset_options (SignalArgs &args) |
Signal to set all options to their default value. More... | |
void | signal_add_tag (SignalArgs &args) |
Signal to add a tag. More... | |
void | signature_add_tag (SignalArgs &args) |
Public Member Functions inherited from SignalHandler | |
~SignalHandler () | |
const storage_t & | signal_list () const |
SignalPtr | signal (const SignalID &sname) |
SignalCPtr | signal (const SignalID &sname) const |
SignalRet | call_signal (const SignalID &sname, SignalArgs &sinput) |
Calls the signal by providing its name and input. More... | |
SignalRet | call_signal (const SignalID &sname, std::vector< std::string > &sinput) |
Calls the signal by providing its name and input. More... | |
bool | signal_exists (const SignalID &sname) const |
Checks if a signal exists or not. More... | |
Signal & | regist_signal (const SignalID &sname) |
Regist signal. More... | |
void | unregist_signal (const SignalID &sname) |
Unregist signal. More... | |
Public Member Functions inherited from ConnectionManager | |
~ConnectionManager () | |
destructor closes all connections More... | |
Connection * | connection (const std::string &name) |
Connection * | manage_connection (const std::string &name) |
manages a connection (creates if necessary) More... | |
Public Member Functions inherited from TaggedObject | |
TaggedObject () | |
Constructor. More... | |
bool | has_tag (const std::string &tag) const |
void | add_tag (const std::string &tag) |
std::vector< std::string > | get_tags () const |
void | remove_tag (const std::string &tag) |
Protected Member Functions | |
void | synchronize_this (const CommWrapper &pobj, std::vector< unsigned char > &sndbuf, std::vector< unsigned char > &rcvbuf) |
Protected Member Functions inherited from Component | |
Component & | add_static_component (const boost::shared_ptr< Component > &subcomp) |
Add a static (sub)component of this component. More... | |
void | raise_tree_updated_event () |
raise event that the path has changed More... | |
Private Attributes | |
Handle< CommWrapper > | m_gid |
explicit shared_ptr to the gid wrapper More... | |
std::vector< bool > | m_isUpdatable |
array holding the updatable info More... | |
std::vector< CPint > | m_sendCount |
this is the process-wise counter of sending communication pattern More... | |
std::vector< CPint > | m_sendMap |
this is the map of sending communication pattern More... | |
std::vector< CPint > | m_recvCount |
this is the process-wise counter of receiveing communication pattern More... | |
std::vector< CPint > | m_recvMap |
this is the map of receiveing communication pattern More... | |
std::vector< int > | m_ranks |
Rank for all the gids in local index space. More... | |
PROPERTIES | |
bool | m_isUpToDate |
flag telling if communication pattern is up-to-date (there are no items ) More... | |
bool | m_isFreeze |
flag telling if pattern are set not to be allowed to change More... | |
BUFFERS HOLDING TEMPORARY DATA, TILL SETUP IS CALLED | |
temp_buffer_array | m_add_buffer |
temp_buffer_array | m_mov_buffer |
temp_buffer_array | m_rem_buffer |
std::vector< Uint > | m_free_lids |
temporary buffer storing the available local ids, which are scattered inside the already existing data More... | |
CONSTRUCTORS, DESTRUCTORS & OTHER BELONGINGS | |
CommPattern (const std::string &name) | |
~CommPattern () | |
destructor More... | |
static std::string | type_name () |
Get the class name. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Component | |
static std::string | type_name () |
Get the class name. More... | |
Public Attributes inherited from SignalHandler | |
storage_t | m_signals |
storage of the signals More... | |
make possible to use compattern on non-registered data
when adding, how to give values to the newly createable elements?
add readonly properties (for example for coordinates, you want to keep it synchronous with commpattern but don't actually want to update it every time)
propagate CPint through mpiwrapper
gid registration: must be more straightforward to check if its really a CFuint single stride data
introduce allocate_component
Definition at line 41 of file CommPattern.hpp.
typedef int CPint |
type of integer to use internally in commpattern, to avoid mess of changing type when mpi allows unsigned ints
Definition at line 49 of file CommPattern.hpp.
typedef std::vector<temp_buffer_item> temp_buffer_array |
typedef for the temporary buffer array
Definition at line 73 of file CommPattern.hpp.
enum dist_struct_flags |
enum for flags in dist_struct
Enumerator | |
---|---|
NOFLAGS | |
GHOST | |
UPDATABLE | |
UNUSED | |
DELETED | |
ALLDELETE |
Definition at line 75 of file CommPattern.hpp.
CommPattern | ( | const std::string & | name | ) |
constructor
name | under this name will the component be registered |
~CommPattern | ( | ) |
destructor
add element to the commpattern when all changes done, all needs to be committed by calling setup if global id is not on current rank, then a ghost is automatically created on current rank if there is no updatable node on rank, an error is thrown
gid | global id |
rank | rank where given global node is to be updatable |
Uint add_local | ( | bool | as_ghost = false | ) |
add element to the commpattern when all changes done, all needs to be committed by calling setup
as_ghost | decision if node to be kept on from_rank as ghost |
|
inline |
removes data by name
Definition at line 189 of file CommPattern.hpp.
|
inline |
accessor to global indexing
Definition at line 278 of file CommPattern.hpp.
|
inline |
register data coming from naked pointer by reference
name | the component will appear under this name |
data | pointer to data |
size | length of the data |
stride | number of array element grouping |
Definition at line 139 of file CommPattern.hpp.
|
inline |
register data coming from pointer to naked pointer
name | the component will appear under this name |
data | pointer to data |
size | length of the data |
stride | number of array element grouping |
Definition at line 150 of file CommPattern.hpp.
|
inline |
register data coming from std::vector by reference
name | the component will appear under this name |
pointer | to std::vector of data |
stride | number of array element grouping |
Definition at line 160 of file CommPattern.hpp.
|
inline |
register data coming from multiarrays by reference
name | the component will appear under this name |
data | Multiarray holding the data (not copied) |
stride | number of array element grouping |
Definition at line 171 of file CommPattern.hpp.
|
inline |
register data coming from pointer to std::vector
name | the component will appear under this name |
pointer | to std::vector of data |
stride | number of array element grouping |
Definition at line 182 of file CommPattern.hpp.
|
inline |
accessor to check if compattern is frozen or not
Definition at line 274 of file CommPattern.hpp.
|
inline |
accessor to the m_isUpdatable vector
Definition at line 282 of file CommPattern.hpp.
|
inline |
accessor to check if setup is needed to call or not
Definition at line 270 of file CommPattern.hpp.
move element along partitions when all changes done, all needs to be committed by calling setup
lid | local id |
rank | rank where the node is expected to be updatable |
keep_as_ghost | decision if node to be kept on from_rank as ghost |
|
inline |
Return the rank associated with the given local ID.
Definition at line 285 of file CommPattern.hpp.
void remove_local | ( | Uint | lid, |
bool | on_all_ranks = false |
||
) |
delete element from the commpattern when all changes done, all needs to be committed by calling setup
lid | local id |
on_all_ranks | force delete on all processes if true. If its false then depends if node is ghost or updatable on rank and deletes only on this rank or all ranks respectively. |
void setup | ( | const Handle< CommWrapper > & | gid, |
std::vector< Uint > & | rank | ||
) |
build and/or modify communication pattern - add nodes this function sets actually up the communication pattern beware: interprocess communication heavy this overload of setup is designed for making no callback functions, so all the registered data should match the size of current size + number of additions
gid | CommWrapper to a Uint tpye of data array |
rank | vector of ranks where given global ids are updatable to add |
void setup | ( | const Handle< CommWrapper > & | gid, |
boost::multi_array< Uint, 1 > & | rank | ||
) |
build and/or modify communication pattern - add nodes this function sets actually up the communication pattern beware: interprocess communication heavy this overload of setup is designed for making no callback functions, so all the registered data should match the size of current size + number of additions
gid | CommWrapper to a Uint tpye of data array |
rank | vector of ranks where given global ids are updatable to add |
void setup | ( | ) |
build and/or modify communication pattern - only incorporate actual buffers this function sets actually up the communication pattern beware: interprocess communication heavy
void synchronize | ( | const std::string & | name | ) |
synchronize the parallel object designated by its name
name | the name of the parallel object |
void synchronize | ( | const CommWrapper & | pobj | ) |
synchronize the parallel object designated by its commwrapper reference
name | the name of the parallel object |
void synchronize_all | ( | ) |
synchronize the all parallel objects
|
protected |
function to synchronize this object useful for reusing in the different synchronize functions
pobj | reference to commwrapper object to synchronize to |
sndbuf | vector for intermediate buffer for send |
rcvbuf | vector for intermediate buffer for recieve |
|
inlinestatic |
Get the class name.
Definition at line 127 of file CommPattern.hpp.
|
private |
temporary buffer of add id is global id
Definition at line 316 of file CommPattern.hpp.
|
private |
temporary buffer storing the available local ids, which are scattered inside the already existing data
Definition at line 327 of file CommPattern.hpp.
|
private |
explicit shared_ptr to the gid wrapper
Definition at line 332 of file CommPattern.hpp.
|
private |
flag telling if pattern are set not to be allowed to change
Definition at line 307 of file CommPattern.hpp.
|
private |
array holding the updatable info
Definition at line 335 of file CommPattern.hpp.
|
private |
flag telling if communication pattern is up-to-date (there are no items )
Definition at line 304 of file CommPattern.hpp.
|
private |
temporary buffer of move id is local id
Definition at line 320 of file CommPattern.hpp.
|
private |
Rank for all the gids in local index space.
Definition at line 350 of file CommPattern.hpp.
|
private |
this is the process-wise counter of receiveing communication pattern
Definition at line 344 of file CommPattern.hpp.
|
private |
this is the map of receiveing communication pattern
Definition at line 347 of file CommPattern.hpp.
|
private |
temporary buffer of remove id is local id
Definition at line 324 of file CommPattern.hpp.
|
private |
this is the process-wise counter of sending communication pattern
Definition at line 338 of file CommPattern.hpp.
|
private |
this is the map of sending communication pattern
Definition at line 341 of file CommPattern.hpp.
Send comments to: COOLFluiD Web Admin |