Ignore:
Timestamp:
01/25/17 16:25:17 (7 years ago)
Author:
yushan
Message:

initialize the branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/src/client.cpp

    r1032 r1037  
    3030      if (initialized) is_MPI_Initialized=true ; 
    3131      else is_MPI_Initialized=false ; 
     32       
     33      //return; 
    3234 
    3335// don't use OASIS 
     
    8789 
    8890          MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ; 
     91         
    8992 
    9093          if (CXios::usingServer) 
     
    97100            MPI_Comm_rank(intraComm,&intraCommRank) ; 
    98101            info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 
    99                  <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ; 
     102                 <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader<<endl ; 
    100103            MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 
    101104          } 
     
    148151 
    149152      MPI_Comm_dup(intraComm,&returnComm) ; 
     153 
    150154    } 
    151155 
     
    160164      if (!CXios::isServer) 
    161165      { 
     166       
     167         
     168         
    162169        int size,rank,globalRank ; 
    163170        size_t message_size ; 
     
    165172        MPI_Comm contextInterComm ; 
    166173 
     174         
    167175        MPI_Comm_size(contextComm,&size) ; 
    168176        MPI_Comm_rank(contextComm,&rank) ; 
     
    173181        CMessage msg ; 
    174182        msg<<idServer<<size<<globalRank ; 
    175 //        msg<<id<<size<<globalRank ; 
     183 
    176184 
    177185        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) ; 
    180188        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) ; 
    183193        delete [] buff ; 
     194         
     195        printf("====== Client: begin context_init \n"); 
     196       
    184197 
    185198        MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 
    186199        info(10)<<"Register new Context : "<<id<<endl ; 
     200         
     201        cout<<"Register new Context : "<<id<<endl ; 
     202               
    187203 
    188204        MPI_Comm inter ; 
    189205        MPI_Intercomm_merge(contextInterComm,0,&inter) ; 
    190206        MPI_Barrier(inter) ; 
    191  
     207         
     208         
    192209        context->initClient(contextComm,contextInterComm) ; 
     210         
     211        printf("====== Client: context_init OK\n"); 
    193212 
    194213        contextInterComms.push_back(contextInterComm); 
     
    220239 
    221240      MPI_Comm_rank(intraComm,&rank) ; 
     241       
     242      printf("CClient::finalize called isServer = %d\n", CXios::isServer); 
    222243  
    223244      if (!CXios::isServer) 
     
    227248        { 
    228249          MPI_Send(&msg,1,MPI_INT,0,0,interComm) ; 
     250          printf(" CClient : send finalize sign to server 0\n"); 
    229251        } 
    230252      } 
     
    241263      { 
    242264        if (CXios::usingOasis) oasis_finalize(); 
    243         else MPI_Finalize() ; 
     265        else {MPI_Finalize() ; printf("CClient::finalize called MPI_finalize\n");} 
    244266      } 
    245267       
Note: See TracChangeset for help on using the changeset viewer.