Changeset 1101


Ignore:
Timestamp:
04/21/17 13:53:33 (4 years ago)
Author:
yushan
Message:

From ADA, test_omp (test_client + openmp) OK. Todo: add field_C

Location:
XIOS/dev/branch_yushan
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/arch/arch-X64_ADA.fcm

    r985 r1101  
    33################################################################################ 
    44 
    5 %CCOMPILER      mpiicc 
    6 %FCOMPILER      mpiifort  
    7 %LINKER         mpiifort  -nofor-main 
     5%CCOMPILER      mpiicc -qopenmp -D_usingEP -D_intelmpi 
     6%FCOMPILER      mpiifort -qopenmp -D_usingEP -D_intelmpi 
     7%LINKER         mpiifort  -nofor-main -qopenmp -D_usingEP -D_intelmpi 
    88 
    99%BASE_CFLAGS    -diag-disable 1125 -diag-disable 279 
  • XIOS/dev/branch_yushan/src/attribute_template_impl.hpp

    r1037 r1101  
    3939         : CAttribute(id) 
    4040      { 
    41          umap.insert(umap.end(), std::make_pair(id, this)); 
     41         xios_map<StdString, CAttribute*>::iterator it; 
     42         printf("umap size = %lu, add = %p\n", umap.size(), &umap); 
     43         it = umap.find(id); 
     44         if(it == umap.end()) 
     45           umap.insert(umap.end(), std::make_pair(id, this)); 
    4246      } 
    4347 
  • XIOS/dev/branch_yushan/src/calendar.cpp

    r561 r1101  
    117117      const CDate& CCalendar::update(int step) 
    118118      { 
    119         info(20) << "update step : " << step << " timestep " << this->timestep << std::endl; 
     119        //info(20) << "update step : " << step << " timestep " << this->timestep << std::endl; 
    120120        return (this->currentDate = this->getInitDate() + step * this->timestep); 
    121121      } 
  • XIOS/dev/branch_yushan/src/group_factory_impl.hpp

    r591 r1101  
    7070      CObjectFactory::SetCurrentContextId 
    7171      (CGroupFactory::GetCurrentContextId()); 
     72      printf("SetCurrentContextId OK %d , %d, %s\n", id.size(), CGroupFactory::HasChild(group, id), id); 
    7273      if (id.size() == 0) 
    7374      { 
    74          boost::shared_ptr<typename U::RelChild> value = 
    75                CObjectFactory::CreateObject<typename U::RelChild>(); 
     75         boost::shared_ptr<typename U::RelChild> value = CObjectFactory::CreateObject<typename U::RelChild>(); 
     76         printf("boost::shared_ptr<typename U::RelChild> value OK\n"); 
    7677         group->childList.insert(group->childList.end(), value.get()); 
     78         printf("group->childList.insert OK\n"); 
    7779         group->childMap.insert(std::make_pair(value->getId(), value.get())); 
     80         printf("group->childMap.insert OK\n"); 
    7881         return (value); 
    7982      } 
    8083      else if (CGroupFactory::HasChild(group, id)) 
     84      { 
     85         printf("has child\n"); 
    8186         return (CGroupFactory::GetChild(group, id)); 
     87      } 
    8288      else 
    8389      { 
    84          boost::shared_ptr<typename U::RelChild> value = 
    85                CObjectFactory::CreateObject<typename U::RelChild>(id); 
     90         boost::shared_ptr<typename U::RelChild> value = CObjectFactory::CreateObject<typename U::RelChild>(id); 
     91         printf("shared_ptr OK\n"); 
    8692         group->childList.insert(group->childList.end(), value.get()); 
     93         printf("childList.insert OK\n"); 
    8794         group->childMap.insert(std::make_pair(id, value.get())); 
     95         printf("childMap.insert OK\n"); 
    8896         return (value); 
    8997      } 
  • XIOS/dev/branch_yushan/src/group_template_impl.hpp

    r595 r1101  
    348348   U* CGroupTemplate<U, V, W>::createChild(const string& id)  
    349349  { 
     350    printf("U* CGroupTemplate<U, V, W>::createChild(const string& id) %p\n", this->getShared()); 
    350351    return CGroupFactory::CreateChild<V>(this->getShared(), id).get() ; 
    351352  } 
  • XIOS/dev/branch_yushan/src/interface/c/icfield.cpp

    r943 r1101  
    3939      CTimer::get("XIOS").resume() ; 
    4040      *_ret = CField::get(id); 
     41      printf("cxios_field_handle_create\n"); 
    4142      CTimer::get("XIOS").suspend() ; 
    4243   } 
     
    4849      CTimer::get("XIOS").resume() ; 
    4950      *_ret = CFieldGroup::get(id); 
     51      printf("cxios_fieldgroup_handle_create\n"); 
    5052      CTimer::get("XIOS").suspend() ; 
    5153   } 
  • XIOS/dev/branch_yushan/src/object_factory_impl.hpp

    r1088 r1101  
    122122      if(U::AllVectObj == NULL) U::AllVectObj = new xios_map<StdString, std::vector<boost::shared_ptr<U> > >; 
    123123      if(U::AllMapObj  == NULL) U::AllMapObj  = new xios_map<StdString, xios_map<StdString, boost::shared_ptr<U> > >; 
     124 
     125      printf("so far so good : %d %d %d\n", CurrContext_ptr->empty(), CObjectFactory::HasObject<U>(id), id.empty()); 
    124126       
    125127      if (CurrContext_ptr->empty()) 
     
    134136      { 
    135137         boost::shared_ptr<U> value(new U(id.empty() ? CObjectFactory::GenUId<U>() : id)); 
    136  
     138         printf("in CreateObject, value OK\n");   
    137139         (* U::AllVectObj)[*CObjectFactory::CurrContext_ptr].insert((*U::AllVectObj)[*CObjectFactory::CurrContext_ptr].end(), value); 
     140         printf("AllVectObj insert OK\n"); 
    138141         (* U::AllMapObj) [*CObjectFactory::CurrContext_ptr].insert(std::make_pair(value->getId(), value)); 
     142         printf("AllMapObj insert OK\n"); 
    139143 
    140144         return value; 
  • XIOS/dev/branch_yushan/src/object_template.hpp

    r1087 r1101  
    106106         // static xios_map< StdString, long int > GenId ; 
    107107 
    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 ; 
    111108 
    112109         static xios_map<StdString, xios_map<StdString, boost::shared_ptr<DerivedType> > > *AllMapObj; 
    113110         static xios_map<StdString, std::vector<boost::shared_ptr<DerivedType> > > *AllVectObj; 
    114111         static xios_map< StdString, long int > *GenId; 
    115  
    116112         #pragma omp threadprivate(AllMapObj, AllVectObj, GenId) 
    117113 
  • XIOS/dev/branch_yushan/src/test/test_omp.f90

    r1094 r1101  
    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 
     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!     print*, "test block II get_handle OK", rank, size 
     106!     CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
     107!     print*, "test block II add_child OK", rank, size 
     108!     CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
     109!     print*, "test block II set_attr OK", rank, size 
     110 
     111    dtime%second = 3600 
     112    CALL xios_set_timestep(dtime) 
     113    print*, "xios_set_timestep OK", rank, size     
     114 
     115   ! The calendar is created as soon as the calendar type is defined. This way 
     116   ! calendar operations can be used before the context definition is closed 
     117   CALL xios_get_time_origin(date) 
     118   PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
     119   PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
     120   CALL xios_date_convert_to_string(date, date_str) 
     121   PRINT *, "time_origin = ", date_str 
     122   PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
     123   PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
     124   PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
     125   PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
     126   PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
     127   dtime%timestep = 1 
     128   dtime = 0.5 * dtime 
     129   CALL xios_duration_convert_to_string(dtime, dtime_str) 
     130   PRINT *, "duration = ", dtime_str 
     131   date = date + 3 * (dtime + dtime) 
     132   CALL xios_date_convert_to_string(date, date_str) 
     133   PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
     134   PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
     135   PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
     136 
     137   ni=0 ; lonvalue(:,:)=0; 
     138   CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 
     139   print *,"ni",ni 
     140   !print *,"lonvalue",lonvalue; 
     141 
     142   CALL xios_is_defined_field_attr("field_A",enabled=ok) 
     143   PRINT *,"field_A : attribute enabled is defined ? ",ok  
     144 
     145   CALL xios_close_context_definition() 
     146   print*, "xios_close_context_definition OK"   
     147 
     148   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
     149 
     150   DO ts=1,6 
     151    CALL xios_update_calendar(ts) 
     152    CALL xios_send_field("field_A",field_A) 
     153    CALL wait_us(5000) 
     154   ENDDO 
    103155 
    104156    CALL xios_context_finalize() 
     
    116168    CALL xios_finalize() 
    117169    print*, "xios finalize OK", rank, size 
     170 
     171    DEALLOCATE(lon, lat, field_A, lonvalue) 
    118172 
    119173 
  • XIOS/dev/branch_yushan/src/transformation/grid_transformation_factory_impl.hpp

    r1079 r1101  
    6262  static bool unregisterTransformation(ETranformationType transType); 
    6363  static bool initializeTransformation_; 
    64   //#pragma omp threadprivate(initializeTransformation_) 
     64  #pragma omp threadprivate(initializeTransformation_) 
    6565}; 
    6666 
     
    8787     ERROR("CGridTransformationFactory::createTransformation(ETranformationType transType)", 
    8888           << "Transformation type " << transType 
    89            << "doesn't exist. Please define."); 
     89           << " doesn't exist. Please define."); 
    9090  } 
    9191  return (it->second)(gridDst, gridSrc, transformation, elementPositionInGrid, 
Note: See TracChangeset for help on using the changeset viewer.