Ignore:
Timestamp:
06/18/18 20:32:55 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with trunk r1544

File:
1 edited

Legend:

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

    r1533 r1545  
    3939 * \fn void CServer::initialize(void) 
    4040 * Creates intraComm for each possible type of servers (classical, primary or secondary). 
    41  * (For now the assumption is that there is one proc per secondary server pool.) 
    4241 * Creates interComm and stores them into the following lists: 
    4342 *   classical server -- interCommLeft 
     
    111110          else 
    112111          { 
     112            if (CXios::nbPoolsServer2 == 0) CXios::nbPoolsServer2 = reqNbProc; 
    113113            int firstSndSrvRank = srvRanks.size()*(100.-CXios::ratioServer2)/100. ; 
    114114            int poolLeader = firstSndSrvRank; 
    115115//*********** (1) Comment out the line below to set one process per pool 
    116 //            sndServerGlobalRanks.push_back(srvRanks[poolLeader]); 
     116            sndServerGlobalRanks.push_back(srvRanks[poolLeader]); 
    117117            int nbPools = CXios::nbPoolsServer2; 
    118118            if ( nbPools > reqNbProc || nbPools < 1) 
     
    140140                } 
    141141//*********** (2) Comment out the two lines below to set one process per pool 
    142 //                if (poolLeader < srvRanks.size()) 
    143 //                  sndServerGlobalRanks.push_back(srvRanks[poolLeader]); 
     142                if (poolLeader < srvRanks.size()) 
     143                  sndServerGlobalRanks.push_back(srvRanks[poolLeader]); 
    144144//*********** (3) Uncomment the line below to set one process per pool 
    145                 sndServerGlobalRanks.push_back(srvRanks[i]); 
     145//                sndServerGlobalRanks.push_back(srvRanks[i]); 
    146146              } 
    147147              else 
     
    189189              MPI_Comm_size(intraComm,&intraCommSize) ; 
    190190              MPI_Comm_rank(intraComm,&intraCommRank) ; 
     191 
     192              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
    191193              #pragma omp critical (_output) 
    192194              { 
     
    195197              } 
    196198 
    197               MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
     199               
    198200              interCommLeft.push_back(newComm) ; 
    199201            } 
     
    213215              MPI_Comm_size(intraComm, &intraCommSize) ; 
    214216              MPI_Comm_rank(intraComm, &intraCommRank) ; 
     217               
     218              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
    215219              #pragma omp critical (_output) 
    216220              { 
     
    218222                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    219223              } 
    220               MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 
     224 
    221225              interCommLeft.push_back(newComm) ; 
    222226            } 
     
    228232            MPI_Comm_size(intraComm, &intraCommSize) ; 
    229233            MPI_Comm_rank(intraComm, &intraCommRank) ; 
     234 
     235            MPI_Intercomm_create(intraComm, 0, CXios::globalComm, sndServerGlobalRanks[i], 1, &newComm) ; 
    230236            #pragma omp critical (_output) 
    231237            { 
     
    233239                <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< sndServerGlobalRanks[i]<<endl ; 
    234240            } 
    235             MPI_Intercomm_create(intraComm, 0, CXios::globalComm, sndServerGlobalRanks[i], 1, &newComm) ; 
     241 
    236242            interCommRight.push_back(newComm) ; 
    237243          } 
     
    244250          MPI_Comm_size(intraComm, &intraCommSize) ; 
    245251          MPI_Comm_rank(intraComm, &intraCommRank) ; 
     252 
     253          MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 1, &newComm) ; 
    246254          #pragma omp critical (_output) 
    247255          { 
     
    250258          } 
    251259 
    252           MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 1, &newComm) ; 
    253260          interCommLeft.push_back(newComm) ; 
    254261        } 
     
    654661       if (flag==true) 
    655662       { 
    656          int my_count; 
    657663         counts.push_back(0); 
    658664         MPI_Get_count(&status,MPI_CHAR,&(counts.back())) ; 
    659665         buffers.push_back(new char[counts.back()]) ; 
    660          //requests.push_back(request); 
    661          //MPI_Irecv((void*)(buffers.back()),counts.back(),MPI_CHAR,root,2,intraComm,&(requests.back())) ; 
    662666         MPI_Irecv((void*)(buffers.back()),counts.back(),MPI_CHAR,root,2,intraComm,&request) ; 
    663667         requests.push_back(request); 
     
    817821      if (!fb->is_open()) 
    818822        ERROR("void CServer::openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb)", 
    819               << std::endl << "Can not open <" << fileNameClient << "> file to write the server log(s)."); 
     823              << std::endl << "Can not open <" << fileNameClient.str() << "> file to write the server log(s)."); 
    820824    } 
    821825 
Note: See TracChangeset for help on using the changeset viewer.