Changeset 554


Ignore:
Timestamp:
02/11/15 16:23:16 (6 years ago)
Author:
mhnguyen
Message:

Changing interface of tests to make sure global index begins at zero (0)

+) In all tests, ibegin, jbegin starts at zero (0), so there are some minor changes in field_glo
+) Improve a littel bit class design

Test
+) On Curie,
+) All test passed and results are the same as before

Location:
XIOS/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/inputs/COMPLETE/context_atmosphere.xml

    r549 r554  
    11<!-- Context atm --> 
    2    
     2 
    33<context id="atmopshere"> 
    44 
     
    66    <field id="field_A_atm"  name="field_A_atm" operation="average" freq_op="1ts" domain_ref="domain_atm"  axis_ref="axis_atm" /> 
    77  </field_definition> 
    8    
    9      
     8 
     9 
    1010  <file_definition type="multiple_file" par_access="collective" output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE."> 
    11     <file id="output_atmosphere" name="output_atmosphere">  
     11    <file id="output_atmosphere" name="output_atmosphere"> 
    1212      <field field_ref="field_A_atm" /> 
    1313    </file> 
    14     <file id="output_atmosphere_zoom" name="output_atmosphere_zoom">  
     14    <file id="output_atmosphere_zoom" name="output_atmosphere_zoom"> 
    1515      <field field_ref="field_A_atm" name="field_A_atm_zoom" domain_ref="domain_atm_zoom" /> 
    1616    </file> 
    1717  </file_definition> 
    18     
     18 
    1919   <axis_definition> 
    20      <axis id="axis_atm" zoom_size="2" zoom_end="3" /> 
     20     <axis id="axis_atm" zoom_size="2" zoom_end="2" /> 
    2121   </axis_definition> 
    22      
     22 
    2323   <domain_definition> 
    2424     <domain id="domain_atm" /> 
    2525     <domain id="domain_atm_zoom" /> 
    26    </domain_definition>     
    27    
    28    <grid_definition />     
    29    
     26   </domain_definition> 
     27 
     28   <grid_definition /> 
     29 
    3030</context> 
  • XIOS/trunk/inputs/iodef.xml

    r549 r554  
    11<?xml version="1.0"?> 
    2 <simulation>  
     2<simulation> 
    33 
    44 <context id="test"> 
     
    99     <field id="field_A"  operation="average" freq_op="3600s" domain_ref="domain_A"  axis_ref="axis_A" /> 
    1010   </field_definition> 
    11      
    12      
     11 
     12 
    1313   <file_definition type="multiple_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 
    14      <file id="output" name="output">  
     14     <file id="output" name="output"> 
    1515        <field field_ref="field_A" /> 
    1616     </file> 
    1717   </file_definition> 
    18      
    19      
     18 
     19 
    2020   <axis_definition> 
    21      <axis id="axis_A" zoom_size="2" zoom_end="3" /> 
     21     <axis id="axis_A" zoom_size="2" zoom_end="2" /> 
    2222   </axis_definition> 
    23      
     23 
    2424   <domain_definition> 
    2525     <domain id="domain_A" /> 
    26    </domain_definition>     
    27    
    28    <grid_definition />     
    29    
     26   </domain_definition> 
     27 
     28   <grid_definition /> 
     29 
    3030  </context> 
    31    
     31 
    3232  <context id="toto" > 
    3333  </context> 
    34    
     34 
    3535  <context id="titi"> 
    3636  </context> 
    37    
     37 
    3838  <context id="tata"> 
    3939  </context> 
     
    4343        <variable_group id="buffer"> 
    4444            <variable id="optimal_buffer_size" type="string">performance</variable> 
    45             <variable id="buffer_factor_size" type="double">1.0</variable>  
     45            <variable id="buffer_factor_size" type="double">1.0</variable> 
    4646         </variable_group> 
    4747 
  • XIOS/trunk/src/client_server_mapping.cpp

    r553 r554  
    2020} 
    2121 
     22void CClientServerMapping::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
     23                                                     const std::vector<CArray<size_t,1>* >& globalIndexServer) 
     24{ 
     25  defaultComputeServerIndexMapping(globalIndexOnClient, globalIndexServer); 
     26} 
     27 
    2228/*! 
    2329   Compute index of data which are sent to server and index global on server side 
     
    2531   \param [in] globalIndexServer global index of server(s) 
    2632*/ 
    27 void CClientServerMapping::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
    28                                                      const std::vector<CArray<size_t,1>* >& globalIndexServer) 
     33void CClientServerMapping::defaultComputeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
     34                                                            const std::vector<CArray<size_t,1>* >& globalIndexServer) 
    2935{ 
    3036  int nServer = globalIndexServer.size(); 
  • XIOS/trunk/src/client_server_mapping.hpp

    r553 r554  
    3030    virtual ~CClientServerMapping(); 
    3131 
    32     void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
    33                                    const std::vector<CArray<size_t,1>* >& globalIndexOnServer); 
     32    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
     33                                           const std::vector<CArray<size_t,1>* >& globalIndexOnServer); 
     34 
    3435    std::map<int,int> computeConnectedClients(int nbServer, int nbClient, 
    3536                                              MPI_Comm& clientIntraComm, 
     
    3839    const std::map<int, std::vector<size_t> >& getGlobalIndexOnServer() const; 
    3940    const std::map<int, std::vector<int> >& getLocalIndexSendToServer() const; 
     41 
    4042  protected: 
     43    void defaultComputeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
     44                                          const std::vector<CArray<size_t,1>* >& globalIndexOnServer); 
    4145 
    4246  private: 
  • XIOS/trunk/src/node/distribution_client.hpp

    r553 r554  
    3636    virtual ~CDistributionClient(); 
    3737 
    38     const CArray<int,1>& getLocalDataIndexOnClient() const; 
     38    virtual const CArray<int,1>& getLocalDataIndexOnClient() const; 
    3939    std::vector<int> getNGlob() { return nGlob_; } 
    4040 
  • XIOS/trunk/src/node/distribution_server.hpp

    r553 r554  
    3030    virtual ~CDistributionServer(); 
    3131 
    32     CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex); 
    33     void computeLocalIndex(CArray<size_t,1>& globalIndex); 
     32    virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex); 
     33    virtual void computeLocalIndex(CArray<size_t,1>& globalIndex); 
    3434 
    3535  protected: 
  • XIOS/trunk/src/server_distribution_description.hpp

    r553 r554  
    4242    std::vector<std::vector<int> > getServerDimensionSizes() const; 
    4343    const std::vector<CArray<size_t,1>* >& getGlobalIndex() const; 
     44 
    4445  protected: 
    4546    void computeBandDistribution(int nServer); 
  • XIOS/trunk/src/test/test_client.f90

    r550 r554  
    5252    ENDDO 
    5353  ENDDO 
    54   ni=ni_glo ; ibegin=1 
     54  ni=ni_glo ; ibegin=0 
    5555 
    56   jbegin=1 
     56  jbegin=0 
    5757  DO n=0,size-1 
    5858    nj=nj_glo/size 
     
    6565 
    6666  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj)) 
    67   lon(:,:)=lon_glo(ibegin:iend,jbegin:jend) 
    68   lat(:,:)=lat_glo(ibegin:iend,jbegin:jend) 
    69   field_A(1:ni,1:nj,:)=field_A_glo(ibegin:iend,jbegin:jend,:) 
     67  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     68  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     69  field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
    7070 
    7171  CALL xios_context_initialize("test",comm) 
  • XIOS/trunk/src/test/test_complete.f90

    r549 r554  
    5959    ENDDO 
    6060  ENDDO 
    61   ni=ni_glo ; ibegin=1 
    62  
    63   jbegin=1 
     61  ni=ni_glo ; ibegin=0 
     62 
     63  jbegin=0 
    6464  DO n=0,size_loc-1 
    6565    nj=nj_glo/size_loc 
     
    7272 
    7373  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A_atm(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj)) 
    74   lon(:,:)=lon_glo(ibegin:iend,jbegin:jend) 
    75   lat(:,:)=lat_glo(ibegin:iend,jbegin:jend) 
    76   field_A_atm(1:ni,1:nj,:)=field_A_glo(ibegin:iend,jbegin:jend,:) 
     74  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     75  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     76  field_A_atm(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
    7777 
    7878 
     
    165165      kindex(i)=2*i-1 
    166166    ENDDO 
    167     field_A_srf(1:nb_pt,:)=RESHAPE(field_A_glo(ibegin:iend:2,jbegin:jend,:),(/ nb_pt,llm /)) 
     167    field_A_srf(1:nb_pt,:)=RESHAPE(field_A_glo(ibegin+1:iend+1:2,jbegin+1:jend+1,:),(/ nb_pt,llm /)) 
    168168 
    169169  CALL xios_context_initialize("surface",comm) 
Note: See TracChangeset for help on using the changeset viewer.