Changeset 1142 for XIOS/dev/dev_olga/src
- Timestamp:
- 05/22/17 18:07:59 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/server.cpp
r1139 r1142 88 88 map<unsigned long, int>::iterator it ; 89 89 90 int nbSrv = 0; 90 91 for(i=0,c=0;i<size;i++) 91 92 { … … 96 97 c++ ; 97 98 } 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? 100 102 } 101 103 … … 105 107 { 106 108 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; 108 110 // serverSize_ = lastProcesses - leaders[hashServer]; 109 111 nbPools = serverSize_ * CXios::ratioServer2 / 100; … … 116 118 serverLevel = 2; 117 119 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 119 121 } 120 122 } … … 133 135 MPI_Comm_size(intraComm,&intraCommSize) ; 134 136 MPI_Comm_rank(intraComm,&intraCommRank) ; 135 info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize137 info(50)<<"intercommCreate::server (classical mode) "<<rank_<<" intraCommSize : "<<intraCommSize 136 138 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< clientLeader<<endl ; 137 139 … … 153 155 MPI_Comm_size(intraComm, &intraCommSize) ; 154 156 MPI_Comm_rank(intraComm, &intraCommRank) ; 155 info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize157 info(50)<<"intercommCreate::server (server level 1) "<<rank_<<" intraCommSize : "<<intraCommSize 156 158 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< clientLeader<<endl ; 157 159 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; … … 168 170 MPI_Comm_size(intraComm, &intraCommSize) ; 169 171 MPI_Comm_rank(intraComm, &intraCommRank) ; 170 info(50)<<"intercommCreate::client "<<rank_<<" intraCommSize : "<<intraCommSize172 info(50)<<"intercommCreate::client (server level 1) "<<rank_<<" intraCommSize : "<<intraCommSize 171 173 <<" 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) ; 173 175 interCommRight.push_back(newComm) ; 174 176 } … … 181 183 MPI_Comm_size(intraComm, &intraCommSize) ; 182 184 MPI_Comm_rank(intraComm, &intraCommRank) ; 183 info(50)<<"intercommCreate::server "<<rank_<<" intraCommSize : "<<intraCommSize185 info(50)<<"intercommCreate::server (server level 2) "<<rank_<<" intraCommSize : "<<intraCommSize 184 186 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< clientLeader<<endl ; 185 187 186 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;188 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 1, &newComm) ; 187 189 interCommLeft.push_back(newComm) ; 188 190 } // secondary server
Note: See TracChangeset
for help on using the changeset viewer.