Changeset 1094


Ignore:
Timestamp:
04/13/17 14:24:08 (5 years ago)
Author:
yushan
Message:

modif for Curie, CurrContext?->CurrContext_ptr in object_factory and group_factory

Location:
XIOS/dev/branch_yushan/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/src/buffer_client.cpp

    r1070 r1094  
    2626    buffer[1] = new char[bufferSize]; 
    2727    retBuffer = new CBufferOut(buffer[current], bufferSize); 
    28     info(10) << "CClientBuffer: allocated 2 x " << bufferSize << " bytes for server " << serverRank << " with a maximum of " << maxBufferedEvents << " buffered events" << endl; 
     28    //info(10) << "CClientBuffer: allocated 2 x " << bufferSize << " bytes for server " << serverRank << " with a maximum of " << maxBufferedEvents << " buffered events" << endl; 
    2929  } 
    3030 
  • XIOS/dev/branch_yushan/src/client.cpp

    r1087 r1094  
    214214        MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 
    215215         
    216         #pragma omp critical (_output) 
    217         info(10)<<"Register new Context : "<<id<<endl ; 
     216        //#pragma omp critical (_output) 
     217        //info(10)<<"Register new Context : "<<id<<endl ; 
    218218                       
    219219 
  • XIOS/dev/branch_yushan/src/context_client.cpp

    r1081 r1094  
    324324     for (itMap = itbMap; itMap != iteMap; ++itMap) 
    325325     { 
    326        report(10) << " Memory report : Context <" << context->getId() << "> : client side : memory used for buffer of each connection to server" << endl 
    327                   << "  +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl; 
     326       //report(10) << " Memory report : Context <" << context->getId() << "> : client side : memory used for buffer of each connection to server" << endl 
     327       //           << "  +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl; 
    328328       totalBuf += itMap->second; 
    329329     } 
    330      report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl; 
     330     //report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl; 
    331331 
    332332     releaseBuffers(); 
  • XIOS/dev/branch_yushan/src/context_server.cpp

    r1070 r1094  
    221221    { 
    222222      finished=true; 
    223       info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl; 
     223      //info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl; 
    224224      std::map<int, StdSize>::const_iterator itbMap = mapBufferSize_.begin(), 
    225225                                             iteMap = mapBufferSize_.end(), itMap; 
     
    227227      for (itMap = itbMap; itMap != iteMap; ++itMap) 
    228228      { 
    229         report(10)<< " Memory report : Context <"<<context->getId()<<"> : server side : memory used for buffer of each connection to client" << endl 
    230                   << "  +) With client of rank " << itMap->first << " : " << itMap->second << " bytes " << endl; 
     229        //report(10)<< " Memory report : Context <"<<context->getId()<<"> : server side : memory used for buffer of each connection to client" << endl 
     230        //          << "  +) With client of rank " << itMap->first << " : " << itMap->second << " bytes " << endl; 
    231231        totalBuf += itMap->second; 
    232232      } 
    233233      context->finalize(); 
    234       report(0)<< " Memory report : Context <"<<context->getId()<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 
     234      //report(0)<< " Memory report : Context <"<<context->getId()<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 
    235235    } 
    236236    else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); 
  • XIOS/dev/branch_yushan/src/group_factory.cpp

    r1089 r1094  
    44{ 
    55   /// ////////////////////// Définitions ////////////////////// /// 
    6    StdString CGroupFactory::CurrContext(""); 
     6   StdString *CGroupFactory::CurrContext_ptr = new StdString; 
    77   StdString *CGroupFactory::CurrContext_ptr = new StdString; 
    88 
    99   void CGroupFactory::SetCurrentContextId(const StdString & context) 
    10    {  
    11       //CGroupFactory::CurrContext = context; 
    12       *CGroupFactory::CurrContext_ptr = context; 
     10   {   
     11      if(CGroupFactory::CurrContext_ptr == NULL ) CGroupFactory::CurrContext_ptr = new StdString;  
     12      CGroupFactory::CurrContext_ptr->assign(context); 
    1313   } 
    1414 
    1515   StdString & CGroupFactory::GetCurrentContextId(void) 
    1616   {  
    17       //return (CGroupFactory::CurrContext); 
    1817      return (*CGroupFactory::CurrContext_ptr); 
    1918   } 
  • XIOS/dev/branch_yushan/src/group_factory.hpp

    r1089 r1094  
    6969 
    7070         /// Propriétés statiques /// 
    71          //static StdString CurrContext; 
    7271         static StdString *CurrContext_ptr; 
    7372         #pragma omp threadprivate(CurrContext_ptr) 
  • XIOS/dev/branch_yushan/src/object_factory.cpp

    r1089 r1094  
    55   /// ////////////////////// Définitions ////////////////////// /// 
    66 
    7    //StdString CObjectFactory::CurrContext(""); 
    8          StdString *CObjectFactory::CurrContext_ptr = new StdString; 
     7   StdString *CObjectFactory::CurrContext_ptr = new StdString; 
    98 
    109   void CObjectFactory::SetCurrentContextId(const StdString & context) 
    11    {  
    12          //CObjectFactory::CurrContext = context;  
    13          *CObjectFactory::CurrContext_ptr = context;  
     10   { 
     11     if(CObjectFactory::CurrContext_ptr == NULL ) CObjectFactory::CurrContext_ptr = new StdString; 
     12     CObjectFactory::CurrContext_ptr->assign(context);  
    1413   } 
    1514 
    1615   StdString & CObjectFactory::GetCurrentContextId(void) 
    1716   {  
    18          //return (CObjectFactory::CurrContext);  
    19          return (*CObjectFactory::CurrContext_ptr);  
     17     return (*CObjectFactory::CurrContext_ptr);  
    2018   } 
    2119 
  • XIOS/dev/branch_yushan/src/object_factory.hpp

    r1089 r1094  
    5959 
    6060         /// Propriétés statiques /// 
    61          //static StdString CurrContext; 
    6261         static StdString *CurrContext_ptr; 
    6362         #pragma omp threadprivate(CurrContext_ptr) 
  • XIOS/dev/branch_yushan/src/test/test_omp.f90

    r1088 r1094  
    8888    print*, "xios_context_initialize OK", rank, size 
    8989 
    90     CALL xios_get_handle("test",ctx_hdl) 
    91     CALL xios_set_current_context(ctx_hdl) 
    92    
    93    
    94     CALL xios_get_calendar_type(calendar_type) 
    95     print*, "xios_get_calendar_type OK", rank, size 
    96  
    97     CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
    98     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') 
    99     CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
    100     CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat) 
    101     CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 
    102     print*, "test block OK", rank, size 
    103  
    104     CALL xios_get_handle("field_definition",fieldgroup_hdl) 
    105     CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
    106     CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
    107      
    108     CALL xios_get_handle("output",file_hdl) 
    109     CALL xios_add_child(file_hdl,field_hdl) 
    110     CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
    111     print*, "test block 2 OK", rank, size 
    112  
    113 !     dtime%second = 3600 
    114 !     CALL xios_set_timestep(dtime) 
    115 !     print*, "xios_set_timestep OK", rank, size 
    116  
    117     ! The calendar is created as soon as the calendar type is defined. This way 
    118     ! calendar operations can be used before the context definition is closed 
    119 !     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() 
    122 !     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) 
    129 !     dtime%timestep = 1 
    130 !     dtime = 0.5 * dtime 
    131 !     CALL xios_duration_convert_to_string(dtime, dtime_str) 
    132 !     PRINT *, "duration = ", dtime_str 
    133 !     date = date + 3 * (dtime + dtime) 
    134 !     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  
     90!     CALL xios_get_handle("test",ctx_hdl) 
     91!     CALL xios_set_current_context(ctx_hdl) 
     92   
     93   
     94!     CALL xios_get_calendar_type(calendar_type) 
     95!     print*, "xios_get_calendar_type OK", rank, size 
     96 
     97!     CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
     98!     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') 
     99!     CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
     100!     CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat) 
     101!     CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 
     102!     print*, "test block OK", rank, size 
    139103 
    140104    CALL xios_context_finalize() 
     
    142106 
    143107    !$omp master 
    144     call MPI_Barrier(comm) 
     108    !call MPI_Barrier(comm) 
    145109    CALL MPI_COMM_FREE(comm, ierr) 
    146110    !$omp end master 
Note: See TracChangeset for help on using the changeset viewer.