Changeset 1081 for XIOS/dev/branch_yushan/src/node/context.cpp
- Timestamp:
- 03/31/17 20:26:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/src/node/context.cpp
r1080 r1081 239 239 { 240 240 hasClient=true; 241 client = new CContextClient(this,intraComm, interComm, cxtServer); 241 242 #pragma omp critical 243 client = new CContextClient(this, intraComm, interComm, cxtServer); 244 242 245 243 246 int tmp_rank; … … 245 248 MPI_Barrier(intraComm); 246 249 250 #pragma omp critical 251 registryIn=new CRegistry(intraComm); 247 252 253 254 registryIn->setPath(getId()) ; 248 255 249 registryIn=new CRegistry(intraComm);250 251 256 #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; 256 registryIn->setPath(getId()) ; 257 printf("Client %d : registryIn->setPath(getId()=%s), clientRank = %d (%p) \n", tmp_rank, getId(), client->clientRank, &(client->clientRank)) ; 258 printf("Client %d : context.identifier = %d\n", tmp_rank, this->get_identifier()); 259 257 260 if (client->clientRank==0) registryIn->fromFile("xios_registry.bin") ; 258 261 registryIn->bcastRegistry() ; … … 260 263 registryOut=new CRegistry(intraComm) ; 261 264 registryOut->setPath(getId()) ; 265 262 266 #pragma omp critical (_output) 263 printf("Client %d : registryOut->setPath(getId() ) \n", tmp_rank) ;267 printf("Client %d : registryOut->setPath(getId()=%s) \n", tmp_rank, getId()) ; 264 268 265 269 ep_lib::MPI_Comm intraCommServer, interCommServer; … … 1192 1196 */ 1193 1197 //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 1212 1198 CContext* CContext::create(const StdString& id) 1213 1199 { 1214 1200 CContext::setCurrent(id); 1215 1201 1216 1217 1202 bool hasctxt = CContext::has(id); 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()); 1203 CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 1204 getRoot(); 1205 if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 1225 1206 1226 1207 #define DECLARE_NODE(Name_, name_) \ 1227 1208 C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 1228 1209 #define DECLARE_NODE_PAR(Name_, name_) 1229 1210 #include "node_type.conf" 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()]); 1211 1212 return (context); 1236 1213 } 1214 1215 int CContext::get_identifier() 1216 { 1217 return this->identifier; 1218 } 1219 1237 1220 1238 1221 //! Server side: Receive a message to do some post processing
Note: See TracChangeset
for help on using the changeset viewer.