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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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; 
Note: See TracChangeset for help on using the changeset viewer.