- Timestamp:
- 03/29/17 19:12:27 (7 years ago)
- Location:
- XIOS/dev/branch_yushan
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/bld.cfg
r1079 r1080 36 36 #bld::target test_remap.exe 37 37 #bld::target test_new_features.exe test_unstruct_complete.exe 38 bld::target test_omp.exe test_client.exe #test_complete.exe38 bld::target test_omp.exe #test_client.exe #test_complete.exe 39 39 bld::exe_dep 40 40 -
XIOS/dev/branch_yushan/src/client.cpp
r1079 r1080 193 193 printf("Client %d CContext::setCurrent OK\n", getRank()); 194 194 CContext* context = CContext::create(id); 195 printf("Client %d context=CContext::create(%s) OK \n", getRank(), id);195 printf("Client %d context=CContext::create(%s) OK, *context = %p\n", getRank(), id, &(*context)); 196 196 197 197 StdString idServer(id); … … 254 254 MPI_Comm_dup(contextComm,&contextInterComm) ; 255 255 CContext* contextServer = CContext::create(idServer); 256 256 257 257 // Firstly, initialize context on client side 258 258 context->initClient(contextComm,contextInterComm, contextServer); -
XIOS/dev/branch_yushan/src/client.hpp
r1079 r1080 23 23 static std::list<MPI_Comm> contextInterComms; 24 24 // #pragma omp threadprivate(contextInterComms) 25 //std::list<MPI_Comm> contextInterComms; 25 26 26 27 static int serverLeader; -
XIOS/dev/branch_yushan/src/group_factory.hpp
r591 r1080 70 70 /// Propriétés statiques /// 71 71 static StdString CurrContext; 72 //#pragma omp threadprivate(CurrContext) 72 73 73 74 }; // class CGroupFactory -
XIOS/dev/branch_yushan/src/node/context.cpp
r1079 r1080 243 243 int tmp_rank; 244 244 MPI_Comm_rank(intraComm, &tmp_rank); 245 MPI_Barrier(intraComm); 245 246 246 #pragma omp critical (_output) 247 printf("Client %d : client = new CContextClient(this,intraComm, interComm, cxtServer) \n", tmp_rank) ; 247 248 248 249 249 registryIn=new CRegistry(intraComm); 250 251 #pragma omp critical (_output) 252 printf("Client %d : registryIn=new CRegistry(intraComm), ®istryIn = %p, registryIn = %p \n", tmp_rank, ®istryIn, registryIn) ; 253 254 // registryIn=new CRegistry; 255 // registryIn->communicator = intraComm; 250 256 registryIn->setPath(getId()) ; 251 257 if (client->clientRank==0) registryIn->fromFile("xios_registry.bin") ; … … 1185 1191 \return pointer to the new context or already-existed one with identity id 1186 1192 */ 1193 //bkp 1194 // CContext* CContext::create(const StdString& id) 1195 // { 1196 // CContext::setCurrent(id); 1197 1198 // bool hasctxt = CContext::has(id); 1199 // CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 1200 // getRoot(); 1201 // if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 1202 1203 // #define DECLARE_NODE(Name_, name_) \ 1204 // C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 1205 // #define DECLARE_NODE_PAR(Name_, name_) 1206 // #include "node_type.conf" 1207 1208 // return (context); 1209 // } 1210 1211 1187 1212 CContext* CContext::create(const StdString& id) 1188 1213 { 1189 1214 CContext::setCurrent(id); 1190 1215 1216 1191 1217 bool hasctxt = CContext::has(id); 1192 CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 1193 getRoot(); 1194 if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 1218 CContext* context[omp_get_num_threads()]; 1219 for(int i=0; i<omp_get_num_threads(); i++) 1220 { 1221 1222 context[i] = CObjectFactory::CreateObject<CContext>(id).get(); 1223 getRoot(); 1224 if (!hasctxt) CGroupFactory::AddChild(root, context[i]->getShared()); 1195 1225 1196 1226 #define DECLARE_NODE(Name_, name_) \ 1197 C##Name_##Definition::create(C##Name_##Definition::GetDefName());1227 C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 1198 1228 #define DECLARE_NODE_PAR(Name_, name_) 1199 1229 #include "node_type.conf" 1200 1201 return (context); 1230 } 1231 int tmp_rank; 1232 MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank); 1233 printf("CContext::create : num_threads = %d, my_id = %d, return add = %p\n", omp_get_num_threads(), tmp_rank, &(context[omp_get_thread_num()])); 1234 1235 return (context[omp_get_thread_num()]); 1202 1236 } 1203 1204 1205 1237 1206 1238 //! Server side: Receive a message to do some post processing -
XIOS/dev/branch_yushan/src/node/context.hpp
r1072 r1080 21 21 22 22 23 /// ////////////////////// D éclarations ////////////////////// ///23 /// ////////////////////// Dclarations ////////////////////// /// 24 24 class CContextGroup; 25 25 class CContextAttributes; … … 224 224 CRegistry* registryIn ; //!< input registry which is read from file 225 225 CRegistry* registryOut ; //!< output registry which will be wrote on file at the finalize 226 //#pragma omp threadprivate(registryIn, registryOut) 226 227 227 228 private: -
XIOS/dev/branch_yushan/src/object_factory.hpp
r769 r1080 60 60 /// Propriétés statiques /// 61 61 static StdString CurrContext; 62 //#pragma omp threadprivate(CurrContext) 62 63 63 64 }; // class CObjectFactory -
XIOS/dev/branch_yushan/src/registry.hpp
r1053 r1080 28 28 /** Constructor, the communicator is used for bcast or gather operation between MPI processes */ 29 29 30 CRegistry(const ep_lib::MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {} 30 //CRegistry(const ep_lib::MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {} 31 CRegistry(const ep_lib::MPI_Comm& comm=MPI_COMM_WORLD) 32 { 33 communicator = comm; 34 } 31 35 32 36 -
XIOS/dev/branch_yushan/src/test/test_omp.f90
r1079 r1080 36 36 37 37 CALL MPI_INIT_THREAD(3, provided, ierr) 38 print*, "provided = ", provided 39 38 40 CALL init_wait 39 41 … … 79 81 print*, "xios init OK", rank, size 80 82 83 81 84 CALL xios_context_initialize("test",comm) 82 83 85 print*, "xios_context init OK", rank, size 84 85 !CALL xios_context_finalize() 86 87 86 87 CALL xios_get_handle("test",ctx_hdl) 88 print*, "xios_get_handle OK", rank, size 89 90 CALL xios_set_current_context(ctx_hdl) 91 print*, "xios_set_current_context OK", rank, size 92 93 CALL xios_get_calendar_type(calendar_type) 94 print*, "xios_get_calendar_type OK", rank, size 95 96 !CALL xios_context_finalize() 88 97 !print*, "xios_context finalize OK", rank, size 89 98 … … 175 184 print *, "Client : xios_finalize " 176 185 177 else178 179 CALL xios_init_server180 print *, "Server : xios_finalize "181 182 endif186 else 187 188 CALL xios_init_server 189 print *, "Server : xios_finalize " 190 191 endif 183 192 184 193 -
XIOS/dev/branch_yushan/src/xml_parser.cpp
r1073 r1080 11 11 namespace xml 12 12 { 13 /// ////////////////////// D éfinitions ////////////////////// ///13 /// ////////////////////// Dfinitions ////////////////////// /// 14 14 15 15 void CXMLParser::ParseFile(const StdString & filename, const std::set<StdString>& parseContextList)
Note: See TracChangeset
for help on using the changeset viewer.