Changeset 1077 for XIOS/dev/dev_olga


Ignore:
Timestamp:
03/17/17 15:05:36 (7 years ago)
Author:
oabramkina
Message:

dev: Intermediate commit

Done:
Registries: ok with two server levels

To do (on a single server level):
test_complete
reading

Location:
XIOS/dev/dev_olga/src
Files:
8 edited

Legend:

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

    r1071 r1077  
    8080    { 
    8181      traceOff(); 
    82       MPI_Test(&request, &flag, &status); 
     82      MPI_Errhandler_set(interComm,MPI_ERRORS_RETURN); 
     83      error=MPI_Test(&request, &flag, &status); 
     84      if (error != MPI_SUCCESS) 
     85      { 
     86        MPI_Error_class(error, &errclass); 
     87        MPI_Error_string(error, errstring, &len); 
     88        ERROR("MPI error class: ", <<errclass<<" MPI error "<<errstring ); 
     89      } 
    8390      traceOn(); 
    8491      if (flag == true) pending = false; 
  • XIOS/dev/dev_olga/src/context_client.cpp

    r1071 r1077  
    264264   { 
    265265      map<int,CClientBuffer*>::iterator itBuff; 
    266       for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) delete itBuff->second; 
    267 //        buffersReleased_ = true; 
     266      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) 
     267          delete itBuff->second; 
     268      buffers.clear(); 
    268269   } 
    269270 
  • XIOS/dev/dev_olga/src/context_client.hpp

    r1071 r1077  
    7979      StdSize maxBufferedEvents; 
    8080 
    81 //      bool buffersReleased_; 
    82  
    8381      struct { 
    8482        std::list<int> ranks, sizes; 
  • XIOS/dev/dev_olga/src/cxios.hpp

    r1054 r1077  
    2929     static string rootFile ; //!< Configuration filename 
    3030     static string xiosCodeId ; //!< Identity for XIOS 
    31 //     static string xiosCodeIdPrm ; //!< Identity for XIOS primary server 
    32 //     static string xiosCodeIdSnd ; //!< Identity for XIOS secondary server 
    3331     static string clientFile;        //!< Filename template for client 
    3432     static string serverFile;        //!< Filename template for server 
  • XIOS/dev/dev_olga/src/node/context.cpp

    r1071 r1077  
    460460         if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ; 
    461461       } 
    462  
    463 //       for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
    464 //         MPI_Comm_free(&(*it)); 
    465 //       comms.clear(); 
    466  
    467462      } 
    468463   } 
     464 
    469465   //! Free internally allocated communicators 
    470466   void CContext::freeComms(void) 
     
    562558   void CContext::closeDefinition(void) 
    563559   { 
    564      // There is nothing client need to send to server 
    565 //      if (hasClient) 
    566 //     if (hasClient && !hasServer) 
    567 //      if (hasClient) 
    568 //      { 
    569 //        // After xml is parsed, there are some more works with post processing 
    570 //        postProcessing(); 
    571 //      } 
    572  
    573 //      setClientServerBuffer(); 
    574  
    575 // //     if (hasClient && !hasServer) 
    576 //      if (hasClient) 
    577 //      { 
    578 //       // Send all attributes of current context to server 
    579 //       this->sendAllAttributesToServer(); 
    580  
    581 //       // Send all attributes of current calendar 
    582 //       CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(); 
    583  
    584 //       // We have enough information to send to server 
    585 //       // First of all, send all enabled files 
    586 //        sendEnabledFiles(); 
    587  
    588 //       // Then, send all enabled fields 
    589 //        sendEnabledFields(); 
    590  
    591 //       // At last, we have all info of domain and axis, then send them 
    592 //        sendRefDomainsAxis(); 
    593  
    594 //       // After that, send all grid (if any) 
    595 //        sendRefGrid(); 
    596  
    597 //        // // We have a xml tree on the server side and now, it should be also processed 
    598 //        sendPostProcessing(); 
    599 //      } 
    600  
    601  
    602      // Now tell server that it can process all messages from client 
    603      // if (hasClient) this->sendCloseDefinition(); 
    604560    postProcessingGlobalAttributes(); 
    605561 
     
    611567     if (hasClient && !hasServer) 
    612568    { 
    613       // this->buildFilterGraphOfEnabledFields();  // references are resolved here (access xml file) 
    614569      buildFilterGraphOfFieldsWithReadAccess(); 
    615       // this->solveAllRefOfEnabledFields(true); 
    616570    } 
    617571 
     
    619573    this->processGridEnabledFields(); 
    620574    if (hasClient) this->sendProcessingGridOfEnabledFields(); 
    621     // if (hasClient)        // We have a xml tree on the server side and now, it should be also processed 
    622     //    sendPostProcessing(); 
    623 //    // Now tell server that it can process all messages from client 
    624 ////    if (hasClient && !hasServer) this->sendCloseDefinition(); 
    625    if (hasClient) this->sendCloseDefinition(); 
     575    if (hasClient) this->sendCloseDefinition(); 
    626576 
    627577    // Nettoyage de l'arborescence 
    628 //    if (hasClient && !hasServer) CleanTree(); // Only on client side?? 
    629578    if (hasClient) CleanTree(); // Only on client side?? 
    630579 
  • XIOS/dev/dev_olga/src/node/grid.cpp

    r1054 r1077  
    19491949    { 
    19501950      CDomain* pDom = CDomain::get(*it); 
    1951       // if (context->hasClient && !context->hasServer) 
    1952      if (context->hasClient) 
     1951      if (context->hasClient && !context->hasServer) 
     1952      //if (context->hasClient) 
    19531953      { 
    19541954        pDom->solveRefInheritance(apply); 
     
    19621962    { 
    19631963      CAxis* pAxis = CAxis::get(*it); 
    1964       // if (context->hasClient && !context->hasServer) 
    1965      if (context->hasClient) 
     1964      if (context->hasClient && !context->hasServer) 
     1965//     if (context->hasClient) 
    19661966      { 
    19671967        pAxis->solveRefInheritance(apply); 
     
    19751975    { 
    19761976      CScalar* pScalar = CScalar::get(*it); 
    1977       // if (context->hasClient && !context->hasServer) 
    1978      if (context->hasClient) 
     1977      if (context->hasClient && !context->hasServer) 
     1978//     if (context->hasClient) 
    19791979      { 
    19801980        pScalar->solveRefInheritance(apply); 
  • XIOS/dev/dev_olga/src/server.cpp

    r1071 r1077  
    3030    int CServer::nbContexts_ = 0; 
    3131    bool CServer::isRoot = false ; 
    32     int CServer::rank = INVALID_RANK; 
     32    int CServer::rank_ = INVALID_RANK; 
    3333    StdOFStream CServer::m_infoStream; 
    3434    StdOFStream CServer::m_errorStream; 
     
    8181 
    8282        MPI_Comm_size(CXios::globalComm, &size) ; 
    83         MPI_Comm_rank(CXios::globalComm, &rank); 
     83        MPI_Comm_rank(CXios::globalComm, &rank_); 
    8484 
    8585        hashAll=new unsigned long[size] ; 
     
    104104        if (CXios::usingServer2) 
    105105        { 
    106           int serverRank = rank - leaders[hashServer]; // server proc rank starting 0 
     106          int serverRank = rank_ - leaders[hashServer]; // server proc rank starting 0 
    107107          serverSize_ = size - leaders[hashServer]; 
    108108          nbPools = serverSize_ * CXios::ratioServer2 / 100; 
     
    115115            serverLevel = 2; 
    116116            poolId = serverRank - serverSize_ + nbPools; 
    117             myColor = rank; 
     117            myColor = rank_; 
    118118          } 
    119119        } 
    120120 
    121         MPI_Comm_split(CXios::globalComm, myColor, rank, &intraComm) ; 
     121        MPI_Comm_split(CXios::globalComm, myColor, rank_, &intraComm) ; 
    122122 
    123123        if (serverLevel == 0) 
     
    132132              MPI_Comm_size(intraComm,&intraCommSize) ; 
    133133              MPI_Comm_rank(intraComm,&intraCommRank) ; 
    134               info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 
     134              info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize 
    135135                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    136136 
     
    152152              MPI_Comm_size(intraComm, &intraCommSize) ; 
    153153              MPI_Comm_rank(intraComm, &intraCommRank) ; 
    154               info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 
     154              info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize 
    155155                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    156156              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
     
    167167            MPI_Comm_size(intraComm, &intraCommSize) ; 
    168168            MPI_Comm_rank(intraComm, &intraCommRank) ; 
    169             info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 
     169            info(50)<<"intercommCreate::client "<<rank_<<" intraCommSize : "<<intraCommSize 
    170170                <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< srvSndLeader<<endl ; 
    171171            MPI_Intercomm_create(intraComm, 0, CXios::globalComm, srvSndLeader, 0, &newComm) ; 
     
    180180          MPI_Comm_size(intraComm, &intraCommSize) ; 
    181181          MPI_Comm_rank(intraComm, &intraCommRank) ; 
    182           info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 
     182          info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize 
    183183                   <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    184184 
     
    202202        MPI_Comm_dup(localComm, &intraComm); 
    203203 
    204         MPI_Comm_rank(intraComm,&rank) ; 
     204        MPI_Comm_rank(intraComm,&rank_) ; 
    205205        MPI_Comm_size(intraComm,&size) ; 
    206206        string codesId=CXios::getin<string>("oasis_codes_id") ; 
     
    217217        { 
    218218          oasis_get_intercomm(newComm,*it) ; 
    219           if (rank==0) MPI_Send(&globalRank,1,MPI_INT,0,0,newComm) ; 
     219          if (rank_==0) MPI_Send(&globalRank,1,MPI_INT,0,0,newComm) ; 
    220220          MPI_Comm_remote_size(newComm,&size); 
    221221//          interComm.push_back(newComm) ; 
     
    225225      } 
    226226 
    227       int rankServer; 
    228       MPI_Comm_rank(intraComm, &rankServer) ; 
    229       if (rankServer==0) isRoot=true; 
     227      MPI_Comm_rank(intraComm, &rank_) ; 
     228      if (rank_==0) isRoot=true; 
    230229      else isRoot=false; 
    231230       
     
    249248//        MPI_Comm_free(&(*it)); 
    250249 
    251         for (std::list<MPI_Comm>::iterator it = interCommLeft.begin(); it != interCommLeft.end(); it++) 
    252           MPI_Comm_free(&(*it)); 
     250//        for (std::list<MPI_Comm>::iterator it = interCommLeft.begin(); it != interCommLeft.end(); it++) 
     251//          MPI_Comm_free(&(*it)); 
    253252 
    254253        for (std::list<MPI_Comm>::iterator it = interCommRight.begin(); it != interCommRight.end(); it++) 
     
    524523         { 
    525524           StdString str = contextId +"_server_" + boost::lexical_cast<string>(i); 
    526            msg<<str<<size<<rank ; 
     525           msg<<str<<size<<rank_ ; 
    527526           messageSize = msg.size() ; 
    528527           buff = new char[messageSize] ; 
     
    555554         if (finished) 
    556555         { 
    557 //           it->second->freeComms();  // deallocate internally allcoated context communicators 
     556           it->second->freeComms();  // deallocate internally allocated context communicators 
    558557           contextList.erase(it) ; 
    559558           break ; 
    560559         } 
    561560         else 
    562          { 
    563561           finished=it->second->checkBuffersAndListen(); 
    564          } 
    565562       } 
    566563     } 
     
    569566     int CServer::getRank() 
    570567     { 
    571        return rank; 
     568       return rank_; 
    572569     } 
    573570 
     
    598595      { 
    599596        if (serverLevel == 1) 
    600           id = rank-serverLeader_; 
     597          id = rank_; 
    601598        else 
    602599          id = poolId; 
  • XIOS/dev/dev_olga/src/server.hpp

    r1071 r1077  
    6464 
    6565      private: 
    66         static int rank; 
     66        static int rank_; 
    6767        static int serverLeader_;  //!< Leader of the classical or primary server (needed in case of secondary servers) 
    6868        static int serverSize_;    //!< Number of procs dedicated to servers (primary and seconday (if any) combined) 
Note: See TracChangeset for help on using the changeset viewer.