Changeset 1460 for XIOS/dev/branch_openmp/src/node/context.hpp
- Timestamp:
- 03/22/18 10:43:20 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/node/context.hpp
r1334 r1460 14 14 #include "garbage_collector.hpp" 15 15 #include "registry.hpp" 16 //#include "mpi.hpp" 16 17 17 18 … … 51 52 EVENT_ID_CLOSE_DEFINITION,EVENT_ID_UPDATE_CALENDAR, 52 53 EVENT_ID_CREATE_FILE_HEADER,EVENT_ID_CONTEXT_FINALIZE, 53 EVENT_ID_POST_PROCESS, EVENT_ID_SEND_REGISTRY 54 EVENT_ID_POST_PROCESS, EVENT_ID_SEND_REGISTRY, 55 EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES, 56 EVENT_ID_PROCESS_GRID_ENABLED_FIELDS 54 57 }; 55 58 … … 88 91 public : 89 92 // Initialize server or client 93 void initClient(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtServer = 0); 90 94 void initServer(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtClient = 0); 91 void initClient(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtServer = 0);92 95 bool isInitialized(void); 93 96 94 97 // Put sever or client into loop state 95 bool checkBuffersAndListen( void);98 bool checkBuffersAndListen(bool enableEventsProcessing=true); 96 99 97 100 // Finalize a context 98 101 void finalize(void); 102 bool isFinalized(void); 103 99 104 void closeDefinition(void); 100 105 101 106 // Some functions to process context 102 void findAllEnabledFields(void); 103 void findAllEnabledFieldsInReadModeFiles(void); 107 void findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles); 108 // void findAllEnabledFields(void); 109 // void findAllEnabledFieldsInReadModeFiles(void); 104 110 void readAttributesOfEnabledFieldsInReadModeFiles(); 105 111 void solveAllInheritance(bool apply=true); 106 112 void findEnabledFiles(void); 113 void findEnabledWriteModeFiles(void); 107 114 void findEnabledReadModeFiles(void); 108 115 void closeAllFile(void); 109 116 void updateCalendar(int step); 110 void createFileHeader(void ); 117 void createFileHeader(void); 118 void initReadFiles(void); 111 119 void checkAxisDomainsGridsEligibilityForCompressedOutput(); 112 120 void prepareTimeseries(void); 113 void solveOnlyRefOfEnabledFields(bool sendToServer); 114 void solveAllRefOfEnabledFields(bool sendToServer); 121 void solveOnlyRefOfEnabledFields(bool sendToServer); 115 122 void buildFilterGraphOfEnabledFields(); 123 void postProcessFilterGraph(); 116 124 void startPrefetchingOfEnabledReadModeFiles(); 125 void doPreTimestepOperationsForEnabledReadModeFiles(); 117 126 void doPostTimestepOperationsForEnabledReadModeFiles(); 118 127 void findFieldsWithReadAccess(void); … … 120 129 void buildFilterGraphOfFieldsWithReadAccess(); 121 130 void postProcessing(); 122 123 std::map<int, StdSize> getAttributesBufferSize(std::map<int, StdSize>& maxEventSize); 124 std::map<int, StdSize> getDataBufferSize(std::map<int, StdSize>& maxEventSize); 125 void setClientServerBuffer(); 131 void postProcessingGlobalAttributes(); 132 133 void solveAllRefOfEnabledFieldsAndTransform(bool sendToServer); 134 void checkGridEnabledFields(); 135 void checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles); 136 void sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles); 137 void sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) ; 138 139 std::map<int, StdSize> getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, CContextClient* contextClient, bool bufferForWriting = false); 140 std::map<int, StdSize> getDataBufferSize(std::map<int, StdSize>& maxEventSize, CContextClient* contextClient, bool bufferForWriting = false); 141 void setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting = false); 142 143 // Distribute files (in write mode) among secondary-server pools according to the estimated data flux 144 void distributeFiles(void); 145 void distributeFileOverBandwith() ; 146 void distributeFileOverMemoryBandwith() ; 147 126 148 127 149 // Send context close definition … … 130 152 void sendUpdateCalendar(int step); 131 153 void sendCreateFileHeader(void); 132 void sendEnabledFiles( );133 void sendEnabledFields ();134 void sendRefDomainsAxis ();135 void sendRefGrid( );154 void sendEnabledFiles(const std::vector<CFile*>& activeFiles); 155 void sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles); 156 void sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles); 157 void sendRefGrid(const std::vector<CFile*>& activeFiles); 136 158 void sendPostProcessing(); 137 void sendRegistry(void) ; //!< after be gathered to the root process of the context, merged registry is sent to the root process of the servers 159 void sendPostProcessingGlobalAttributes(); 160 void sendProcessingGridOfEnabledFields(); 161 //!< after be gathered to the root process of the context, merged registry is sent to the root process of the servers 162 void sendRegistry(void) ; 163 138 164 const StdString& getIdServer(); 165 const StdString& getIdServer(const int srvPoolNb); 139 166 140 167 // Client side: Receive and process messages … … 148 175 static void recvPostProcessing(CEventServer& event); 149 176 void recvPostProcessing(CBufferIn& buffer); 177 static void recvProcessingGridOfEnabledFields(CEventServer& event); 178 static void recvPostProcessingGlobalAttributes(CEventServer& event); 179 void recvPostProcessingGlobalAttributes(CBufferIn& buffer); 150 180 static void recvRegistry(CEventServer& event) ; 151 void recvRegistry(CBufferIn& buffer) ; //!< registry is received by the root process of the servers 181 void recvRegistry(CBufferIn& buffer) ; //!< registry is received by the servers 182 183 void freeComms(void); //!< Free internally allcoated communicators 184 void releaseClientBuffers(void); //! Deallocate buffers allocated by clientContexts 152 185 153 186 // dispatch event … … 192 225 virtual bool hasChild(void) const; 193 226 227 194 228 public : 195 229 // Calendar of context … … 200 234 // List of all enabled files in read mode (files on which fields are read) 201 235 std::vector<CFile*> enabledReadModeFiles; 236 // List of all enabled files in write mode 237 std::vector<CFile*> enabledWriteModeFiles; 202 238 203 239 // List of all enabled fields whose instant data is accessible from the public API … … 215 251 bool hasServer; 216 252 217 //Concrete context server218 CContext Server* server;219 220 // Concrete contex client221 CContextClient* client; 222 CRegistry* registryIn ; //!< input registry which is read from file223 CRegistry* registryOut ; //!< output registry which will be wrote onfile at the finalize253 CContextServer* server; //!< Concrete context server 254 CContextClient* client; //!< Concrete contex client 255 std::vector<CContextServer*> serverPrimServer; 256 std::vector<CContextClient*> clientPrimServer; 257 258 CRegistry* registryIn ; //!< input registry which is read from file 259 CRegistry* registryOut ; //!< output registry which will be written into file at the finalize 224 260 225 261 private: 226 262 bool isPostProcessed; 263 bool allProcessed; 227 264 bool finalized; 265 int countChildCtx_; //!< Counter of child contexts (for now it is the number of secondary server pools) 228 266 StdString idServer_; 229 267 CGarbageCollector garbageCollector;
Note: See TracChangeset
for help on using the changeset viewer.