Changeset 715


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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/inputs/REMAP/iodef.xml

    r709 r715  
    88   <field_definition level="1" > 
    99     <field id="src_field"  operation="instant" grid_ref="src_grid"/> 
    10      <field id="dst_field"  operation="instant" field_ref="src_field" grid_ref="dst_grid"/> 
    11      <field id="dst_field_regular"  operation="instant" field_ref="src_field" grid_ref="dst_grid_regular"/> 
     10     <field id="dst_field_regular"  operation="instant" field_ref="tmp_field" grid_ref="dst_grid_regular"/> 
     11     <field id="tmp_field"  operation="instant" grid_ref="src_grid_regular"/> 
    1212   </field_definition> 
    1313 
    1414 
    15    <file_definition type="one_file" par_access="collective" output_freq="1ts" output_level="10" enabled=".TRUE."> 
     15   <file_definition type="multiple_file" par_access="collective" output_freq="1ts" output_level="10" enabled=".TRUE."> 
    1616     <file id="output" name="output"> 
    17         <field field_ref="src_field" name="field" /> 
     17<!--        <field field_ref="src_field" name="field" />--> 
    1818     </file> 
    1919     <file id="output_dst" name="output_dst"> 
    20         <field field_ref="dst_field" name="field" /> 
     20<!--        <field id="test" field_ref="dst_field" name="field" />--> 
    2121     </file> 
    22      <file id="output_dst_regular" name="output_dst_regular"> 
     22     <file id="output_dst_regular" name="output_dst_regular" type="one_file"> 
    2323        <field field_ref="dst_field_regular" name="field" /> 
     24     </file> 
     25 
     26     <file id="output_src_regular" name="output_src_regular" mode="read" type="multiple_file"> 
     27        <field id="src_field_regular" name="field" grid_ref="src_grid_regular" operation="instant"/> 
     28     </file> 
     29     <file id="output_regular" name="output_regular" mode="write"> 
     30<!--        <field field_ref="field_regular" name="field" />--> 
    2431     </file> 
    2532   </file_definition> 
     
    3542       <interpolate_domain/> 
    3643     </domain> 
    37      <domain id="dst_domain_regular" domain_src="src_domain" ni_glo="180" nj_glo="90"> 
     44     <domain id="dst_domain_regular" domain_src="src_domain_regular" ni_glo="90" nj_glo="60" type="rectilinear"> 
    3845       <generate_rectilinear_domain /> 
    3946       <interpolate_domain/> 
     47     </domain> 
     48     <domain id="src_domain_regular" ni_glo="180" nj_glo="90" type="rectilinear"> 
     49       <generate_rectilinear_domain /> 
    4050     </domain> 
    4151   </domain_definition> 
     
    5060     <grid id="src_grid"> 
    5161       <domain domain_ref="src_domain" /> 
     62     </grid> 
     63     <grid id="src_grid_regular"> 
     64       <domain domain_ref="src_domain_regular" /> 
    5265     </grid> 
    5366   </grid_definition> 
  • 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.