Changeset 1347


Ignore:
Timestamp:
11/27/17 13:46:40 (6 years ago)
Author:
yushan
Message:

dev omp from Ada

Location:
XIOS/dev/branch_openmp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp

    r1295 r1347  
    5252      } 
    5353      #elif _intelmpi 
    54       ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status);  
     54      #pragma omp critical (_mpi_call) 
     55      { 
     56        ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status); 
     57        if(flag) 
     58        { 
     59          Debug("find message in mpi comm \n"); 
     60          mpi_source = status.MPI_SOURCE; 
     61          int tag = status.MPI_TAG; 
     62          ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status); 
     63 
     64        } 
     65      } 
     66      //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status);  
    5567      #endif 
    5668       
     
    120132      } 
    121133      #elif _intelmpi 
    122       ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &message, &status);        
     134      #pragma omp critical (_mpi_call) 
     135      { 
     136        ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &status); 
     137        if(flag) 
     138        { 
     139          Debug("find message in mpi comm \n"); 
     140          mpi_source = status.MPI_SOURCE; 
     141          int tag = status.MPI_TAG; 
     142          ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &message, &status); 
     143 
     144        } 
     145      } 
     146      //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &message, &status);        
    123147      #endif 
    124148 
     
    175199      } 
    176200      #elif _intelmpi 
    177       ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status);        
     201      #pragma omp critical (_mpi_call) 
     202      { 
     203        ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status); 
     204        if(flag) 
     205        { 
     206          Debug("find message in mpi comm \n"); 
     207          mpi_source = status.MPI_SOURCE; 
     208          int tag = status.MPI_TAG; 
     209          ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status); 
     210 
     211        } 
     212      } 
     213      //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status);        
    178214      #endif 
    179215 
  • XIOS/dev/branch_openmp/src/client.cpp

    r1342 r1347  
    100100            MPI_Comm_size(intraComm,&intraCommSize) ; 
    101101            MPI_Comm_rank(intraComm,&intraCommRank) ; 
    102             info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 
    103                  <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ; 
     102            #pragma omp critical (_output) 
     103            { 
     104              info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 
     105                      <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader<<endl ; 
     106            } 
    104107            MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 
    105108          } 
     
    185188 
    186189        MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 
     190        #pragma omp critical (_output) 
     191        std::cout<<"client "<<rank<<" send to server "<<serverLeader << buffer.count() <<"message with tag 1" << std::endl; 
    187192        delete [] buff ; 
     193 
     194        //MPI_Barrier(CXios::globalComm); 
    188195 
    189196        MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 
  • XIOS/dev/branch_openmp/src/server.cpp

    r1328 r1347  
    9292             MPI_Comm_size(intraComm,&intraCommSize) ; 
    9393             MPI_Comm_rank(intraComm,&intraCommRank) ; 
    94              info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 
    95                      <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    96  
     94             #pragma omp critical (_output) 
     95             { 
     96               info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 
     97                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
     98             } 
    9799             MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ; 
    98100             interComm.push_back(newComm) ; 
     
    391393 
    392394       MPI_Comm contextIntercomm; 
     395       //MPI_Barrier(CXios::globalComm); 
     396        
    393397       MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm); 
    394398 
Note: See TracChangeset for help on using the changeset viewer.