Changeset 1544


Ignore:
Timestamp:
06/14/18 13:42:14 (2 years ago)
Author:
yushan
Message:

bug fix for tests in prod mode

Location:
XIOS/dev/branch_openmp
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/bld.cfg

    r1538 r1544  
    4646#bld::target test_unstruct_omp.exe 
    4747#bld::target test_netcdf_omp.exe 
    48 #bld::target test_client.exe  
     48bld::target test_client.exe  
    4949#bld::target test_complete.exe 
    5050#bld::target test_remap.exe 
  • XIOS/dev/branch_openmp/inputs/iodef.xml

    r1468 r1544  
    88   <field_definition level="1" enabled=".FALSE."> 
    99     <field id="field_A"  operation="average" freq_op="3600s" grid_ref="grid_A"/> 
     10     <field id="field_Axis"  operation="average" freq_op="3600s" axis_ref="axis_A"/> 
     11     <field id="field_Domain"  operation="average" freq_op="3600s" domain_ref="domain_A"/> 
    1012     <field id="field_A_zoom"  operation="average" freq_op="3600s" field_ref="field_A" grid_ref="grid_A_zoom"/> 
     13     <field id="field_Scalar"  operation="average" freq_op="3600s" grid_ref="grid_Scalar"/> 
    1114   </field_definition> 
    1215 
    1316 
    14    <file_definition type="one_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 
    15      <file id="output" name="output"> 
    16         <field field_ref="field_A_zoom" name="field_A" /> 
     17   <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" enabled=".TRUE."> 
     18     <file id="output" name="output" enabled=".TRUE."> 
     19        <field field_ref="field_A" name="field_A" /> 
     20        <field field_ref="field_A_zoom" name="field_B" /> 
     21     </file> 
     22     <file id="output1" name="output1" enabled=".TRUE."> 
     23        <field field_ref="field_A" name="field_A" /> 
     24     </file> 
     25     <file id="output2" name="output2" enabled=".TRUE."> 
     26        <field field_ref="field_Scalar" name="field_A" /> 
    1727     </file> 
    1828   </file_definition> 
     
    2232     <axis id="axis_A"/> 
    2333     <axis id="axis_A_zoom" axis_ref="axis_A"> 
    24        <zoom_axis begin="1" n="2" /> 
     34       <!--<zoom_axis begin="1" n="2" /> --> 
     35       <zoom_axis index="(0,1)[0 2]" /> 
    2536     </axis> 
    2637   </axis_definition> 
     
    3950       <axis axis_ref="axis_A_zoom" /> 
    4051     </grid> 
     52     <grid id="grid_Scalar"> 
     53       <scalar id="scalar_A" /> 
     54     </grid> 
    4155   </grid_definition> 
    4256  </context> 
    4357 
    44   <context id="toto" > 
    45   </context> 
    46  
    47   <context id="titi"> 
    48   </context> 
    49  
    50   <context id="tata"> 
    51   </context> 
    5258 
    5359  <context id="xios"> 
    5460      <variable_definition> 
     61        <variable_group id="server" > 
     62          <variable id="using_server2" type="bool">true</variable> 
     63          <variable id="ratio_server2" type="int">50</variable> 
     64        </variable_group> 
     65         
    5566        <variable_group id="buffer"> 
    5667            <variable id="optimal_buffer_size" type="string">performance</variable> 
    57             <variable id="buffer_size_factor" type="double">1.0</variable> 
     68            <variable id="buffer_size_factor" type="double">10.0</variable> 
    5869         </variable_group> 
    5970 
    6071        <variable_group id="parameters" > 
    61           <variable id="using_server2" type="bool">true</variable> 
    62           <variable id="ratio_server2" type="int">50</variable> 
     72          <variable id="using_server" type="bool">false</variable> 
    6373          <variable id="info_level" type="int">50</variable> 
    6474          <variable id="print_file" type="bool">true</variable> 
  • XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp

    r1491 r1544  
    193193*/ 
    194194 
    195     //if (!SuperClassWriter::isRectilinear(fieldId)) 
    196     if (true) 
    197     { 
    198       for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) 
     195    for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) 
    199196        listDimSize.push_front(*dimSizeMap.find(*it)); 
    200     } 
    201     else 
    202     { 
    203        std::list<StdString> coords = SuperClassWriter::getCoordinatesIdList(fieldId); 
    204        std::list<StdString>::const_iterator itCoord = coords.begin(); 
    205        for (; itCoord != coords.end(); itCoord++) 
    206        { 
    207          const StdString& coord = *itCoord; 
    208          if (SuperClassWriter::hasVariable(coord) && !SuperClassWriter::isTemporal(coord)) 
    209          { 
    210            std::map<StdString, StdSize> dimsTmp = SuperClassWriter::getDimensions(&coord); 
    211            StdString dimNameTmp = dimsTmp.begin()->first; 
    212            StdSize dimSizeTmp = dimsTmp.begin()->second; 
    213            listDimSize.push_front(make_pair(coord, dimSizeTmp)); 
    214            dimSizeMap.erase(dimNameTmp); 
    215            dimList.remove(dimNameTmp); 
    216          } 
    217        } 
    218        for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) 
    219         listDimSize.push_front(*dimSizeMap.find(*it)); 
    220     } 
    221197 
    222198    // Now process domain and axis 
  • XIOS/dev/branch_openmp/src/io/netCdfInterface_impl.hpp

    r1334 r1544  
    8686  { 
    8787    int status; 
    88     #pragma omp critical (_netcdf) 
    8988    status = ncGetVaraType(ncid, varId, start, count, data); 
    9089    if (NC_NOERR != status) 
  • XIOS/dev/branch_openmp/src/object_factory.hpp

    r1460 r1544  
    3939         template <typename U> 
    4040            static  const std::vector<boost::shared_ptr<U> > & 
    41                GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId()); 
     41               GetObjectVector(const StdString & context); 
     42               //GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId()); 
    4243 
    4344         /// Tests /// 
  • XIOS/dev/branch_openmp/src/object_template_impl.hpp

    r1460 r1544  
    430430   const vector<T*> CObjectTemplate<T>::getAll() 
    431431   { 
    432      const vector< boost::shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>(); 
     432     int tmp_rank; 
     433     MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank); 
     434     if(tmp_rank==7) printf("getCurrentContextid() = %s\n", CObjectFactory::GetCurrentContextId()); 
     435     const vector< boost::shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>(CObjectFactory::GetCurrentContextId()); 
    433436     vector<T*> vect; 
    434437 
  • XIOS/dev/branch_openmp/src/test/test_client.f90

    r1460 r1544  
    3737 
    3838  CALL init_wait 
     39   
     40  CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 
     41  CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 
     42  if(rank < size-2) then 
    3943 
    4044!!! XIOS Initialization (get the local communicator) 
     
    139143    CALL xios_send_field("field_Domain",field_domain) 
    140144    CALL xios_send_field("field_Scalar",scalar) 
    141     CALL wait_us(5000) ; 
     145    CALL wait_us(5000) 
    142146  ENDDO 
    143147 
    144148  CALL xios_context_finalize() 
     149  CALL xios_finalize() 
    145150 
    146   DEALLOCATE(lon, lat, field_A, lonvalue) 
     151  DEALLOCATE(lon, lat, field_A, lonvalue, axisValue, field_domain) 
    147152 
    148153  CALL MPI_COMM_FREE(comm, ierr) 
    149154 
    150   CALL xios_finalize() 
     155  else  !!server 
     156 
     157    CALL xios_init_server 
     158    print *, "Server : xios_finalize " 
     159   
     160  endif 
     161     
    151162 
    152163  CALL MPI_FINALIZE(ierr) 
  • XIOS/dev/branch_openmp/src/test/test_complete_omp.f90

    r1520 r1544  
    4747  if(rank < size-2) then 
    4848 
    49   !$omp parallel default(private) 
     49  !$omp parallel default(firstprivate)  
     50!!firstprivate(dtime) 
    5051 
    5152!!! XIOS Initialization (get the local communicator) 
     
    248249!#################################################################################### 
    249250 
    250     !DO ts=1,24*2 
    251     DO ts=1,24 
     251    DO ts=1,24*10 
     252    !DO ts=1,24 
    252253 
    253254      CALL xios_get_handle("atmosphere",ctx_hdl) 
  • XIOS/dev/branch_openmp/src/test/test_omp.f90

    r1196 r1544  
    2121  INTEGER,PARAMETER :: nj_glo=100 
    2222  INTEGER,PARAMETER :: llm=5 
    23   DOUBLE PRECISION  :: lval(llm)=1 
     23  DOUBLE PRECISION  :: lval(llm)=1, scalar = 5 
    2424  TYPE(xios_field) :: field_hdl 
    2525  TYPE(xios_fieldgroup) :: fieldgroup_hdl 
     
    2929  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo 
    3030  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm) 
    31   DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:) ; 
     31  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:), axisValue(:), field_domain(:,:) 
    3232  INTEGER :: ni,ibegin,iend,nj,jbegin,jend 
    3333  INTEGER :: i,j,l,ts,n, provided 
     
    6262        lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo 
    6363        DO l=1,llm 
    64           field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l 
     64          field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo*100+10000*l 
    6565        ENDDO 
    6666      ENDDO 
     
    7878    iend=ibegin+ni-1 ; jend=jbegin+nj-1 
    7979 
    80     ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj)) 
     80    !ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj)) 
     81    !lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     82    !lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     83    !field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
     84     
     85    ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj), axisValue(nj_glo), field_domain(0:ni+1,-1:nj+2)) 
    8186    lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
    8287    lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
    8388    field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
     89    field_domain(1:ni,1:nj) = field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1) 
     90    axisValue(1:nj_glo)=field_A_glo(1,1:nj_glo,1); 
     91   
    8492 
    85     !print*, "xios init OK", rank, size 
    8693 
    8794    CALL xios_context_initialize("test",comm) 
    88  
    89     !print*, "xios_context_initialize OK", rank, size 
    90  
    9195    CALL xios_get_handle("test",ctx_hdl) 
    9296    CALL xios_set_current_context(ctx_hdl) 
    9397   
    94    
    9598    CALL xios_get_calendar_type(calendar_type) 
    96     !print*, "xios_get_calendar_type OK", rank, size 
     99    PRINT *, "calendar_type = ", calendar_type 
    97100 
    98101    CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
     
    103106    !print*, "test block OK", rank, size 
    104107 
    105     CALL xios_get_handle("field_definition",fieldgroup_hdl) 
    106     CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
    107     CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
     108    !CALL xios_get_handle("field_definition",fieldgroup_hdl) 
     109    !CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
     110    !CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
    108111 
    109     CALL xios_get_handle("output",file_hdl) 
    110     CALL xios_add_child(file_hdl,field_hdl) 
    111     CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
     112    !CALL xios_get_handle("output",file_hdl) 
     113    !CALL xios_add_child(file_hdl,field_hdl) 
     114    !CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
    112115 
    113116    dtime%second = 3600 
     
    118121   ! calendar operations can be used before the context definition is closed 
    119122   CALL xios_get_time_origin(date) 
    120    !PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
    121    !PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
     123   PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
     124   PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
    122125   CALL xios_date_convert_to_string(date, date_str) 
    123    !PRINT *, "time_origin = ", date_str 
    124    !PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
    125    !PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
    126    !PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
    127    !PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
    128    !PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
     126   PRINT *, "time_origin = ", date_str 
     127   PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
     128   PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
     129   PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
     130   PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
     131   PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
    129132   dtime%timestep = 1 
    130133   dtime = 0.5 * dtime 
    131134   CALL xios_duration_convert_to_string(dtime, dtime_str) 
    132    !PRINT *, "duration = ", dtime_str 
     135   PRINT *, "duration = ", dtime_str 
    133136   date = date + 3 * (dtime + dtime) 
    134137   CALL xios_date_convert_to_string(date, date_str) 
    135    !PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
    136    !PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
    137    !PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
     138   PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
     139   PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
     140   PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
    138141 
    139142   ni=0 ; lonvalue(:,:)=0; 
    140143   CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 
    141    !print *,"ni",ni 
    142    !print *,"lonvalue",lonvalue; 
     144   print *,"ni",ni 
     145   print *,"lonvalue",lonvalue; 
    143146 
    144147   CALL xios_is_defined_field_attr("field_A",enabled=ok) 
    145    !PRINT *,"field_A : attribute enabled is defined ? ",ok  
    146  
     148   PRINT *,"field_A : attribute enabled is defined ? ",ok  
    147149   CALL xios_close_context_definition() 
    148    !print*, "xios_close_context_definition OK"   
    149150 
    150151   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
    151152 
    152    DO ts=1,6 
     153   DO ts=1,4 
    153154    CALL xios_update_calendar(ts) 
    154155    CALL xios_send_field("field_A",field_A) 
     156    CALL xios_send_field("field_Axis",axisValue) 
     157    ! CALL xios_send_field("field_Axis",lval) 
     158    CALL xios_send_field("field_Domain",field_domain) 
     159    CALL xios_send_field("field_Scalar",scalar) 
    155160    CALL wait_us(5000) 
    156161   ENDDO 
     
    162167    print*, "xios finalize OK", rank, size 
    163168 
    164     DEALLOCATE(lon, lat, field_A, lonvalue) 
     169    DEALLOCATE(lon, lat, field_A, lonvalue, axisValue, field_domain) 
    165170    !$omp master  
    166171    !call MPI_Barrier(comm) 
     
    168173    !$omp end master 
    169174 
    170      !$omp barrier 
    171  
    172      !print*, "MPI_COMM_FREE OK", rank, size 
     175    !$omp barrier 
    173176 
    174177 
  • XIOS/dev/branch_openmp/src/test/test_remap_omp.f90

    r1491 r1544  
    272272 
    273273  !$omp end parallel 
     274   
    274275  else 
    275276 
Note: See TracChangeset for help on using the changeset viewer.