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. | |
| int * | getNbVertOfProcs () 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< Graph > | gatherGraph (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. | |
| int * | exchangeSubentityIds (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 |
Communication helper in parallel mode.
| ParaDomainSelector::ParaDomainSelector | ( | bool | mesure_memory = false | ) |
Constructor. Find out my rank and world size.
References MEDSPLITTER.ParaDomainSelector._init_time, MEDSPLITTER.ParaDomainSelector._rank, MEDSPLITTER.ParaDomainSelector._world_size, and MEDSPLITTER.ParaDomainSelector.evaluateMemory().
| ParaDomainSelector::~ParaDomainSelector | ( | ) |
return processor rank
Destructor.
| int MEDSPLITTER.ParaDomainSelector.rank | ( | ) | const |
return number of processors
| int MEDSPLITTER.ParaDomainSelector.nbProcs | ( | ) | const |
| bool ParaDomainSelector::isOnDifferentHosts | ( | ) | const |
Return true if is running on different hosts.
References MEDSPLITTER.ParaDomainSelector._world_size, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MEDSPLITTER.ParaDomainSelector.nbProcs(), MEDSPLITTER.ParaDomainSelector.rank(), test_NonCoincidentDEC.size, and testMedMemCxxTests.status.
| bool ParaDomainSelector::isMyDomain | ( | int | domainIndex | ) | const |
Return true if the domain with domainIndex is to be loaded on this proc.
| domainIndex | - index of mesh domain |
| bool | - to load or not |
References MEDSPLITTER.ParaDomainSelector._rank, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), and MEDSPLITTER.ParaDomainSelector.getProccessorID().
Set nb of required domains. (Used to sort joints via jointId())
Return processor id where the domain with domainIndex resides.
| domainIndex | - index of mesh domain |
| int | - processor id |
References MEDSPLITTER.ParaDomainSelector._world_size, and MEDSPLITTER.ParaDomainSelector.evaluateMemory().
| void MEDSPLITTER.ParaDomainSelector.setNbDomains | ( | int | nb | ) |
Return identifier for a joint.
References MEDSPLITTER.ParaDomainSelector._nb_result_domains, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MED_EXCEPTION, and INTERP_KERNEL.swap().
| 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.
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.
Gather graphs from all processors into one.
References MEDSPLITTER.ParaDomainSelector._cell_shift_by_domain, MEDSPLITTER.ParaDomainSelector._nb_vert_of_procs, MEDSPLITTER.ParaDomainSelector._rank, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MEDSPLITTER.Graph.getGraph(), MEDMEM.MEDSKYLINEARRAY.getIndex(), MEDSPLITTER.Graph.getPart(), MEDMEM.MEDSKYLINEARRAY.getValue(), medClient_test.index, MEDSPLITTER.ParaDomainSelector.nbProcs(), and batchmode_medcorba_test.value.
| void ParaDomainSelector::gatherEntityTypesInfo | ( | std::vector< MEDMEM::MESH * > & | domain_meshes, |
| MED_EN::medEntityMesh | entity | ||
| ) |
Sets global numbering for the entity.
This method must be once called for MED_CELL before exchangeJoint() calls
References med_opsupp_test.entity, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MEDMEM.MESH.getMeshDimension(), MEDSPLITTER.ParaDomainSelector.isMyDomain(), medutilities.mesh_dim, MED_EN.meshEntities, MEDMEM.MESHING.setCoordinates(), MEDMEM.MESHING.setNumberOfElements(), MEDMEM.MESHING.setNumberOfTypes(), MEDMEM.MESHING.setTypes(), medClient_test.type, and medClient_test.types.
Set nb of cell/cell pairs in a joint between domains.
References MEDSPLITTER.ParaDomainSelector._nb_cell_pairs_by_joint, MEDSPLITTER.ParaDomainSelector._nb_result_domains, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MEDSPLITTER.ParaDomainSelector.isMyDomain(), and MEDSPLITTER.ParaDomainSelector.jointId().
| void ParaDomainSelector::gatherNbCellPairs | ( | ) |
Gather size of each joint.
References MEDSPLITTER.ParaDomainSelector._nb_cell_pairs_by_joint, MEDSPLITTER.ParaDomainSelector._nb_result_domains, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), and MED_EXCEPTION.
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 |
Send-receive joint data.
References MEDSPLITTER.JointExchangeData.deserialize(), MEDSPLITTER.JointExchangeData.distantDomain(), MEDSPLITTER.ParaDomainSelector.getProccessorID(), MEDSPLITTER.ParaDomainSelector.jointId(), MEDSPLITTER.JointExchangeData.localDomain(), MEDSPLITTER.JointExchangeData.serialize(), and testMedMemCxxTests.status.
Return the first global id of sub-entity for the joint.
References MEDSPLITTER.ParaDomainSelector._face_shift_by_domain, MEDSPLITTER.ParaDomainSelector._nb_cell_pairs_by_joint, MEDSPLITTER.ParaDomainSelector.evaluateMemory(), testRenumbering.id, MEDSPLITTER.ParaDomainSelector.jointId(), and MED_EXCEPTION.
| int * ParaDomainSelector::exchangeSubentityIds | ( | int | loc_domain, |
| int | dist_domain, | ||
| const std::vector< int > & | loc_ids_here | ||
| ) | const |
Send-receive local ids of joint faces.
References MEDSPLITTER.ParaDomainSelector.evaluateMemory(), MEDSPLITTER.ParaDomainSelector.getProccessorID(), MEDSPLITTER.ParaDomainSelector.jointId(), and testMedMemCxxTests.status.
| 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 |
Evaluate current memory usage and return the maximal one in KB.
References MEDSPLITTER.ParaDomainSelector._init_memory, MEDSPLITTER.ParaDomainSelector._max_memory, and MEDSPLITTER.ParaDomainSelector._mesure_memory.
int MEDSPLITTER.ParaDomainSelector._rank [private] |
std::vector< int > MEDSPLITTER.ParaDomainSelector._nb_cell_pairs_by_joint [private] |
std::vector< int > MEDSPLITTER.ParaDomainSelector._nb_vert_of_procs [private] |
std::vector< int > MEDSPLITTER.ParaDomainSelector._cell_shift_by_domain [private] |
std::vector< int > MEDSPLITTER.ParaDomainSelector._face_shift_by_domain [private] |
bool MEDSPLITTER.ParaDomainSelector._mesure_memory [private] |