Changeset 1460 for XIOS/dev/branch_openmp/src/node/axis.hpp
- Timestamp:
- 03/22/18 10:43:20 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/node/axis.hpp
r1331 r1460 16 16 #include "transformation.hpp" 17 17 #include "transformation_enum.hpp" 18 19 #include "mpi_std.hpp" 18 20 19 21 namespace xios { … … 38 40 , public CAxisAttributes 39 41 { 42 /// typedef /// 43 typedef CObjectTemplate<CAxis> SuperClass; 44 typedef CAxisAttributes SuperClassAttribute; 45 46 public: 40 47 enum EEventId 41 48 { 42 EVENT_ID_SERVER_ATTRIBUT, 43 EVENT_ID_INDEX, 49 EVENT_ID_DISTRIBUTION_ATTRIBUTE, 44 50 EVENT_ID_DISTRIBUTED_VALUE, 45 EVENT_ID_NON_DISTRIBUTED_VALUE 51 EVENT_ID_NON_DISTRIBUTED_VALUE, 52 EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES, 53 EVENT_ID_DISTRIBUTED_ATTRIBUTES 46 54 } ; 47 55 48 /// typedef /// 49 typedef CObjectTemplate<CAxis> SuperClass; 50 typedef CAxisAttributes SuperClassAttribute; 51 52 public : 53 56 public: 54 57 typedef CAxisAttributes RelAttributes; 55 58 typedef CAxisGroup RelGroup; … … 68 71 const std::set<StdString> & getRelFiles(void) const; 69 72 70 const std::vector<int>& getIndexesToWrite(void) const;71 int get NumberWrittenIndexes() const;72 int get TotalNumberWrittenIndexes() const;73 int getOffsetWrittenIndexes() const;73 int getNumberWrittenIndexes(ep_lib::MPI_Comm writtenCom); 74 int getTotalNumberWrittenIndexes(ep_lib::MPI_Comm writtenCom); 75 int getOffsetWrittenIndexes(ep_lib::MPI_Comm writtenCom); 76 CArray<int, 1>& getCompressedIndexToWriteOnServer(ep_lib::MPI_Comm writtenCom); 74 77 75 std::map<int, StdSize> getAttributesBufferSize(); 78 std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 79 CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); 76 80 77 81 /// Test /// … … 93 97 virtual void parse(xml::CXMLNode & node); 94 98 99 void setContextClient(CContextClient* contextClient); 100 95 101 /// Accesseurs statiques /// 96 102 static StdString GetName(void); … … 98 104 static ENodeType GetType(void); 99 105 100 void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid, 101 CServerDistributionDescription::ServerDistributionType distType); 102 static bool dispatchEvent(CEventServer& event); 103 static void recvServerAttribut(CEventServer& event); 104 void recvServerAttribut(CBufferIn& buffer) ; 106 static bool dispatchEvent(CEventServer& event); 107 105 108 void checkAttributesOnClient(); 106 109 void checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, … … 110 113 111 114 void checkEligibilityForCompressedOutput(); 115 size_t getGlobalWrittenSize(void) ; 112 116 117 void computeWrittenIndex(); 118 void computeWrittenCompressedIndex(ep_lib::MPI_Comm); 113 119 bool hasTransformation(); 114 120 void solveInheritanceTransformation(); 115 TransMapTypes getAllTransformations(); 116 void fillInValues(const CArray<double,1>& values); 121 TransMapTypes getAllTransformations(); 117 122 void duplicateTransformation(CAxis*); 118 123 CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id=""); 119 124 bool isEqual(CAxis* axis); 125 bool zoomByIndex(); 120 126 121 public: 122 int zoom_begin_srv, zoom_end_srv, zoom_size_srv; 123 int ni_srv, begin_srv, end_srv; 124 int global_zoom_begin_srv, global_zoom_end_srv, global_zoom_size_srv; 125 CArray<double,1> value_srv; 126 CArray<double,2> bound_srv; 127 CArray<StdString,1> label_srv; 128 CArray<int,1> zoom_index_srv; 129 bool hasValue; 127 public: 128 bool hasValue; 129 CArray<size_t,1> localIndexToWriteOnServer; 130 130 131 131 private: … … 134 134 void checkZoom(); 135 135 void checkBounds(); 136 void checkLabel(); 137 void sendValue(); 138 void computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid, 136 void checkLabel(); 137 void sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 138 CServerDistributionDescription::ServerDistributionType distType); 139 void sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 140 CServerDistributionDescription::ServerDistributionType distType); 141 void computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 139 142 CServerDistributionDescription::ServerDistributionType distType); 140 void sendDistributedValue();141 void sendNonDistributedValue();142 bool zoomByIndex();143 143 144 static void recvIndex(CEventServer& event); 145 static void recvDistributedValue(CEventServer& event); 146 static void recvNonDistributedValue(CEventServer& event); 147 void recvIndex(int rank, CBufferIn& buffer); 148 void recvDistributedValue(int rank, CBufferIn& buffer); 149 void recvNonDistributedValue(int rank, CBufferIn& buffer); 144 void sendNonDistributedAttributes(void); 145 void sendDistributedAttributes(void); 146 147 static void recvNonDistributedAttributes(CEventServer& event); 148 static void recvDistributedAttributes(CEventServer& event); 149 static void recvDistributionAttribute(CEventServer& event); 150 void recvNonDistributedAttributes(int rank, CBufferIn& buffer); 151 void recvDistributedAttributes(vector<int>& rank, vector<CBufferIn*> buffers); 152 void recvDistributionAttribute(CBufferIn& buffer); 150 153 151 154 void setTransformations(const TransMapTypes&); 152 155 153 156 private: 157 158 /** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */ 159 std::list<CContextClient*> clients; 160 std::set<CContextClient*> clientsSet; 161 154 162 bool isChecked; 155 163 bool areClientAttributesChecked_; 156 164 bool isClientAfterTransformationChecked; 157 165 std::set<StdString> relFiles, relFilesCompressed; 158 TransMapTypes transformationMap_; 159 bool isDistributed_; 166 TransMapTypes transformationMap_; 160 167 //! True if and only if the data defined on the axis can be outputted in a compressed way 161 168 bool isCompressible_; 162 std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server 163 std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server 164 std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server 169 std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server 170 std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server 171 // std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server 172 boost::unordered_map<size_t,size_t> globalLocalIndexMap_; 165 173 std::vector<int> indexesToWrite; 166 int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 167 std::vector<int> connectedServerRank_; 168 std::map<int, CArray<int,1> > indiSrv_; 169 bool hasBounds_; 170 bool hasLabel; 174 std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 175 std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer; 176 std::map<int, std::vector<int> > connectedServerRank_; 177 bool hasBounds; 178 bool hasLabel; 179 bool computedWrittenIndex_; 171 180 172 181 private:
Note: See TracChangeset
for help on using the changeset viewer.