Ignore:
Timestamp:
03/10/15 10:49:13 (9 years ago)
Author:
mhnguyen
Message:

Correct some bugs on discovering server index and do some code cleanings

+) Add some checking functions to make sure mpi_isend and mpi_irecv work correctly
+) Add comments to code
+) Remove some redundant code and comments

Test
+) On Curie
+) The new functions are tested in test_new_features.f90. Test_client and test_complete work like before
+) Test cases:

  • 3 dimension grid with: 1 domain, 1 axis
  • 3 dimension grid with: 3 axis
  • Attached and connected

+) All pass and results are correct

TODO:
+) Fix zoom bug with grid composed of only one axis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/context.cpp

    r567 r569  
    330330 
    331331      // At last, we have all info of domain and axis, then send them 
    332 //       sendRefDomainsAxis(); 
     332       sendRefDomainsAxis(); 
    333333 
    334334      // After that, send all grid (if any) 
     
    799799 
    800800   //! Client side: Send information of reference domain and axis of active fields 
    801 //   void CContext::sendRefDomainsAxis() 
    802 //   { 
    803 //     std::set<StdString> domainIds; 
    804 //     std::set<StdString> axisIds; 
    805 // 
    806 //     // Find all reference domain and axis of all active fields 
    807 //     int numEnabledFiles = this->enabledFiles.size(); 
    808 //     for (int i = 0; i < numEnabledFiles; ++i) 
    809 //     { 
    810 //       std::vector<CField*> enabledFields = this->enabledFiles[i]->getEnabledFields(); 
    811 //       int numEnabledFields = enabledFields.size(); 
    812 //       for (int j = 0; j < numEnabledFields; ++j) 
    813 //       { 
    814 //         const std::pair<StdString, StdString>& prDomAxisId = enabledFields[j]->getDomainAxisIds(); 
    815 //         domainIds.insert(prDomAxisId.first); 
    816 //         axisIds.insert(prDomAxisId.second); 
    817 //       } 
    818 //     } 
    819 // 
    820 //     // Create all reference axis on server side 
    821 //     std::set<StdString>::iterator itDom, itAxis; 
    822 //     std::set<StdString>::const_iterator itE; 
    823 // 
    824 //     StdString axiDefRoot("axis_definition"); 
    825 //     CAxisGroup* axisPtr = CAxisGroup::get(axiDefRoot); 
    826 //     itE = axisIds.end(); 
    827 //     for (itAxis = axisIds.begin(); itAxis != itE; ++itAxis) 
    828 //     { 
    829 //       if (!itAxis->empty()) 
    830 //       { 
    831 //         axisPtr->sendCreateChild(*itAxis); 
    832 //         CAxis::get(*itAxis)->sendAllAttributesToServer(); 
    833 //       } 
    834 //     } 
    835 // 
    836 //     // Create all reference domains on server side 
    837 //     StdString domDefRoot("domain_definition"); 
    838 //     CDomainGroup* domPtr = CDomainGroup::get(domDefRoot); 
    839 //     itE = domainIds.end(); 
    840 //     for (itDom = domainIds.begin(); itDom != itE; ++itDom) 
    841 //     { 
    842 //       if (!itDom->empty()) { 
    843 //          domPtr->sendCreateChild(*itDom); 
    844 //          CDomain::get(*itDom)->sendAllAttributesToServer(); 
    845 //       } 
    846 //     } 
    847 //   } 
     801   void CContext::sendRefDomainsAxis() 
     802   { 
     803     std::set<StdString> domainIds; 
     804     std::set<StdString> axisIds; 
     805 
     806     // Find all reference domain and axis of all active fields 
     807     int numEnabledFiles = this->enabledFiles.size(); 
     808     for (int i = 0; i < numEnabledFiles; ++i) 
     809     { 
     810       std::vector<CField*> enabledFields = this->enabledFiles[i]->getEnabledFields(); 
     811       int numEnabledFields = enabledFields.size(); 
     812       for (int j = 0; j < numEnabledFields; ++j) 
     813       { 
     814         const std::pair<StdString, StdString>& prDomAxisId = enabledFields[j]->getRefDomainAxisIds(); 
     815         domainIds.insert(prDomAxisId.first); 
     816         axisIds.insert(prDomAxisId.second); 
     817       } 
     818     } 
     819 
     820     // Create all reference axis on server side 
     821     std::set<StdString>::iterator itDom, itAxis; 
     822     std::set<StdString>::const_iterator itE; 
     823 
     824     StdString axiDefRoot("axis_definition"); 
     825     CAxisGroup* axisPtr = CAxisGroup::get(axiDefRoot); 
     826     itE = axisIds.end(); 
     827     for (itAxis = axisIds.begin(); itAxis != itE; ++itAxis) 
     828     { 
     829       if (!itAxis->empty()) 
     830       { 
     831         axisPtr->sendCreateChild(*itAxis); 
     832         CAxis::get(*itAxis)->sendAllAttributesToServer(); 
     833       } 
     834     } 
     835 
     836     // Create all reference domains on server side 
     837     StdString domDefRoot("domain_definition"); 
     838     CDomainGroup* domPtr = CDomainGroup::get(domDefRoot); 
     839     itE = domainIds.end(); 
     840     for (itDom = domainIds.begin(); itDom != itE; ++itDom) 
     841     { 
     842       if (!itDom->empty()) { 
     843          domPtr->sendCreateChild(*itDom); 
     844          CDomain::get(*itDom)->sendAllAttributesToServer(); 
     845       } 
     846     } 
     847   } 
    848848 
    849849   //! Update calendar in each time step 
Note: See TracChangeset for help on using the changeset viewer.