Ignore:
Timestamp:
05/12/20 11:52:13 (4 years ago)
Author:
ymipsl
Message:

XIOS coupling branch
Some updates.

First coupling test is beginning to work...

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp

    r1870 r1875  
    5757           EVENT_ID_PROCESS_GRID_ENABLED_FIELDS, 
    5858           EVENT_ID_CONTEXT_FINALIZE_CLIENT, 
     59           EVENT_ID_COUPLER_IN_READY, 
     60           EVENT_ID_COUPLER_IN_CLOSE_DEFINITION, 
     61           EVENT_ID_COUPLER_IN_CONTEXT_FINALIZED, 
    5962         }; 
    6063 
     
    150153         void postProcessing(); 
    151154         void postProcessingGlobalAttributes();          
    152  
     155         void triggerLateFields(void) ; 
    153156         void solveAllRefOfEnabledFieldsAndTransform(void); 
    154157         void checkGridEnabledFields(); 
     
    169172         // Send context close definition 
    170173         void sendCloseDefinition(void); 
     174       public: 
     175         void sendCloseDefinition(CContextClient* client) ; 
     176       private: 
     177         set<CContextClient*> sendCloseDefinition_done_ ; 
     178       public: 
    171179         // There are something to send on closing context defintion 
    172180         void sendUpdateCalendar(int step); 
     
    208216         static void recvFinalizeClient(CEventServer& event) ; 
    209217         void recvFinalizeClient(CBufferIn& buffer); 
    210           
    211          void freeComms(void);                  //!< Free internally allcoated communicators 
    212          void releaseClientBuffers(void);       //! Deallocate buffers allocated by clientContexts 
     218         
     219       public: 
     220         void sendCouplerInReady(CContextClient* client); 
     221       private: 
     222         set<CContextClient*> sendCouplerInReady_done_; 
     223       public: 
     224         static void recvCouplerInReady(CEventServer& event) ; 
     225         void recvCouplerInReady(CBufferIn& buffer) ; //!< coupler is ready to receive grid definition. 
     226         set<CContextClient*> couplerInReady_; 
     227         bool isCouplerInReady(CContextClient* client) { return couplerInReady_.count(client)!=0 ;} 
     228 
     229       public: 
     230        void sendCouplerInCloseDefinition(CContextClient* client) ; 
     231        set<CContextClient*> sendCouplerInCloseDefinition_done_; 
     232        static void recvCouplerInCloseDefinition(CEventServer& event) ; 
     233        void recvCouplerInCloseDefinition(CBufferIn& buffer) ; //!< coupler has finished it defintion, data can be sent      
     234        set<CContextClient*> couplerInCloseDefinition_ ; 
     235        bool isCouplerInCloseDefinition(CContextClient* client) { return couplerInCloseDefinition_.count(client)!=0 ;} 
     236 
     237       public: 
     238        void sendCouplerInContextFinalized(CContextClient* client) ; 
     239        set<CContextClient*> sendCouplerInContextFinalized_done_; 
     240        static void recvCouplerInContextFinalized(CEventServer& event) ; 
     241        void recvCouplerInContextFinalized(CBufferIn& buffer) ; //!< coupler has finished it defintion, data can be sent      
     242        set<CContextClient*> couplerInContextFinalized_ ; 
     243        bool isCouplerInContextFinalized(CContextClient* client) { return couplerInContextFinalized_.count(client)!=0 ;} 
     244 
     245       public:   
     246        void freeComms(void);                  //!< Free internally allcoated communicators 
     247        void releaseClientBuffers(void);       //! Deallocate buffers allocated by clientContexts 
    213248 
    214249         // dispatch event 
     
    281316         // but which are not part of a file 
    282317         std::vector<CField*> fieldsWithReadAccess_; 
     318         std::vector<CField*> couplerInFields_; 
     319         std::vector<CField*> fileInFields_; 
     320 
    283321 
    284322         // Context root 
     
    295333         std::vector<CContextServer*> serverPrimServer; 
    296334         std::vector<CContextClient*> clientPrimServer; 
    297          std::map<std::string, CContextClient*> couplerClient_ ; 
    298          std::map<std::string, CContextServer*> couplerServer_ ; 
    299  
    300  
     335 
     336         // list of slave servers (IO server or others) 
     337         set<CContextClient*> slaveServers_ ; 
     338      private: 
     339         // the map containing context client associated to it string id for coupling out ; 
     340         std::map<std::string, CContextClient*> couplerOutClient_ ; 
     341         // the map containing context server associated to it string id for coupling out ; 
     342         std::map<std::string, CContextServer*> couplerOutServer_ ; 
     343         // the map containing context client associated to it string id for coupling in ; 
     344         std::map<std::string, CContextClient*> couplerInClient_ ; 
     345         // the map containing context server associated to it string id for coupling in ; 
     346         std::map<std::string, CContextServer*> couplerInServer_ ; 
     347      public: 
     348         CContextClient* getCouplerInClient(const string& contextId) { return couplerInClient_[contextId] ;} 
     349         CContextServer* getCouplerInServer(const string& contextId) { return couplerInServer_[contextId] ;} 
     350         CContextClient* getCouplerOutClient(const string& contextId) { return couplerOutClient_[contextId] ;} 
     351         CContextServer* getCouplerOutServer(const string& contextId) { return couplerOutServer_[contextId] ;} 
     352       
     353   
    301354         std::vector<std::string> primServerId_; 
    302355 
Note: See TracChangeset for help on using the changeset viewer.