Changeset 1085


Ignore:
Timestamp:
04/10/17 20:06:52 (5 years ago)
Author:
yushan
Message:

save modif for local compilation

Location:
XIOS/dev/branch_yushan
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/arch/arch-GCC_LINUX.path

    r1053 r1085  
    33NETCDF_LIB=" -lnetcdf" 
    44 
    5 MPI_INCDIR="" 
    6 MPI_LIBDIR="" 
     5MPI_INCDIR="-I /usr/local/include" 
     6MPI_LIBDIR="-L /usr/local/lib" 
    77MPI_LIB="" 
    88 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_fortran.cpp

    r1079 r1085  
    66#include "ep_declaration.hpp" 
    77 
     8#ifdef _openmpi 
     9//#undef MPI_Fint 
     10#endif 
    811 
    912namespace ep_lib 
  • XIOS/dev/branch_yushan/src/buffer_server.cpp

    r885 r1085  
    22#include "exception.hpp" 
    33#include "buffer_server.hpp" 
    4  
    54 
    65namespace xios 
  • XIOS/dev/branch_yushan/src/client.cpp

    r1081 r1085  
    1717    MPI_Comm CClient::intraComm ; 
    1818    MPI_Comm CClient::interComm ; 
    19     std::list<MPI_Comm> CClient::contextInterComms; 
     19    std::list<MPI_Comm> *CClient::contextInterComms_ptr; 
    2020    int CClient::serverLeader ; 
    2121    bool CClient::is_MPI_Initialized ; 
     
    172172      CContext::setCurrent(id) ; 
    173173      CContext* context = CContext::create(id); 
     174 
     175      int tmp_rank; 
     176      MPI_Comm_rank(contextComm,&tmp_rank) ; 
    174177       
    175178      #pragma omp critical (_output) 
    176       printf("Client::registerContext context add = %p\n", &(*context)); 
     179      printf("Client %d : Client::registerContext context add = %p\n", tmp_rank, &(*context)); 
    177180       
    178181       
     
    228231         
    229232 
    230         contextInterComms.push_back(contextInterComm); 
     233        contextInterComms_ptr->push_back(contextInterComm); 
    231234        MPI_Comm_free(&inter); 
    232235      } 
     
    246249        CContext::setCurrent(id); 
    247250 
    248         contextInterComms.push_back(contextInterComm); 
     251        contextInterComms_ptr->push_back(contextInterComm); 
    249252      } 
    250253    } 
     
    266269      } 
    267270 
    268       for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); ++it) 
     271      for (std::list<MPI_Comm>::iterator it = contextInterComms_ptr->begin(); it != contextInterComms_ptr->end(); ++it) 
    269272        MPI_Comm_free(&(*it)); 
    270273       
  • XIOS/dev/branch_yushan/src/client.hpp

    r1081 r1085  
    2121        #pragma omp threadprivate(interComm) 
    2222 
    23         static std::list<MPI_Comm> contextInterComms; 
    24         //std::list<MPI_Comm> contextInterComms; 
     23        //static std::list<MPI_Comm> contextInterComms; 
     24        std::list<MPI_Comm> contextInterComms; 
    2525        static std::list<MPI_Comm> * contextInterComms_ptr; 
    2626        #pragma omp threadprivate(contextInterComms_ptr) 
  • XIOS/dev/branch_yushan/src/cxios.cpp

    r1081 r1085  
    2222  bool CXios::isClient ; 
    2323  bool CXios::isServer ; 
    24   #pragma omp threadprivate(CXios::isServer, CXios::isClient) 
     24  //#pragma omp threadprivate(CXios::isServer, CXios::isClient) 
    2525 
    2626  MPI_Comm CXios::globalComm ; 
    27   #pragma omp threadprivate(CXios::globalComm) 
     27  //#pragma omp threadprivate(CXios::globalComm) 
    2828   
    2929  bool CXios::usingOasis ; 
    3030  bool CXios::usingServer = false; 
    31   #pragma omp threadprivate(CXios::usingOasis, CXios::usingServer) 
     31 // #pragma omp threadprivate(CXios::usingOasis, CXios::usingServer) 
    3232 
    3333  double CXios::bufferSizeFactor = 1.0; 
    3434  const double CXios::defaultBufferSizeFactor = 1.0; 
    3535  StdSize CXios::minBufferSize = 1024 * sizeof(double); 
    36   #pragma omp threadprivate(CXios::bufferSizeFactor, CXios::defaultBufferSizeFactor, CXios::minBufferSize) 
     36  //#pragma omp threadprivate(CXios::bufferSizeFactor, CXios::defaultBufferSizeFactor, CXios::minBufferSize) 
    3737 
    3838  bool CXios::printLogs2Files; 
    3939  bool CXios::isOptPerformance = true; 
    4040  CRegistry* CXios::globalRegistry = 0; 
    41   #pragma omp threadprivate(CXios::printLogs2Files, CXios::isOptPerformance) 
     41  //#pragma omp threadprivate(CXios::printLogs2Files, CXios::isOptPerformance) 
    4242 
    4343 
  • XIOS/dev/branch_yushan/src/io/netcdf.hpp

    r1056 r1085  
    3030namespace xios 
    3131{ 
    32   inline int nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,int *ncidp) 
     32  inline int nc_create_par(const char *path, int cmode, ep_lib::MPI_Comm comm, MPI_Info info,int *ncidp) 
    3333  { 
    3434#if defined(USING_NETCDF_PAR) 
    35     return ::nc_create_par(path, cmode, comm, info, ncidp) ; 
     35    return ::nc_create_par(path, cmode, static_cast<MPI_Comm>(comm.mpi_comm), info, ncidp) ; 
    3636#else 
    3737    ERROR("int nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,int *ncidp)", 
     
    4141  } 
    4242 
    43   inline int nc_open_par(const char *path, int mode, MPI_Comm comm, MPI_Info info,int *ncidp) 
     43  inline int nc_open_par(const char *path, int mode, ep_lib::MPI_Comm comm, MPI_Info info,int *ncidp) 
    4444  { 
    4545#if defined(USING_NETCDF_PAR) 
    46     return ::nc_open_par(path, mode, comm, info, ncidp) ; 
     46    return ::nc_open_par(path, mode, static_cast<MPI_Comm>(comm.mpi_comm), info, ncidp) ; 
    4747#else 
    4848    ERROR("int nc_open_par(const char *path, int mode, MPI_Comm comm, MPI_Info info,int *ncidp)", 
  • XIOS/dev/branch_yushan/src/object_template.hpp

    r1081 r1085  
    9797 
    9898         /// Propriétés statiques /// 
     99         // bkp 
    99100         static xios_map<StdString, 
    100101                xios_map<StdString, 
     
    104105 
    105106         static xios_map< StdString, long int > GenId ; 
    106          //#pragma omp threadprivate(AllMapObj, AllVectObj, GenId) 
     107 
     108         // xios_map<StdString, xios_map<StdString, boost::shared_ptr<DerivedType> > > AllMapObj; 
     109         // xios_map<StdString, std::vector<boost::shared_ptr<DerivedType> > > AllVectObj; 
     110         // xios_map< StdString, long int > GenId ; 
     111 
     112         // static xios_map<StdString, xios_map<StdString, boost::shared_ptr<DerivedType> > > *AllMapObj_ptr; 
     113         // static xios_map<StdString, std::vector<boost::shared_ptr<DerivedType> > > *AllVectObj_ptr; 
     114         // static xios_map< StdString, long int > *GenId_ptr ; 
     115 
     116         // #pragma omp threadprivate(AllMapObj_ptr, AllVectObj_ptr, GenId_ptr) 
     117 
    107118 
    108119   }; // class CObjectTemplate 
  • XIOS/dev/branch_yushan/src/server.cpp

    r1079 r1085  
    99#include <boost/functional/hash.hpp> 
    1010#include <boost/algorithm/string.hpp> 
    11 //#include "mpi.hpp" 
    1211#include "tracer.hpp" 
    1312#include "timer.hpp" 
  • XIOS/dev/branch_yushan/src/test/test_omp.f90

    r1081 r1085  
    8484    print*, "xios init OK", rank, size 
    8585 
    86       CALL xios_context_initialize("test",comm) 
    87       print*, "xios_context init OK", rank, size  
    88  
    89 !      CALL xios_context_finalize() 
    90 !      print*, "xios_context finalize OK", rank, size 
     86    CALL xios_context_initialize("test",comm) 
     87 
     88    print*, "xios_context_initialize OK", rank, size 
     89 
     90    CALL xios_context_finalize() 
     91    print*, "xios_context_finalize OK", rank, size 
     92 
     93     !$omp master 
     94     call MPI_Barrier(comm) 
     95     CALL MPI_COMM_FREE(comm, ierr) 
     96     !$omp end master 
     97 
     98     !$omp barrier 
     99 
     100     print*, "MPI_COMM_FREE OK", rank, size 
    91101 
    92102    CALL xios_finalize() 
     
    94104 
    95105 
    96      
    97     !$omp barrier 
    98     !call MPI_Barrier(MPI_COMM_WORLD) 
    99     !$omp barrier 
    100  
    101     call MPI_Abort() 
    102  
    103      
    104     
    105     CALL xios_get_handle("test",ctx_hdl) 
    106     print*, "xios_get_handle OK", rank, size  
    107     
    108     CALL xios_set_current_context(ctx_hdl) 
    109     print*, "xios_set_current_context OK", rank, size  
    110   
    111     CALL xios_get_calendar_type(calendar_type) 
    112     print*, "xios_get_calendar_type OK", rank, size  
    113      
    114      
    115     CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
    116     CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear') 
    117     CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
    118     CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat) 
    119     CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 
    120  
    121     CALL xios_get_handle("field_definition",fieldgroup_hdl) 
    122     CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
    123     CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
    124  
    125     CALL xios_get_handle("output",file_hdl) 
    126     CALL xios_add_child(file_hdl,field_hdl) 
    127     CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
    128    
    129     dtime%second = 3600 
    130     CALL xios_set_timestep(dtime) 
    131     print*, "xios_set_timestep OK", rank, size  
    132  
    133     CALL xios_get_time_origin(date) 
    134      
    135     PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
    136     PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
    137     CALL xios_date_convert_to_string(date, date_str) 
    138     PRINT *, "time_origin = ", date_str 
    139     PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
    140     PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
    141     PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
    142     PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
    143     PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
    144     dtime%timestep = 1 
    145     dtime = 0.5 * dtime 
    146     CALL xios_duration_convert_to_string(dtime, dtime_str) 
    147     PRINT *, "duration = ", dtime_str 
    148     date = date + 3 * (dtime + dtime) 
    149     CALL xios_date_convert_to_string(date, date_str) 
    150     PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
    151     PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
    152     PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
    153  
    154     ni=0 ; lonvalue(:,:)=0; 
    155     CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 
    156     print *,"ni",ni 
    157  
    158     CALL xios_is_defined_field_attr("field_A",enabled=ok) 
    159     PRINT *,"field_A : attribute enabled is defined ? ",ok 
    160  
    161  
     106  !$omp end parallel 
     107 
     108 
     109   
     110!   CALL xios_context_initialize("test",comm) 
     111 
     112!   CALL xios_get_handle("test",ctx_hdl) 
     113!   CALL xios_set_current_context(ctx_hdl) 
     114   
     115   
     116!   CALL xios_get_calendar_type(calendar_type) 
     117 
     118!   CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
     119!   CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear') 
     120!   CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
     121!   CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat) 
     122!   CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 
     123 
     124!   CALL xios_get_handle("field_definition",fieldgroup_hdl) 
     125!   CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
     126!   CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
     127 
     128!   CALL xios_get_handle("output",file_hdl) 
     129!   CALL xios_add_child(file_hdl,field_hdl) 
     130!   CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
     131   
     132!   dtime%second = 3600 
     133!   CALL xios_set_timestep(dtime) 
     134 
     135!   ! The calendar is created as soon as the calendar type is defined. This way 
     136!   ! calendar operations can be used before the context definition is closed 
     137!   CALL xios_get_time_origin(date) 
     138!   PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
     139!   PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
     140!   CALL xios_date_convert_to_string(date, date_str) 
     141!   PRINT *, "time_origin = ", date_str 
     142!   PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
     143!   PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
     144!   PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
     145!   PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
     146!   PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
     147!   dtime%timestep = 1 
     148!   dtime = 0.5 * dtime 
     149!   CALL xios_duration_convert_to_string(dtime, dtime_str) 
     150!   PRINT *, "duration = ", dtime_str 
     151!   date = date + 3 * (dtime + dtime) 
     152!   CALL xios_date_convert_to_string(date, date_str) 
     153!   PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
     154!   PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
     155!   PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
     156 
     157!   ni=0 ; lonvalue(:,:)=0; 
     158!   CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 
     159!   print *,"ni",ni 
     160!   !print *,"lonvalue",lonvalue; 
     161 
     162!   CALL xios_is_defined_field_attr("field_A",enabled=ok) 
     163!   PRINT *,"field_A : attribute enabled is defined ? ",ok 
     164   
    162165!   CALL xios_close_context_definition() 
    163    
    164 !   print*, "xios_close_context_definition OK", rank, size  
    165  
    166  
    167  
    168   !$omp end parallel 
    169  
    170   call MPI_Abort(ierr) 
    171  
    172    
    173   CALL xios_context_initialize("test",comm) 
    174  
    175   CALL xios_get_handle("test",ctx_hdl) 
    176   CALL xios_set_current_context(ctx_hdl) 
    177    
    178    
    179   CALL xios_get_calendar_type(calendar_type) 
    180  
    181   CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
    182   CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear') 
    183   CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
    184   CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat) 
    185   CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 
    186  
    187   CALL xios_get_handle("field_definition",fieldgroup_hdl) 
    188   CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
    189   CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
    190  
    191   CALL xios_get_handle("output",file_hdl) 
    192   CALL xios_add_child(file_hdl,field_hdl) 
    193   CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
    194    
    195   dtime%second = 3600 
    196   CALL xios_set_timestep(dtime) 
    197  
    198   ! The calendar is created as soon as the calendar type is defined. This way 
    199   ! calendar operations can be used before the context definition is closed 
    200   CALL xios_get_time_origin(date) 
    201   PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
    202   PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
    203   CALL xios_date_convert_to_string(date, date_str) 
    204   PRINT *, "time_origin = ", date_str 
    205   PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
    206   PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
    207   PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
    208   PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
    209   PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
    210   dtime%timestep = 1 
    211   dtime = 0.5 * dtime 
    212   CALL xios_duration_convert_to_string(dtime, dtime_str) 
    213   PRINT *, "duration = ", dtime_str 
    214   date = date + 3 * (dtime + dtime) 
    215   CALL xios_date_convert_to_string(date, date_str) 
    216   PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
    217   PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
    218   PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
    219  
    220   ni=0 ; lonvalue(:,:)=0; 
    221   CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 
    222   print *,"ni",ni 
    223   !print *,"lonvalue",lonvalue; 
    224  
    225   CALL xios_is_defined_field_attr("field_A",enabled=ok) 
    226   PRINT *,"field_A : attribute enabled is defined ? ",ok 
    227    
    228   CALL xios_close_context_definition() 
    229   print*, "xios_close_context_definition OK"   
    230  
    231   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
    232  
    233  
    234   call MPI_Barrier(comm, ierr) 
    235  
    236   !DO ts=1,24*10 
    237   DO ts=1,6 
    238     CALL xios_update_calendar(ts) 
    239     CALL xios_send_field("field_A",field_A) 
    240     CALL wait_us(5000) 
    241   ENDDO 
    242    
    243  
    244   CALL xios_context_finalize() 
    245  
    246   DEALLOCATE(lon, lat, field_A, lonvalue) 
    247  
    248   CALL MPI_COMM_FREE(comm, ierr) 
    249  
    250   CALL xios_finalize() 
    251   print *, "Client : xios_finalize " 
     166!   print*, "xios_close_context_definition OK"   
     167 
     168!   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
     169 
     170 
     171!   call MPI_Barrier(comm, ierr) 
     172 
     173!   !DO ts=1,24*10 
     174!   DO ts=1,6 
     175!     CALL xios_update_calendar(ts) 
     176!     CALL xios_send_field("field_A",field_A) 
     177!     CALL wait_us(5000) 
     178!   ENDDO 
     179   
     180 
     181!   CALL xios_context_finalize() 
     182 
     183!   DEALLOCATE(lon, lat, field_A, lonvalue) 
     184 
    252185 
    253186    else 
Note: See TracChangeset for help on using the changeset viewer.