Ignore:
Timestamp:
05/24/17 16:59:40 (7 years ago)
Author:
yushan
Message:

save modif

Location:
XIOS/dev/branch_yushan_merged/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/io/netCdfInterface.cpp

    r1138 r1146  
    103103int CNetCdfInterface::openPar(const StdString& fileName, int oMode, MPI_Comm comm, MPI_Info info, int& ncId) 
    104104{ 
    105   int status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); 
     105  int status; 
     106  #pragma omp critical (_netcdf) 
     107  status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); 
    106108  if (NC_NOERR != status) 
    107109  { 
     
    347349int CNetCdfInterface::inqDimLen(int ncid, int dimId, StdSize& dimLen) 
    348350{ 
    349   int status = nc_inq_dimlen(ncid, dimId, &dimLen); 
     351  int status; 
     352  #pragma omp critical (_netcdf) 
     353  status = nc_inq_dimlen(ncid, dimId, &dimLen); 
    350354  if (NC_NOERR != status) 
    351355  { 
  • XIOS/dev/branch_yushan_merged/src/io/netCdfInterface_impl.hpp

    r1138 r1146  
    8686  int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, T* data) 
    8787  { 
    88     int status = ncGetVaraType(ncid, varId, start, count, data); 
     88    int status; 
     89    #pragma omp critical (_netcdf) 
     90    status = ncGetVaraType(ncid, varId, start, count, data); 
    8991    if (NC_NOERR != status) 
    9092    { 
  • XIOS/dev/branch_yushan_merged/src/node/context.cpp

    r1134 r1146  
    2121  shared_ptr<CContextGroup> * CContext::root_ptr = 0; 
    2222 
    23    /// ////////////////////// Définitions ////////////////////// /// 
     23   /// ////////////////////// Dfinitions ////////////////////// /// 
    2424 
    2525   CContext::CContext(void) 
     
    184184      if (!this->hasChild()) 
    185185      { 
    186          //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrémentation 
     186         //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrmentation 
    187187      } 
    188188      else 
     
    554554   void CContext::solveAllInheritance(bool apply) 
    555555   { 
    556      // Résolution des héritages descendants (càd des héritages de groupes) 
     556     // Rsolution des hritages descendants (cd des hritages de groupes) 
    557557     // pour chacun des contextes. 
    558558      solveDescInheritance(apply); 
    559559 
    560      // Résolution des héritages par référence au niveau des fichiers. 
     560     // Rsolution des hritages par rfrence au niveau des fichiers. 
    561561      const vector<CFile*> allFiles=CFile::getAll(); 
    562562      const vector<CGrid*> allGrids= CGrid::getAll(); 
     
    582582 
    583583      for (unsigned int i = 0; i < allFiles.size(); i++) 
    584          if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est défini. 
     584         if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dfini. 
    585585         { 
    586             if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
     586            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fix  vrai. 
    587587            { 
    588588              if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 
     
    609609 
    610610      if (enabledFiles.size() == 0) 
    611          DEBUG(<<"Aucun fichier ne va être sorti dans le contexte nommé \"" 
     611         DEBUG(<<"Aucun fichier ne va tre sorti dans le contexte nomm \"" 
    612612               << getId() << "\" !"); 
    613613   } 
     
    849849      prepareTimeseries(); 
    850850 
    851       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers à sortir. 
     851      //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers sortir. 
    852852      this->findEnabledFiles(); 
    853853      this->findEnabledReadModeFiles(); 
  • XIOS/dev/branch_yushan_merged/src/node/file.cpp

    r1138 r1146  
    612612     if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    613613 
     614     //#pragma omp critical (_checkFile) 
    614615     checkFile(); 
    615616 
  • XIOS/dev/branch_yushan_merged/src/server.cpp

    r1141 r1146  
    340340            MPI_Isend(buff,count,MPI_CHAR,i,2,intraComm,&requests[i-1]) ; 
    341341         } 
     342          
    342343         MPI_Waitall(size-1,requests,status) ; 
    343344         registerContext(buff,count,it->second.leaderRank) ; 
  • XIOS/dev/branch_yushan_merged/src/test/test_remap_omp.f90

    r1141 r1146  
    5252  if(rank < size-2) then 
    5353 
    54   !$omp parallel default(private) 
     54  !$omp parallel default(firstprivate)  
    5555 
    5656!!! XIOS Initialization (get the local communicator) 
     
    6060  CALL MPI_COMM_SIZE(comm,size,ierr) 
    6161 
     62   
     63  !$omp critical (open_file) 
    6264  ierr=NF90_OPEN(src_file, NF90_NOWRITE, ncid) 
     65  !$omp end critical (open_file) 
     66 
    6367  ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 
    6468  ierr=NF90_INQUIRE_VARIABLE(ncid, varid,dimids=dimids) 
     
    134138  ENDDO 
    135139 
     140  !$omp critical (open_file) 
    136141  ierr=NF90_OPEN(dst_file, NF90_NOWRITE, ncid) 
     142  !$omp end critical (open_file) 
     143 
     144   
    137145  ierr=NF90_INQ_VARID(ncid,"bounds_lon",varid) 
    138146  ierr=NF90_INQUIRE_VARIABLE(ncid, varid,dimids=dimids) 
     
    168176  CALL xios_get_handle("test",ctx_hdl) 
    169177  CALL xios_set_current_context(ctx_hdl) 
    170  
     178   
    171179  CALL xios_set_domain_attr("src_domain", ni_glo=src_ni_glo, ibegin=src_ibegin, ni=src_ni, type="unstructured") 
    172180  CALL xios_set_domain_attr("src_domain", lonvalue_1D=src_lon, latvalue_1D=src_lat, & 
     
    189197                            bounds_lon_1D=src_boundslon, bounds_lat_1D=src_boundslat, nvertex=src_nvertex) 
    190198 
    191  
    192199  dtime%second = 3600 
    193200   
     
    195202 
    196203  CALL xios_close_context_definition() 
    197   CALL xios_get_domain_attr("src_domain_regular_read", ni=src_tmp_ni, nj=src_tmp_nj) 
    198   ALLOCATE(tmp_field_0(src_tmp_ni*src_tmp_nj)) 
    199  
    200   CALL xios_get_axis_attr("src_axis_curvilinear_read", n=src_tmp_n) 
    201   CALL xios_get_domain_attr("src_domain_curvilinear_read", ni=src_tmp_ni, nj=src_tmp_nj) 
    202   ALLOCATE(tmp_field_1(src_tmp_ni*src_tmp_nj*src_tmp_n)) 
    203  
    204   CALL xios_get_domain_attr("src_domain_unstructured_read", ni=src_tmp_ni, nj=src_tmp_nj) 
    205   ALLOCATE(tmp_field_2(src_tmp_ni*src_tmp_nj)) 
    206    
    207   CALL xios_recv_field("src_field_regular", tmp_field_0) 
    208   CALL xios_recv_field("src_field_curvilinear", tmp_field_1) 
    209   CALL xios_recv_field("src_field_unstructured", tmp_field_2) 
    210  
    211   DO ts=1,10 
    212     CALL xios_update_calendar(ts) 
    213     CALL xios_send_field("src_field_2D",src_field_2D) 
    214      
    215     DO i=1,src_ni 
    216       src_field_2D_clone(i) = src_field_2D(i) 
    217       IF ((23.5 * ts < src_lat(i)) .AND. (src_lat(i) < 65.5 *ts) .AND. (0 < src_lon(i)) .AND. (src_lon(i) < 30*ts)) THEN       
    218         src_field_2D_clone(i) = missing_value     
    219       ENDIF 
    220     ENDDO 
    221  
    222     CALL xios_send_field("src_field_2D_clone",src_field_2D_clone) 
    223     CALL xios_send_field("src_field_3D",src_field_3D) 
    224     CALL xios_send_field("src_field_3D_clone",src_field_3D) 
    225     CALL xios_send_field("src_field_4D",src_field_4D) 
    226     CALL xios_send_field("src_field_3D_pression",src_field_pression) 
    227     CALL xios_send_field("tmp_field_0",tmp_field_0) 
    228     CALL xios_send_field("tmp_field_1",tmp_field_1) 
    229     CALL xios_send_field("tmp_field_2",tmp_field_2) 
    230     CALL wait_us(5000) ; 
    231    ENDDO 
    232  
     204   
    233205  CALL xios_context_finalize() 
    234  
    235   DEALLOCATE(src_lon, src_lat, src_boundslon,src_boundslat, src_field_2D) 
    236   DEALLOCATE(dst_lon, dst_lat, dst_boundslon,dst_boundslat) 
    237   DEALLOCATE(tmp_field_0, tmp_field_1, tmp_field_2) 
    238  
    239    
    240  
     206   
    241207  CALL xios_finalize() 
    242208   
Note: See TracChangeset for help on using the changeset viewer.