- Timestamp:
- 04/12/17 15:18:22 (7 years ago)
- Location:
- XIOS/dev/branch_yushan/src
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/src/attribute_map.hpp
r1072 r1088 69 69 /// Propriété statique /// 70 70 static CAttributeMap * Current; 71 //#pragma omp threadprivate (Current)71 #pragma omp threadprivate (Current) 72 72 73 73 }; // class CAttributeMap -
XIOS/dev/branch_yushan/src/buffer_client.hpp
r1072 r1088 16 16 public: 17 17 static size_t maxRequestSize; 18 //#pragma omp threadprivate(maxRequestSize)18 #pragma omp threadprivate(maxRequestSize) 19 19 20 20 CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize maxBufferedEvents); -
XIOS/dev/branch_yushan/src/cxios.hpp
r1081 r1088 66 66 67 67 static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 68 68 69 69 70 70 -
XIOS/dev/branch_yushan/src/event_client.hpp
r1072 r1088 12 12 public: 13 13 static const size_t headerSize; 14 //#pragma omp threadprivate(headerSize)15 14 16 15 CEventClient(int classId, int typeId); -
XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.cpp
r1053 r1088 64 64 } 65 65 66 std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> > CSpatialTransformFilterEngine::engines;66 std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> > *CSpatialTransformFilterEngine::engines_ptr = 0; 67 67 68 68 CSpatialTransformFilterEngine* CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation) … … 71 71 ERROR("CSpatialTransformFilterEngine& CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)", 72 72 "Impossible to get the requested engine, the grid transformation is invalid."); 73 74 std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines.find(gridTransformation); 75 if (it == engines.end()) 73 74 if(engines_ptr == NULL) engines_ptr = new std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> >; 75 76 std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines_ptr->find(gridTransformation); 77 if (it == engines_ptr->end()) 76 78 { 77 79 boost::shared_ptr<CSpatialTransformFilterEngine> engine(new CSpatialTransformFilterEngine(gridTransformation)); 78 it = engines .insert(std::make_pair(gridTransformation, engine)).first;80 it = engines_ptr->insert(std::make_pair(gridTransformation, engine)).first; 79 81 } 80 82 -
XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.hpp
r1072 r1088 103 103 //! The allocated engines 104 104 static std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> > engines; 105 // #pragma omp threadprivate(engines) 105 static std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> > *engines_ptr; 106 #pragma omp threadprivate(engines_ptr) 106 107 107 108 }; // class CSpatialTransformFilterEngine -
XIOS/dev/branch_yushan/src/group_factory.cpp
r501 r1088 5 5 /// ////////////////////// Définitions ////////////////////// /// 6 6 StdString CGroupFactory::CurrContext(""); 7 StdString *CGroupFactory::CurrContext_ptr = new StdString; 7 8 8 9 void CGroupFactory::SetCurrentContextId(const StdString & context) 9 10 { 10 11 CGroupFactory::CurrContext = context; 12 *CGroupFactory::CurrContext_ptr = context; 11 13 } 12 14 13 15 StdString & CGroupFactory::GetCurrentContextId(void) 14 16 { 15 return (CGroupFactory::CurrContext); 17 //return (CGroupFactory::CurrContext); 18 return (*CGroupFactory::CurrContext_ptr); 16 19 } 17 20 -
XIOS/dev/branch_yushan/src/group_factory.hpp
r1087 r1088 70 70 /// Propriétés statiques /// 71 71 static StdString CurrContext; 72 #pragma omp threadprivate(CurrContext) 72 static StdString *CurrContext_ptr; 73 #pragma omp threadprivate(CurrContext_ptr) 73 74 74 75 }; // class CGroupFactory -
XIOS/dev/branch_yushan/src/indent.hpp
r1072 r1088 10 10 public: 11 11 static int defaultIncSize; 12 //#pragma omp threadprivate(defaultIncSize)12 #pragma omp threadprivate(defaultIncSize) 13 13 14 14 static int index ; 15 //#pragma omp threadprivate(index)15 #pragma omp threadprivate(index) 16 16 17 17 int incSize ; -
XIOS/dev/branch_yushan/src/indent_xml.cpp
r1079 r1088 15 15 { 16 16 static unsigned int LineNB = 1; 17 //#pragma omp threadprivate(LineNB)17 #pragma omp threadprivate(LineNB) 18 18 19 19 if (CIndent::WithLine) out << LineNB++ << ". "; -
XIOS/dev/branch_yushan/src/indent_xml.hpp
r1072 r1088 22 22 /// Propriétés statiques /// 23 23 static unsigned int Indent; 24 //#pragma omp threadprivate(Indent)24 #pragma omp threadprivate(Indent) 25 25 26 26 static StdString Increm; 27 //#pragma omp threadprivate(Increm)27 #pragma omp threadprivate(Increm) 28 28 29 29 static bool WithLine; 30 //#pragma omp threadprivate(WithLine)30 #pragma omp threadprivate(WithLine) 31 31 32 32 }; // class CIndent -
XIOS/dev/branch_yushan/src/interface/c/icdata.cpp
r1081 r1088 131 131 132 132 CContext* context = CContext::getCurrent(); 133 printf("Check : CContext::getCurrent() = %p\n", CContext::getCurrent());133 //printf("Check : CContext::getCurrent() = %p\n", CContext::getCurrent()); 134 134 context->finalize(); 135 135 -
XIOS/dev/branch_yushan/src/io/netCdf_cf_constant.hpp
r1079 r1088 28 28 static const std::set<StdString> XIOS_CF_Longitude_units; 29 29 30 // #pragma omp threadprivate(XIOS_CF_Latitude_units, XIOS_CF_Longitude_units)31 32 30 private: 33 31 CCFConvention(); -
XIOS/dev/branch_yushan/src/memtrack.cpp
r1072 r1088 68 68 private: // static member variables 69 69 static BlockHeader *ourFirstNode; 70 //#pragma omp threadprivate(ourFirstNode)70 #pragma omp threadprivate(ourFirstNode) 71 71 72 72 private: // member variables … … 245 245 static const unsigned int SIGNATURE1 = 0xCAFEBABE; 246 246 static const unsigned int SIGNATURE2 = 0xFACEFACE; 247 248 //#pragma omp threadprivate(SIGNATURE1, SIGNATURE2)249 247 250 248 private: // member variables -
XIOS/dev/branch_yushan/src/node/axis.cpp
r1053 r1088 44 44 { /* Ne rien faire de plus */ } 45 45 46 std::map<StdString, ETranformationType> CAxis::transformationMapList_ = std::map<StdString, ETranformationType>(); 47 bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_); 46 //std::map<StdString, ETranformationType> CAxis::transformationMapList_ = std::map<StdString, ETranformationType>(); 47 std::map<StdString, ETranformationType> *CAxis::transformationMapList_ptr = new std::map<StdString, ETranformationType>; 48 bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(*CAxis::transformationMapList_ptr); 48 49 bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 49 50 { … … 1004 1005 1005 1006 nodeElementName = node.getElementName(); 1006 std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ .end(), it;1007 it = transformationMapList_ .find(nodeElementName);1007 std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it; 1008 it = transformationMapList_ptr->find(nodeElementName); 1008 1009 if (ite != it) 1009 1010 { -
XIOS/dev/branch_yushan/src/node/axis.hpp
r1072 r1088 166 166 private: 167 167 static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m); 168 static std::map<StdString, ETranformationType> transformationMapList_; 169 // #pragma omp threadprivate(transformationMapList_) 168 //static std::map<StdString, ETranformationType> transformationMapList_; 169 static std::map<StdString, ETranformationType> *transformationMapList_ptr; 170 #pragma omp threadprivate(transformationMapList_ptr) 170 171 171 172 static bool dummyTransformationMapList_; 172 //#pragma omp threadprivate(dummyTransformationMapList_)173 #pragma omp threadprivate(dummyTransformationMapList_) 173 174 174 175 DECLARE_REF_FUNC(Axis,axis) -
XIOS/dev/branch_yushan/src/node/compute_connectivity_domain.hpp
r1072 r1088 60 60 static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 61 61 static bool _dummyRegistered; 62 //#pragma omp threadprivate(_dummyRegistered)62 #pragma omp threadprivate(_dummyRegistered) 63 63 64 64 }; // class CComputeConnectivityDomain -
XIOS/dev/branch_yushan/src/node/domain.cpp
r1070 r1088 65 65 } 66 66 67 std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>();68 bool CDomain::_dummyTransformationMapList = CDomain::initializeTransformationMap( CDomain::transformationMapList_);67 std::map<StdString, ETranformationType> * CDomain::transformationMapList_ptr = new std::map<StdString, ETranformationType>; 68 bool CDomain::_dummyTransformationMapList = CDomain::initializeTransformationMap(*CDomain::transformationMapList_ptr); 69 69 70 70 bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m) … … 2189 2189 2190 2190 nodeElementName = node.getElementName(); 2191 std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ .end(), it;2192 it = transformationMapList_ .find(nodeElementName);2191 std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it; 2192 it = transformationMapList_ptr->find(nodeElementName); 2193 2193 if (ite != it) 2194 2194 { -
XIOS/dev/branch_yushan/src/node/domain.hpp
r1072 r1088 211 211 private: 212 212 static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m); 213 static std::map<StdString, ETranformationType> transformationMapList_;213 static std::map<StdString, ETranformationType> *transformationMapList_ptr; 214 214 static bool _dummyTransformationMapList; 215 //#pragma omp threadprivate(_dummyTransformationMapList)215 #pragma omp threadprivate(transformationMapList_ptr, _dummyTransformationMapList) 216 216 217 217 DECLARE_REF_FUNC(Domain,domain) -
XIOS/dev/branch_yushan/src/node/expand_domain.hpp
r1072 r1088 60 60 static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node); 61 61 static bool _dummyRegistered; 62 //#pragma omp threadprivate(_dummyRegistered)62 #pragma omp threadprivate(_dummyRegistered) 63 63 64 64 }; // class CExpandDomain -
XIOS/dev/branch_yushan/src/node/extract_axis_to_scalar.hpp
r1072 r1088 60 60 static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node); 61 61 static bool _dummyRegistered; 62 //#pragma omp threadprivate(_dummyRegistered)62 #pragma omp threadprivate(_dummyRegistered) 63 63 }; // class CExtractAxisToScalar 64 64 -
XIOS/dev/branch_yushan/src/object_factory.cpp
r501 r1088 6 6 7 7 StdString CObjectFactory::CurrContext(""); 8 StdString *CObjectFactory::CurrContext_ptr = new StdString; 8 9 9 10 void CObjectFactory::SetCurrentContextId(const StdString & context) 10 { CObjectFactory::CurrContext = context; } 11 { 12 CObjectFactory::CurrContext = context; 13 *CObjectFactory::CurrContext_ptr = context; 14 } 11 15 12 16 StdString & CObjectFactory::GetCurrentContextId(void) 13 { return (CObjectFactory::CurrContext); } 17 { 18 //return (CObjectFactory::CurrContext); 19 return (*CObjectFactory::CurrContext_ptr); 20 } 14 21 15 22 } // namespace xios -
XIOS/dev/branch_yushan/src/object_factory.hpp
r1087 r1088 60 60 /// Propriétés statiques /// 61 61 static StdString CurrContext; 62 #pragma omp threadprivate(CurrContext) 62 static StdString *CurrContext_ptr; 63 #pragma omp threadprivate(CurrContext_ptr) 63 64 64 65 }; // class CObjectFactory -
XIOS/dev/branch_yushan/src/object_factory_impl.hpp
r1087 r1088 10 10 int CObjectFactory::GetObjectNum(void) 11 11 { 12 if (CurrContext .size() == 0)12 if (CurrContext_ptr->size() == 0) 13 13 ERROR("CObjectFactory::GetObjectNum(void)", 14 14 << "please define current context id !"); … … 17 17 18 18 19 return (*U::AllVectObj)[ CObjectFactory::CurrContext].size();19 return (*U::AllVectObj)[*CObjectFactory::CurrContext_ptr].size(); 20 20 } 21 21 … … 23 23 int CObjectFactory::GetObjectIdNum(void) 24 24 { 25 if (CurrContext .size() == 0)25 if (CurrContext_ptr->size() == 0) 26 26 ERROR("CObjectFactory::GetObjectIdNum(void)", 27 27 << "please define current context id !"); … … 30 30 31 31 32 return (* U::AllMapObj) [ CObjectFactory::CurrContext].size();32 return (* U::AllMapObj) [*CObjectFactory::CurrContext_ptr].size(); 33 33 } 34 34 … … 36 36 bool CObjectFactory::HasObject(const StdString & id) 37 37 { 38 if (CurrContext .size() == 0)38 if (CurrContext_ptr->size() == 0) 39 39 ERROR("CObjectFactory::HasObject(const StdString & id)", 40 40 << "[ id = " << id << " ] please define current context id !"); … … 44 44 45 45 46 return ((*U::AllMapObj)[ CObjectFactory::CurrContext].find(id) !=47 (*U::AllMapObj)[ CObjectFactory::CurrContext].end());46 return ((*U::AllMapObj)[*CObjectFactory::CurrContext_ptr].find(id) != 47 (*U::AllMapObj)[*CObjectFactory::CurrContext_ptr].end()); 48 48 } 49 49 … … 67 67 if(U::AllVectObj == NULL) return (boost::shared_ptr<U>()); 68 68 69 if (CurrContext .size() == 0)69 if (CurrContext_ptr->size() == 0) 70 70 ERROR("CObjectFactory::GetObject(const U * const object)", 71 71 << "please define current context id !"); 72 72 std::vector<boost::shared_ptr<U> > & vect = 73 (*U::AllVectObj)[ CObjectFactory::CurrContext];73 (*U::AllVectObj)[*CObjectFactory::CurrContext_ptr]; 74 74 75 75 typename std::vector<boost::shared_ptr<U> >::const_iterator … … 94 94 if(U::AllMapObj == NULL) return (boost::shared_ptr<U>()); 95 95 96 if (CurrContext .size() == 0)96 if (CurrContext_ptr->size() == 0) 97 97 ERROR("CObjectFactory::GetObject(const StdString & id)", 98 98 << "[ id = " << id << " ] please define current context id !"); … … 101 101 << "[ id = " << id << ", U = " << U::GetName() << " ] " 102 102 << "object was not found."); 103 return (*U::AllMapObj)[ CObjectFactory::CurrContext][id];103 return (*U::AllMapObj)[*CObjectFactory::CurrContext_ptr][id]; 104 104 } 105 105 … … 123 123 if(U::AllMapObj == NULL) U::AllMapObj = new xios_map<StdString, xios_map<StdString, boost::shared_ptr<U> > >; 124 124 125 if (CurrContext .empty())125 if (CurrContext_ptr->empty()) 126 126 ERROR("CObjectFactory::CreateObject(const StdString& id)", 127 127 << "[ id = " << id << " ] please define current context id !"); … … 135 135 boost::shared_ptr<U> value(new U(id.empty() ? CObjectFactory::GenUId<U>() : id)); 136 136 137 (* U::AllVectObj)[ CObjectFactory::CurrContext].insert((*U::AllVectObj)[CObjectFactory::CurrContext].end(), value);138 (* U::AllMapObj) [ CObjectFactory::CurrContext].insert(std::make_pair(value->getId(), value));137 (* U::AllVectObj)[*CObjectFactory::CurrContext_ptr].insert((*U::AllVectObj)[*CObjectFactory::CurrContext_ptr].end(), value); 138 (* U::AllMapObj) [*CObjectFactory::CurrContext_ptr].insert(std::make_pair(value->getId(), value)); 139 139 140 140 return value; … … 164 164 StdOStringStream oss; 165 165 if(U::GenId == NULL) U::GenId = new xios_map< StdString, long int >; 166 oss << GetUIdBase<U>() << (*U::GenId)[ CObjectFactory::CurrContext]++;166 oss << GetUIdBase<U>() << (*U::GenId)[*CObjectFactory::CurrContext_ptr]++; 167 167 return oss.str(); 168 168 } -
XIOS/dev/branch_yushan/src/test/test_omp.f90
r1087 r1088 88 88 print*, "xios_context_initialize OK", rank, size 89 89 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 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 103 139 104 140 CALL xios_context_finalize()
Note: See TracChangeset
for help on using the changeset viewer.