Ignore:
Timestamp:
11/13/14 15:09:28 (10 years ago)
Author:
mhnguyen
Message:

Seperating database of context on "client" side and "server" side

+) Add one more context in contex client in case of attached mode
+) Do some minor changements to make sure everything fine in case of attached mode
+) Replace buffer group with the new options

Test
+) On Curie
+) Connection mode: Attached and seperated
+) File mode: one and multiple
+) All tests passed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/context_client.cpp

    r509 r511  
    1717 
    1818 
    19     CContextClient::CContextClient(CContext* parent,MPI_Comm intraComm_, MPI_Comm interComm_) : mapBufferSize_() 
     19    CContextClient::CContextClient(CContext* parent,MPI_Comm intraComm_, MPI_Comm interComm_, CContext* cxtSer) 
     20     : mapBufferSize_(), parentServer(cxtSer) 
    2021    { 
    2122      context=parent ; 
     
    6162      } 
    6263 
    63       if (context->hasServer) waitEvent(ranks) ; 
     64//      if (context->hasServer) 
     65      if (0 != parentServer) 
     66      { 
     67        waitEvent(ranks); 
     68        CContext::setCurrent(context->getId()); 
     69      } 
     70 
    6471      timeLine++ ; 
    6572    } 
     
    9299    void CContextClient::waitEvent(list<int>& ranks) 
    93100    { 
    94       context->server->setPendingEvent() ; 
     101//      context->server->setPendingEvent() ; 
     102//      while(checkBuffers(ranks)) 
     103//      { 
     104//        context->server->listen() ; 
     105//        context->server->checkPendingRequest() ; 
     106//      } 
     107// 
     108//      while(context->server->hasPendingEvent()) 
     109//      { 
     110//       context->server->eventLoop() ; 
     111//      } 
     112 
     113      parentServer->server->setPendingEvent() ; 
    95114      while(checkBuffers(ranks)) 
    96115      { 
    97         context->server->listen() ; 
    98         context->server->checkPendingRequest() ; 
    99       } 
    100  
    101       while(context->server->hasPendingEvent()) 
    102       { 
    103        context->server->eventLoop() ; 
     116        parentServer->server->listen() ; 
     117        parentServer->server->checkPendingRequest() ; 
     118      } 
     119 
     120      while(parentServer->server->hasPendingEvent()) 
     121      { 
     122       parentServer->server->eventLoop() ; 
    104123      } 
    105124 
     
    240259     } 
    241260     CTimer::get("Blocking time").suspend(); 
    242      report(0)<< " Memory report : Context <"<<context->getId()<<"> : client side : total memory used for buffer "<<buffers.size()*CXios::bufferSize<<" bytes"<<endl ; 
     261//     report(0)<< " Memory report : Context <"<<context->getId()<<"> : client side : total memory used for buffer "<<buffers.size()*CXios::bufferSize<<" bytes"<<endl ; 
     262 
     263     std::map<int, StdSize>::const_iterator itbMap = mapBufferSize_.begin(), 
     264                                            iteMap = mapBufferSize_.end(), itMap; 
     265     StdSize totalBuf = 0; 
     266     for (itMap = itbMap; itMap != iteMap; ++itMap) 
     267     { 
     268       report(10)<< " Memory report : Context <"<<context->getId()<<"> : client side : memory used for buffer of each connection to server" << endl 
     269                 << "  +)To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl; 
     270       totalBuf += itMap->second; 
     271     } 
     272     report(0)<< " Memory report : Context <"<<context->getId()<<"> : client side : total memory used for buffer "<<totalBuf<<" bytes"<<endl ; 
    243273 
    244274     releaseBuffers() ; 
Note: See TracChangeset for help on using the changeset viewer.