Ignore:
Timestamp:
05/22/17 18:07:59 (4 years ago)
Author:
mhnguyen
Message:

Correcting a minor bug on initialization.

+) Make sure that color of each group (client, servers) are unique and different from others
+) Modify some message to make them clearer

Test
+) On Curie
+) test_complete:

  • Mode: classical and 2 level server
  • config: 4 clients + 4 servers
  • passed
File:
1 edited

Legend:

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

    r1139 r1142  
    8888        map<unsigned long, int>::iterator it ; 
    8989 
     90        int nbSrv = 0; 
    9091        for(i=0,c=0;i<size;i++) 
    9192        { 
     
    9697            c++ ; 
    9798          } 
    98           if (hashAll[i+1] != hashAll[i]) 
    99             lastProcesses[hashAll[i]]=i ; 
     99          if (hashAll[i] == hashServer) ++nbSrv; 
     100          //if (hashAll[i+1] != hashAll[i])  // Potential bug here! 
     101          //  lastProcesses[hashAll[i]]=i ; // It seems that lastprocesses is only used for calculating the server size. Can we count server size directly? 
    100102        } 
    101103 
     
    105107        { 
    106108          int serverRank = rank_ - leaders[hashServer]; // server proc rank starting 0 
    107           serverSize_ = lastProcesses[hashServer] - leaders[hashServer] + 1; 
     109          serverSize_ = nbSrv; //lastProcesses[hashServer] - leaders[hashServer] + 1; 
    108110//          serverSize_ = lastProcesses - leaders[hashServer]; 
    109111          nbPools = serverSize_ * CXios::ratioServer2 / 100; 
     
    116118            serverLevel = 2; 
    117119            poolId = serverRank - serverSize_ + nbPools; 
    118             myColor = rank_; 
     120            myColor = rank_ + size; // + size to make sure that myColor is unique among not only servers but also clients. It's only a temporary solution 
    119121          } 
    120122        } 
     
    133135              MPI_Comm_size(intraComm,&intraCommSize) ; 
    134136              MPI_Comm_rank(intraComm,&intraCommRank) ; 
    135               info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize 
     137              info(50)<<"intercommCreate::server (classical mode) "<<rank_<<" intraCommSize : "<<intraCommSize 
    136138                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    137139 
     
    153155              MPI_Comm_size(intraComm, &intraCommSize) ; 
    154156              MPI_Comm_rank(intraComm, &intraCommRank) ; 
    155               info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize 
     157              info(50)<<"intercommCreate::server (server level 1) "<<rank_<<" intraCommSize : "<<intraCommSize 
    156158                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    157159              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
     
    168170            MPI_Comm_size(intraComm, &intraCommSize) ; 
    169171            MPI_Comm_rank(intraComm, &intraCommRank) ; 
    170             info(50)<<"intercommCreate::client "<<rank_<<" intraCommSize : "<<intraCommSize 
     172            info(50)<<"intercommCreate::client (server level 1) "<<rank_<<" intraCommSize : "<<intraCommSize 
    171173                <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< srvSndLeader<<endl ; 
    172             MPI_Intercomm_create(intraComm, 0, CXios::globalComm, srvSndLeader, 0, &newComm) ; 
     174            MPI_Intercomm_create(intraComm, 0, CXios::globalComm, srvSndLeader, 1, &newComm) ; 
    173175            interCommRight.push_back(newComm) ; 
    174176          } 
     
    181183          MPI_Comm_size(intraComm, &intraCommSize) ; 
    182184          MPI_Comm_rank(intraComm, &intraCommRank) ; 
    183           info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize 
     185          info(50)<<"intercommCreate::server (server level 2) "<<rank_<<" intraCommSize : "<<intraCommSize 
    184186                   <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    185187 
    186           MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
     188          MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 1, &newComm) ; 
    187189          interCommLeft.push_back(newComm) ; 
    188190        } // secondary server 
Note: See TracChangeset for help on using the changeset viewer.