Changeset 1554


Ignore:
Timestamp:
06/28/18 18:03:28 (2 years ago)
Author:
ymipsl
Message:
  • Remove temporary buffered event
  • Some cleaning

YM

Location:
XIOS/dev/dev_ym/XIOS_ONE_SIDED/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/context_client.cpp

    r1547 r1554  
    125125         // We force the getBuffers call to be non-blocking on classical servers 
    126126        list<CBufferOut*> buffList; 
    127 //        bool couldBuffer = getBuffers(timeLine, ranks, sizes, buffList, (!CXios::isClient && (CServer::serverLevel == 0) )); 
    128127        getBuffers(timeLine, ranks, sizes, buffList) ; 
    129128 
     
    195194      } 
    196195 
    197       if (CXios::isServer) info(100)<<" getBuffers : entering loop"<<endl ; 
    198196      CTimer::get("Blocking time").resume(); 
    199197      do 
     
    205203        } 
    206204 
    207         if (CXios::isServer) info(100)<<" getBuffers : areBuffersFree ? "<<areBuffersFree<<endl ; ; 
    208205        if (!areBuffersFree) 
    209206        { 
    210207          for (itBuffer = bufferList.begin(); itBuffer != bufferList.end(); itBuffer++) (*itBuffer)->unlockBuffer(); 
    211           if (CXios::isServer) info(100)<<" getBuffers : buffers unlocked "<<endl ; 
    212208          checkBuffers(); 
    213           if (CXios::isServer) info(100)<<" getBuffers : buffers checked "<<endl ; 
    214209          if (CServer::serverLevel == 0)  context->server->listen(); 
    215           if (CXios::isServer) info(100)<<" getBuffers : server listened... "<<endl ; 
    216210          else if (CServer::serverLevel == 1) 
    217211          { 
     
    225219        } 
    226220      } while (!areBuffersFree && !nonBlocking); 
    227       if (CXios::isServer) info(100)<<" getBuffers : out of loop"<<endl ; 
    228221      CTimer::get("Blocking time").suspend(); 
    229222 
     
    233226          retBuffers.push_back((*itBuffer)->getBuffer(timeLine, *itSize)); 
    234227      } 
    235       if (CXios::isServer) info(100)<<" getBuffers : message pushed"<<endl ; 
    236228      return areBuffersFree; 
    237229   } 
     
    260252        MPI_Intercomm_create(commSelf, 0, interCommMerged, clientSize+rank, 0, &OneSidedInterComm ); 
    261253        MPI_Intercomm_merge(OneSidedInterComm,false,&oneSidedComm); 
    262         info(100)<<"DEBUG: before creating windows (client)"<<endl ; 
    263254        buffer->createWindows(oneSidedComm) ; 
    264         info(100)<<"DEBUG: after creating windows (client)"<<endl ; 
    265255      } 
    266256        
     
    286276      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) 
    287277      { 
    288 //          CEventClient event(CContext::GetType(), CContext::EVENT_ID_CLOSE_P2P_CHANNEL); 
    289 //          CMessage msg; 
    290 //          event.push(itBuff->first, 1, msg); 
    291 //          timeLine = std::numeric_limits<size_t>::max() ; 
    292 //          sendEvent(event); 
    293 //          while (itBuff->second->checkBuffer(!pureOneSided)); 
    294           delete itBuff->second; 
     278         delete itBuff->second; 
    295279      } 
    296280      buffers.clear(); 
  • XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/context_server.cpp

    r1547 r1554  
    8484  bool CContextServer::eventLoop(bool enableEventsProcessing /*= true*/) 
    8585  { 
    86 //    info(100)<<"CContextServer::eventLoop : listen"<<endl ; 
    8786    listen(); 
    88 //    info(100)<<"CContextServer::eventLoop : checkPendingRequest"<<endl ; 
    8987    checkPendingRequest(); 
    90 //    info(100)<<"CContextServer::eventLoop : process events"<<endl ; 
    9188    if (enableEventsProcessing)  processEvents(); 
    92 //    info(100)<<"CContextServer::eventLoop : finished "<<finished<<endl ; 
    9389    return finished; 
    9490  } 
     
    150146         MPI_Intercomm_create(commSelf, 0, interCommMerged, rank, 0, &OneSidedInterComm ); 
    151147         MPI_Intercomm_merge(OneSidedInterComm,true,&oneSidedComm); 
    152          info(100)<<"DEBUG: before creating windows (server)"<<endl ; 
    153148         buffers[rank]->createWindows(oneSidedComm) ; 
    154          info(100)<<"DEBUG: before creating windows (server)"<<endl ; 
    155149       } 
    156150       lastTimeLine[rank]=0 ; 
     
    223217          if (buffers[rank]->getBufferFromClient(timeLine, buffer, count)) 
    224218          { 
    225             info(100)<<"get buffer from client : timeLine "<<timeLine<<endl ; 
    226219            processRequest(rank, buffer, count); 
    227220            break ; 
     
    249242      CBufferIn newBuffer(startBuffer,buffer.remain()); 
    250243      newBuffer>>size>>timeLine; 
    251       info(100)<<"new event :   timeLine : "<<timeLine<<"  size : "<<size<<endl ; 
    252244      it=events.find(timeLine); 
    253245      if (it==events.end()) it=events.insert(pair<int,CEventServer*>(timeLine,new CEventServer)).first; 
  • XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/node/context.cpp

    r1542 r1554  
    404404    { 
    405405      client->checkBuffers(); 
    406       bool hasTmpBufferedEvent = client->hasTemporarilyBufferedEvent(); 
    407       if (hasTmpBufferedEvent) 
    408         hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent(); 
    409       // Don't process events if there is a temporarily buffered event 
    410       return server->eventLoop(!hasTmpBufferedEvent || !enableEventsProcessing); 
     406      return server->eventLoop(true); 
    411407    } 
    412408    else if (CServer::serverLevel == 1) 
    413409    { 
    414       if (!finalized) 
    415         client->checkBuffers(); 
     410      if (!finalized) client->checkBuffers(); 
    416411      bool serverFinished = true; 
    417       if (!finalized) 
    418         serverFinished = server->eventLoop(enableEventsProcessing); 
     412      if (!finalized) serverFinished = server->eventLoop(enableEventsProcessing); 
    419413      bool serverPrimFinished = true; 
    420414      for (int i = 0; i < clientPrimServer.size(); ++i) 
    421415      { 
    422         if (!finalized) 
    423           clientPrimServer[i]->checkBuffers(); 
    424         if (!finalized) 
    425           serverPrimFinished *= serverPrimServer[i]->eventLoop(enableEventsProcessing); 
     416        if (!finalized) clientPrimServer[i]->checkBuffers(); 
     417        if (!finalized) serverPrimFinished *= serverPrimServer[i]->eventLoop(enableEventsProcessing); 
    426418      } 
    427419      return ( serverFinished && serverPrimFinished); 
     
    456448       { 
    457449         ++countChildCtx_; 
    458  
     450          
     451         info(100)<<"DEBUG: context "<<getId()<<" Send client finalize"<<endl ; 
    459452         client->finalize(); 
    460          while (client->havePendingRequests()) 
    461             client->checkBuffers(); 
    462  
     453         info(100)<<"DEBUG: context "<<getId()<<" Client finalize sent"<<endl ; 
     454         while (client->havePendingRequests()) client->checkBuffers(); 
     455         client->releaseBuffers(); 
     456          
     457         info(100)<<"DEBUG: context "<<getId()<<" no pending request ok"<<endl ; 
    463458         while (!server->hasFinished()) 
    464459           server->eventLoop(); 
    465  
     460        info(100)<<"DEBUG: context "<<getId()<<" server has finished"<<endl ; 
    466461         if (hasServer) // Mode attache 
    467462         { 
     
    472467 
    473468         //! Deallocate client buffers 
    474          client->releaseBuffers(); 
    475  
     469//         client->releaseBuffers(); 
     470        info(100)<<"DEBUG: context "<<getId()<<" release client ok"<<endl ; 
    476471         //! Free internally allocated communicators 
    477472         for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
     
    488483       if (countChildCtx_ == 0) 
    489484         for (int i = 0; i < clientPrimServer.size(); ++i) 
     485         { 
    490486           clientPrimServer[i]->finalize(); 
     487           bool bufferReleased; 
     488           do 
     489           { 
     490             clientPrimServer[i]->checkBuffers(); 
     491             bufferReleased = !clientPrimServer[i]->havePendingRequests(); 
     492           } while (!bufferReleased); 
     493           clientPrimServer[i]->releaseBuffers(); 
     494         } 
     495            
    491496 
    492497       // (Last) context finalized message received 
     
    494499       { 
    495500         // Blocking send of context finalize message to its client (e.g. primary server or model) 
    496          info(100)<<"DEBUG: context "<<getId()<<" Send client finalize<<"<<endl ; 
     501         info(100)<<"DEBUG: context "<<getId()<<" Send client finalize"<<endl ; 
    497502         client->finalize(); 
     503         info(100)<<"DEBUG: context "<<getId()<<" Client finalize sent"<<endl ; 
    498504         bool bufferReleased; 
    499505         do 
     
    502508           bufferReleased = !client->havePendingRequests(); 
    503509         } while (!bufferReleased); 
     510         client->releaseBuffers(); 
    504511         finalized = true; 
    505  
     512         info(100)<<"DEBUG: context "<<getId()<<" bufferRelease OK"<<endl ; 
     513          
    506514         closeAllFile(); // Just move to here to make sure that server-level 1 can close files 
    507515         if (hasServer && !hasClient) 
     
    512520 
    513521         //! Deallocate client buffers 
    514          client->releaseBuffers(); 
     522//         client->releaseBuffers(); 
     523         info(100)<<"DEBUG: context "<<getId()<<" client release"<<endl ; 
     524 
     525/*          
    515526         for (int i = 0; i < clientPrimServer.size(); ++i) 
    516527           clientPrimServer[i]->releaseBuffers(); 
    517  
     528*/ 
    518529         //! Free internally allocated communicators 
    519530         for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
Note: See TracChangeset for help on using the changeset viewer.