Changeset 1134 for XIOS/dev/branch_yushan_merged/src/node/context.cpp
- Timestamp:
- 05/16/17 17:54:30 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/src/node/context.cpp
r1091 r1134 18 18 namespace xios { 19 19 20 shared_ptr<CContextGroup> CContext::root; 20 //shared_ptr<CContextGroup> CContext::root; 21 shared_ptr<CContextGroup> * CContext::root_ptr = 0; 21 22 22 23 /// ////////////////////// Définitions ////////////////////// /// … … 54 55 CContextGroup* CContext::getRoot(void) 55 56 { 56 if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 57 return root.get(); 57 //if (root.get()==NULL) root=shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 58 //return root.get(); 59 60 //static shared_ptr<CContextGroup> *root_ptr; 61 if(root_ptr == 0) //root_ptr = new shared_ptr<CContextGroup>; 62 // if (root_ptr->get()==NULL) 63 root_ptr = new shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 64 return root_ptr->get(); 58 65 } 59 66 … … 236 243 237 244 //! Initialize client side 238 void CContext::initClient( MPI_Comm intraComm,MPI_Comm interComm, CContext* cxtServer /*= 0*/)245 void CContext::initClient(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtServer /*= 0*/) 239 246 { 240 247 hasClient=true; 241 client = new CContextClient(this,intraComm, interComm, cxtServer); 248 client = new CContextClient(this, intraComm, interComm, cxtServer); 249 250 int tmp_rank; 251 MPI_Comm_rank(intraComm, &tmp_rank); 252 MPI_Barrier(intraComm); 253 254 242 255 registryIn=new CRegistry(intraComm); 243 256 registryIn->setPath(getId()) ; … … 248 261 registryOut->setPath(getId()) ; 249 262 250 MPI_Comm intraCommServer, interCommServer;263 ep_lib::MPI_Comm intraCommServer, interCommServer; 251 264 if (cxtServer) // Attached mode 252 265 { … … 311 324 312 325 //! Initialize server 313 void CContext::initServer( MPI_Comm intraComm,MPI_Comm interComm, CContext* cxtClient /*= 0*/)326 void CContext::initServer(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtClient /*= 0*/) 314 327 { 315 328 hasServer=true; … … 323 336 registryOut->setPath(getId()) ; 324 337 325 MPI_Comm intraCommClient, interCommClient;338 ep_lib::MPI_Comm intraCommClient, interCommClient; 326 339 if (cxtClient) // Attached mode 327 340 { … … 372 385 } 373 386 374 for (std::list< MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it)387 for (std::list<ep_lib::MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 375 388 MPI_Comm_free(&(*it)); 376 389 comms.clear(); … … 812 825 void CContext::postProcessing() 813 826 { 827 int myRank; 828 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 829 814 830 if (isPostProcessed) return; 815 831 … … 1191 1207 void CContext::updateCalendar(int step) 1192 1208 { 1193 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl;1194 1209 calendar->update(step); 1195 info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl;1196 1210 1197 1211 if (hasClient) … … 1241 1255 CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 1242 1256 getRoot(); 1243 if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 1257 //if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 1258 if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared()); 1244 1259 1245 1260 #define DECLARE_NODE(Name_, name_) \
Note: See TracChangeset
for help on using the changeset viewer.