Ignore:
Timestamp:
05/15/17 15:00:24 (7 years ago)
Author:
oabramkina
Message:

Two-level server: merging new grid functionalities and changes in the communication protocol (e.g. non-blocking context finalize, registries, oasis).

Tests on curie: test_client, test_complete, nemo (test_xios2_cmip6.exe).

To do: non-structured grid, check reading, possible bug in client/server initialization (?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/context_server.cpp

    r1071 r1130  
    2222namespace xios 
    2323{ 
    24   StdSize CContextServer::totalBuf_ = 0; 
    2524 
    2625  CContextServer::CContextServer(CContext* parent, MPI_Comm intraComm_,MPI_Comm interComm_) 
     
    4140    finished=false; 
    4241    boost::hash<string> hashString; 
    43     hashId=hashString(context->getId()); 
     42    if (CServer::serverLevel == 1) 
     43      hashId=hashString(context->getId() + boost::lexical_cast<string>(context->clientPrimServer.size())); 
     44    else 
     45      hashId=hashString(context->getId()); 
    4446  } 
    4547 
     
    169171    map<size_t,CEventServer*>::iterator it; 
    170172    CEventServer* event; 
    171     boost::hash<string> hashString; 
    172     size_t hashId=hashString(context->getId()); 
    173173 
    174174    it=events.find(currentTimeLine); 
     
    189189         // The best way to properly solve this problem will be to use the event scheduler also in attached mode 
    190190         // for now just set up a MPI barrier 
    191 //         if (!CServer::eventScheduler) MPI_Barrier(intraComm) ; 
     191         if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ; 
    192192 
    193193         CTimer::get("Process events").resume(); 
     
    218218    int rank; 
    219219    list<CEventServer::SSubEvent>::iterator it; 
    220 //    CContext::setCurrent(context->getId()); 
    221220    StdString ctxId = context->getId(); 
    222221    CContext::setCurrent(ctxId); 
     222    StdSize totalBuf = 0; 
    223223 
    224224    if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 
    225225    { 
    226226      finished=true; 
    227 //      info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl;            // moved to CContext::finalize() 
     227//      info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl;   // moved to CContext::finalize() 
    228228      std::map<int, StdSize>::const_iterator itbMap = mapBufferSize_.begin(), 
    229229                           iteMap = mapBufferSize_.end(), itMap; 
     
    231231      { 
    232232        rank = itMap->first; 
    233 //        report(10)<< " Memory report : Context <"<<ctxId<<"> : server side : memory used for buffer of each connection to client" << endl 
    234 //            << "  +) With client of rank " << rank << " : " << itMap->second << " bytes " << endl; 
    235         totalBuf_ += itMap->second; 
     233        report(10)<< " Memory report : Context <"<<ctxId<<"> : server side : memory used for buffer of each connection to client" << endl 
     234            << "  +) With client of rank " << rank << " : " << itMap->second << " bytes " << endl; 
     235        totalBuf += itMap->second; 
    236236      } 
    237237      context->finalize(); 
    238  
    239 //      report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; // moved to CContext::finalize() 
     238      report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 
    240239    } 
    241240    else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); 
     
    261260  } 
    262261 
    263   size_t CContextServer::getTotalBuf(void) 
    264   { 
    265     return totalBuf_; 
    266   } 
    267  
    268262} 
Note: See TracChangeset for help on using the changeset viewer.