Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __MEDSPLITTER_ParaDomainSelector_HXX__
00025 #define __MEDSPLITTER_ParaDomainSelector_HXX__
00026
00027 #include "MEDSPLITTER.hxx"
00028
00029 #include <MEDMEM_define.hxx>
00030
00031 #include <memory>
00032 #include <vector>
00033
00034 namespace MEDMEM
00035 {
00036 class MESH;
00037 }
00038
00039 namespace MEDSPLITTER
00040 {
00041 class Graph;
00042 class JointExchangeData;
00043
00047 class MEDSPLITTER_EXPORT ParaDomainSelector
00048 {
00049 public:
00050
00051 ParaDomainSelector(bool mesure_memory=false);
00052 ~ParaDomainSelector();
00053
00055 int rank() const { return _rank; }
00056
00058 int nbProcs() const { return _world_size; }
00059
00060
00061 bool isOnDifferentHosts() const;
00062
00063
00064 bool isMyDomain(int domainIndex) const;
00065
00066
00067 int getProccessorID(int domainIndex) const;
00068
00069
00071 void setNbDomains(int nb) { _nb_result_domains = nb; }
00072
00073
00074 int jointId( int local_domain, int distant_domain ) const;
00075
00076
00077
00078
00079
00080
00081 int gatherNbOf(MED_EN::medEntityMesh entity, const std::vector<MEDMEM::MESH*>& domain_meshes);
00082
00083
00084 int* getNbVertOfProcs() const;
00085
00086
00087 int getProcShift() const;
00088
00089
00090 int getDomainShift(int domainIndex) const;
00091
00092
00093
00094
00095
00096 std::auto_ptr<Graph> gatherGraph(const Graph* graph) const;
00097
00098
00099 void gatherEntityTypesInfo(std::vector<MEDMEM::MESH*>& domain_meshes,
00100 MED_EN::medEntityMesh entity);
00101
00102
00103 void setNbCellPairs( int nb_cell_pairs, int dist_domain, int loc_domain );
00104
00105
00106 void gatherNbCellPairs();
00107
00108
00109 int getNbCellPairs( int dist_domain, int loc_domain ) const;
00110
00111
00112 void exchangeJoint( JointExchangeData* joint ) const;
00113
00114
00115 int getFisrtGlobalIdOfSubentity( int loc_domain, int dist_domain ) const;
00116
00117
00118 int* exchangeSubentityIds( int loc_domain, int dist_domain,
00119 const std::vector<int>& loc_ids_here ) const;
00120
00121
00122 double getPassedTime() const;
00123
00124
00125 int evaluateMemory() const;
00126
00127 private:
00128
00129 int _rank, _world_size;
00130
00131 int _nb_result_domains;
00132
00133
00134
00135 std::vector< int > _nb_cell_pairs_by_joint;
00136
00137 std::vector< int > _nb_vert_of_procs;
00138 std::vector< int > _cell_shift_by_domain;
00139 std::vector< int > _face_shift_by_domain;
00140
00141 double _init_time;
00142 bool _mesure_memory;
00143 int _init_memory, _max_memory;
00144 };
00145
00146 }
00147
00148 #endif