Ignore:
Timestamp:
10/05/15 14:43:48 (6 years ago)
Author:
mhnguyen
Message:

Temporary modification of auto-generate domain. This should be changed to a better solution

+) Divide a rectangular domain into parts being equal to number of procs

Test
+) On local with 2 procs, mode server and attached.
+) test_remap passes and result is correct

File:
1 edited

Legend:

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

    r691 r715  
    3535      , isClientAfterTransformationChecked(false), hasLonLat(false) 
    3636      , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() 
    37       , srcObject_(0) 
     37      , srcObject_(0), isRedistributed_(false) 
    3838   { /* Ne rien faire de plus */ } 
    3939 
     
    4545      , isClientAfterTransformationChecked(false), hasLonLat(false) 
    4646      , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() 
    47       , srcObject_(0) 
     47      , srcObject_(0), isRedistributed_(false) 
    4848   { /* Ne rien faire de plus */ } 
    4949 
     
    171171   void CDomain::redistribute(int nbLocalDomain) 
    172172   { 
     173     if (this->isRedistributed_) return; 
    173174     if (type_attr::rectilinear == type) 
    174175     { 
     
    270271        // Now fill other attributes 
    271272        fillInRectilinearLonLat(); 
    272 //        fillInRectilinearBoundLonLat(); 
     273        this->isRedistributed_ = true; 
     274        info <<"now, we are here " << std::endl; 
     275        info << "domain " << this->getId() << " ni " << ni.getValue() << " nj " << nj.getValue() << std::endl; 
    273276     } 
    274277   } 
     
    327330       } 
    328331   } 
     332 
     333   /*! 
     334     Temporary function to verify whether a rectilinear domain is created automatically. 
     335   The domain is distributed into number of parts which are equal to number of clients (intracomm) 
     336   */ 
     337   void CDomain::checkGenerate() 
     338   { 
     339     TransMapTypes trans = this->getAllTransformations(); 
     340     TransMapTypes::const_iterator it = trans.begin(), ite = trans.end(); 
     341     int transOrder = 0; 
     342     for (; it != ite; ++it, ++transOrder) 
     343     { 
     344       ETranformationType transType = it->first; 
     345       if ((TRANS_GENERATE_RECTILINEAR_DOMAIN == transType) && (0 == transOrder)) 
     346       { 
     347         CContext* context = CContext::getCurrent(); 
     348         CContextClient* client = context->client; 
     349         int nbClient; 
     350         MPI_Comm_size(client->intraComm,&nbClient); 
     351         this->redistribute(nbClient); 
     352         break; 
     353       } 
     354     } 
     355   } 
     356 
    329357 
    330358   void CDomain::checkDomain(void) 
     
    942970     CContext* context=CContext::getCurrent(); 
    943971 
     972      this->checkGenerate(); 
    944973      this->checkDomain(); 
    945974      this->checkBounds(); 
Note: See TracChangeset for help on using the changeset viewer.