Changeset 715 for XIOS/trunk/src


Ignore:
Timestamp:
10/05/15 14:43:48 (9 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

Location:
XIOS/trunk/src
Files:
3 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(); 
  • XIOS/trunk/src/node/domain.hpp

    r688 r715  
    164164         void checkArea(void); 
    165165         void checkLonLat(); 
     166         void checkGenerate(); 
    166167 
    167168         void checkTransformations(); 
     
    189190         //! True if and only if the data defined on the domain can be outputted in a compressed way 
    190191         bool isCompressible_; 
     192         bool isRedistributed_; 
    191193         TransMapTypes transformationMap_; 
    192194         std::vector<int> nGlobDomain_; 
  • XIOS/trunk/src/test/test_remap.f90

    r709 r715  
    2020  DOUBLE PRECISION,ALLOCATABLE :: src_boundslon(:,:), dst_boundslon(:,:) 
    2121  DOUBLE PRECISION,ALLOCATABLE :: src_boundslat(:,:), dst_boundslat(:,:) 
    22   DOUBLE PRECISION,ALLOCATABLE :: src_field(:) 
     22  DOUBLE PRECISION,ALLOCATABLE :: src_field(:), tmp_field(:) 
    2323  INTEGER :: src_ni_glo, dst_ni_glo; 
    2424  INTEGER :: src_nvertex, dst_nvertex; 
     
    119119                            bounds_lon_1D=dst_boundslon, bounds_lat_1D=dst_boundslat, nvertex=dst_nvertex) 
    120120 
    121   CALL xios_set_domain_attr("dst_domain_regular", type="rectilinear") 
     121!  CALL xios_set_domain_attr("dst_domain_regular", type="rectilinear") 
    122122 
     123 
     124  ALLOCATE(tmp_field(180*90/2)) 
    123125  dtime%second = 3600 
    124126  CALL xios_set_timestep(dtime) 
     
    127129 
    128130  DO ts=1,1 
     131    CALL xios_recv_field("src_field_regular", tmp_field) 
    129132    CALL xios_update_calendar(ts) 
    130     CALL xios_send_field("src_field",src_field) 
     133!    CALL xios_send_field("src_field",src_field) 
     134    CALL xios_send_field("tmp_field",tmp_field) 
    131135    CALL wait_us(5000) ; 
    132136  ENDDO 
Note: See TracChangeset for help on using the changeset viewer.