Version: 6.3.1
Public Member Functions | Private Attributes

MEDSPLITTER.ParaDomainSelector Class Reference

Communication helper in parallel mode. More...

#include <MEDSPLITTER_ParaDomainSelector.hxx>

Public Member Functions

 ParaDomainSelector (bool mesure_memory=false)
 Constructor. Find out my rank and world size.
 ~ParaDomainSelector ()
 return processor rank
int rank () const
 return number of processors
int nbProcs () const
bool isOnDifferentHosts () const
 Return true if is running on different hosts.
bool isMyDomain (int domainIndex) const
 Return true if the domain with domainIndex is to be loaded on this proc.
int getProccessorID (int domainIndex) const
 Set nb of required domains. (Used to sort joints via jointId())
void setNbDomains (int nb)
int jointId (int local_domain, int distant_domain) const
 Return identifier for a joint.
int gatherNbOf (MED_EN::medEntityMesh entity, const std::vector< MEDMEM::MESH * > &domain_meshes)
 Gather info on nb of entities on each processor and return total nb.
intgetNbVertOfProcs () const
int getProcShift () const
 Return nb of cells on processors with lower rank.
int getDomainShift (int domainIndex) const
 Return nb of cells in domains with lower index.
std::auto_ptr< GraphgatherGraph (const Graph *graph) const
 Gather graphs from all processors into one.
void gatherEntityTypesInfo (std::vector< MEDMEM::MESH * > &domain_meshes, MED_EN::medEntityMesh entity)
 Sets global numbering for the entity.
void setNbCellPairs (int nb_cell_pairs, int dist_domain, int loc_domain)
 Set nb of cell/cell pairs in a joint between domains.
void gatherNbCellPairs ()
 Gather size of each joint.
int getNbCellPairs (int dist_domain, int loc_domain) const
 Return nb of cell/cell pairs in a joint between domains on different procs.
void exchangeJoint (JointExchangeData *joint) const
 Send-receive joint data.
int getFisrtGlobalIdOfSubentity (int loc_domain, int dist_domain) const
 Return the first global id of sub-entity for the joint.
intexchangeSubentityIds (int loc_domain, int dist_domain, const std::vector< int > &loc_ids_here) const
 Send-receive local ids of joint faces.
double getPassedTime () const
 Return domain order so that first go domains on proc 0 and so n.
int evaluateMemory () const
 Evaluate current memory usage and return the maximal one in KB.

Private Attributes

int _rank
int _world_size
int _nb_result_domains
std::vector< int_nb_cell_pairs_by_joint
std::vector< int_nb_vert_of_procs
std::vector< int_cell_shift_by_domain
std::vector< int_face_shift_by_domain
double _init_time
bool _mesure_memory
int _init_memory
int _max_memory

Detailed Description

Communication helper in parallel mode.


Constructor & Destructor Documentation

ParaDomainSelector::ParaDomainSelector ( bool  mesure_memory = false)
ParaDomainSelector::~ParaDomainSelector ( )

return processor rank

Destructor.


Member Function Documentation

int MEDSPLITTER.ParaDomainSelector.rank ( ) const

return number of processors

int MEDSPLITTER.ParaDomainSelector.nbProcs ( ) const
bool ParaDomainSelector::isOnDifferentHosts ( ) const
bool ParaDomainSelector::isMyDomain ( int  domainIndex) const

Return true if the domain with domainIndex is to be loaded on this proc.

Parameters:
domainIndex- index of mesh domain
Return values:
bool- to load or not

References MEDSPLITTER.ParaDomainSelector._rank, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), and MEDSPLITTER.ParaDomainSelector.getProccessorID().

int ParaDomainSelector::getProccessorID ( int  domainIndex) const

Set nb of required domains. (Used to sort joints via jointId())

Return processor id where the domain with domainIndex resides.

Parameters:
domainIndex- index of mesh domain
Return values:
int- processor id

References MEDSPLITTER.ParaDomainSelector._world_size, and MEDSPLITTER.ParaDomainSelector.evaluateMemory().

void MEDSPLITTER.ParaDomainSelector.setNbDomains ( int  nb)
int ParaDomainSelector::jointId ( int  local_domain,
int  distant_domain 
) const
int ParaDomainSelector::gatherNbOf ( MED_EN::medEntityMesh  entity,
const std::vector< MEDMEM::MESH * > &  domain_meshes 
)

Gather info on nb of entities on each processor and return total nb.

Is called 1) for MED_CELL to know global id shift for domains at graph construction; 2) for sub-entity to know total nb of sub-entities before creating those of joints

References MEDSPLITTER.ParaDomainSelector._cell_shift_by_domain, MEDSPLITTER.ParaDomainSelector._face_shift_by_domain, MEDSPLITTER.ParaDomainSelector._nb_vert_of_procs, MEDSPLITTER.ParaDomainSelector._world_size, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MEDSPLITTER.ParaDomainSelector.getProccessorID(), MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MEDSPLITTER.ParaDomainSelector.nbProcs(), and MEDSPLITTER.ParaDomainSelector.rank().

int * ParaDomainSelector::getNbVertOfProcs ( ) const
int ParaDomainSelector::getProcShift ( ) const

Return nb of cells on processors with lower rank.

gatherNbOf( MED_CELL ) must be called before. Result added to global id on this processor gives id in the whole distributed mesh

References MEDSPLITTER.ParaDomainSelector._nb_vert_of_procs, MEDSPLITTER.ParaDomainSelector._rank, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), and gatherNbOf_NOT_CALLED.

int ParaDomainSelector::getDomainShift ( int  domainIndex) const

Return nb of cells in domains with lower index.

gatherNbOf( MED_CELL ) must be called before. Result added to local id on given domain gives id in the whole distributed mesh

References MEDSPLITTER.ParaDomainSelector._cell_shift_by_domain, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), and gatherNbOf_NOT_CALLED.

auto_ptr< Graph > ParaDomainSelector::gatherGraph ( const Graph graph) const
void ParaDomainSelector::gatherEntityTypesInfo ( std::vector< MEDMEM::MESH * > &  domain_meshes,
MED_EN::medEntityMesh  entity 
)
void ParaDomainSelector::setNbCellPairs ( int  nb_cell_pairs,
int  dist_domain,
int  loc_domain 
)
void ParaDomainSelector::gatherNbCellPairs ( )
int ParaDomainSelector::getNbCellPairs ( int  dist_domain,
int  loc_domain 
) const

Return nb of cell/cell pairs in a joint between domains on different procs.

References MEDSPLITTER.ParaDomainSelector._nb_cell_pairs_by_joint, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), and MEDSPLITTER.ParaDomainSelector.jointId().

void ParaDomainSelector::exchangeJoint ( JointExchangeData joint) const
int ParaDomainSelector::getFisrtGlobalIdOfSubentity ( int  loc_domain,
int  dist_domain 
) const
int * ParaDomainSelector::exchangeSubentityIds ( int  loc_domain,
int  dist_domain,
const std::vector< int > &  loc_ids_here 
) const
double ParaDomainSelector::getPassedTime ( ) const

Return domain order so that first go domains on proc 0 and so n.

Return time passed from construction in seconds

References MEDSPLITTER.ParaDomainSelector._init_time.

int ParaDomainSelector::evaluateMemory ( ) const

Field Documentation

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS