Changeset 1037 for XIOS/dev/branch_yushan/src/client.cpp
- Timestamp:
- 01/25/17 16:25:17 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/src/client.cpp
r1032 r1037 30 30 if (initialized) is_MPI_Initialized=true ; 31 31 else is_MPI_Initialized=false ; 32 33 //return; 32 34 33 35 // don't use OASIS … … 87 89 88 90 MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ; 91 89 92 90 93 if (CXios::usingServer) … … 97 100 MPI_Comm_rank(intraComm,&intraCommRank) ; 98 101 info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 99 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< serverLeader<<endl ;102 <<" intraCommRank :"<<intraCommRank<<" serverLeader "<< serverLeader<<endl ; 100 103 MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 101 104 } … … 148 151 149 152 MPI_Comm_dup(intraComm,&returnComm) ; 153 150 154 } 151 155 … … 160 164 if (!CXios::isServer) 161 165 { 166 167 168 162 169 int size,rank,globalRank ; 163 170 size_t message_size ; … … 165 172 MPI_Comm contextInterComm ; 166 173 174 167 175 MPI_Comm_size(contextComm,&size) ; 168 176 MPI_Comm_rank(contextComm,&rank) ; … … 173 181 CMessage msg ; 174 182 msg<<idServer<<size<<globalRank ; 175 // msg<<id<<size<<globalRank ; 183 176 184 177 185 int messageSize=msg.size() ; 178 char* buff = new char[messageSize] ;179 CBufferOut buffer( (void*)buff,messageSize) ;186 void * buff = new char[messageSize] ; 187 CBufferOut buffer(buff,messageSize) ; 180 188 buffer<<msg ; 181 182 MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 189 190 191 192 MPI_Send(buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 183 193 delete [] buff ; 194 195 printf("====== Client: begin context_init \n"); 196 184 197 185 198 MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 186 199 info(10)<<"Register new Context : "<<id<<endl ; 200 201 cout<<"Register new Context : "<<id<<endl ; 202 187 203 188 204 MPI_Comm inter ; 189 205 MPI_Intercomm_merge(contextInterComm,0,&inter) ; 190 206 MPI_Barrier(inter) ; 191 207 208 192 209 context->initClient(contextComm,contextInterComm) ; 210 211 printf("====== Client: context_init OK\n"); 193 212 194 213 contextInterComms.push_back(contextInterComm); … … 220 239 221 240 MPI_Comm_rank(intraComm,&rank) ; 241 242 printf("CClient::finalize called isServer = %d\n", CXios::isServer); 222 243 223 244 if (!CXios::isServer) … … 227 248 { 228 249 MPI_Send(&msg,1,MPI_INT,0,0,interComm) ; 250 printf(" CClient : send finalize sign to server 0\n"); 229 251 } 230 252 } … … 241 263 { 242 264 if (CXios::usingOasis) oasis_finalize(); 243 else MPI_Finalize() ;265 else {MPI_Finalize() ; printf("CClient::finalize called MPI_finalize\n");} 244 266 } 245 267
Note: See TracChangeset
for help on using the changeset viewer.