Changeset 1110 for XIOS


Ignore:
Timestamp:
05/02/17 17:03:25 (7 years ago)
Author:
yushan
Message:

redefinition of mpi_any_source and mpi_any_tag

Location:
XIOS/dev/branch_yushan
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/extern/remap/src/mpi_routing.cpp

    r1053 r1110  
    155155        for (int i = 0; i < nbSource; i++) 
    156156        { 
     157                #ifdef _usingEP 
     158                MPI_Irecv(&sourceRank[i], 1, MPI_INT, -1, 0, communicator, &request[indexRequest]); 
     159                #else 
    157160                MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest]); 
     161                #endif 
    158162                indexRequest++; 
    159163        } 
     
    175179        for (int i = 0; i < nbSource; i++) 
    176180        { 
     181                #ifdef _usingEP 
     182                MPI_Irecv(&sourceRank[i], 1, MPI_INT, -1, 0, communicator, &request[indexRequest]); 
     183                #else 
    177184                MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest]); 
     185                #endif 
    178186                indexRequest++; 
    179187        } 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_lib.hpp

    r1068 r1110  
    1515  typedef int MPI_Datatype; 
    1616  typedef int MPI_Op; 
    17   #define MPI_ANY_SOURCE -2  
    18   #define MPI_ANY_TAG -1  
     17  #define EP_ANY_SOURCE -2  
     18  #define EP_ANY_TAG -1  
    1919#elif _openmpi 
    2020  typedef void* MPI_Datatype; 
    2121  typedef void* MPI_Op; 
    22   #define MPI_ANY_SOURCE -1  
    23   #define MPI_ANY_TAG -1  
     22  #define EP_ANY_SOURCE -1  
     23  #define EP_ANY_TAG -1  
    2424#endif 
    2525 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_message.cpp

    r1068 r1110  
    5050      } 
    5151      #elif _intelmpi 
    52       //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status);  
    53       ::MPI_Improbe(-2, -1, mpi_comm, &flag, &message, &status);  
     52      ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status);  
    5453      #endif 
    5554 
     
    129128      } 
    130129      #elif _intelmpi 
    131       //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status);        
    132       ::MPI_Improbe(-2, -1, mpi_comm, &flag, &message, &status);        
     130      ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status);        
    133131      #endif 
    134132 
     
    185183      } 
    186184      #elif _intelmpi 
    187       ::MPI_Improbe(-2, -1, mpi_comm, &flag, &message, &status);        
     185      ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status);        
    188186      #endif 
    189187 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_probe.cpp

    r1060 r1110  
    1616      ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm >(comm.mpi_comm); 
    1717      ::MPI_Status *mpi_status = static_cast< ::MPI_Status* >(status->mpi_status); 
    18       ::MPI_Iprobe(src, tag, mpi_comm, flag, mpi_status); 
     18      ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, mpi_comm, flag, mpi_status); 
    1919 
    2020      status->mpi_status = mpi_status; 
     
    8181      #pragma omp critical (_mpi_call) 
    8282      { 
    83         ::MPI_Iprobe(src, tag, mpi_comm, flag, &mpi_status); 
     83        ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, mpi_comm, flag, &mpi_status); 
    8484        if(*flag) 
    8585        { 
    86           ::MPI_Mprobe(src, tag, mpi_comm, &mpi_message, &mpi_status); 
     86          ::MPI_Mprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, mpi_comm, &mpi_message, &mpi_status); 
    8787        } 
    8888      } 
    8989      #elif _intelmpi 
    90         ::MPI_Improbe(src, tag, mpi_comm, flag, &mpi_message, &mpi_status); 
     90        ::MPI_Improbe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, mpi_comm, flag, &mpi_message, &mpi_status); 
    9191      #endif 
    9292         
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_recv.cpp

    r1053 r1110  
    2525      ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm >(comm.mpi_comm); 
    2626      ::MPI_Status mpi_status; 
    27       ::MPI_Recv(buf, count, static_cast< ::MPI_Datatype >(datatype), src, tag, mpi_comm, &mpi_status); 
     27      ::MPI_Recv(buf, count, static_cast< ::MPI_Datatype >(datatype), src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, mpi_comm, &mpi_status); 
    2828 
    2929      status->ep_src = src; 
     
    5757                  ::MPI_Request mpi_request; 
    5858                  ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm > (comm.mpi_comm); 
    59                   ::MPI_Irecv(buf, count, static_cast< ::MPI_Datatype> (datatype), src, tag, mpi_comm, &mpi_request); 
     59                  ::MPI_Irecv(buf, count, static_cast< ::MPI_Datatype> (datatype), src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, mpi_comm, &mpi_request); 
    6060 
    6161                  request->mpi_request = mpi_request; 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_type.hpp

    r1087 r1110  
    4141namespace ep_lib 
    4242{ 
    43   #define MPI_UNDEFINED -32766 
     43  //#define EP_UNDEFINED -32766 
    4444 
    4545  class ep_communicator; 
  • XIOS/dev/branch_yushan/src/event_scheduler.cpp

    r1037 r1110  
    133133    while(received) 
    134134    { 
     135      #ifdef _usingEP 
     136      MPI_Iprobe(-1,1,communicator,&received, &status) ; 
     137      #else 
    135138      MPI_Iprobe(MPI_ANY_SOURCE,1,communicator,&received, &status) ; 
     139      #endif 
    136140      if (received) 
    137141      { 
    138142        recvRequest=new SPendingRequest ; 
     143        #ifdef _usingEP 
     144        MPI_Irecv(recvRequest->buffer, 3, MPI_UNSIGNED_LONG, -1, 1, communicator, &(recvRequest->request)) ; 
     145        #else 
    139146        MPI_Irecv(recvRequest->buffer, 3, MPI_UNSIGNED_LONG, MPI_ANY_SOURCE, 1, communicator, &(recvRequest->request)) ; 
     147        #endif 
    140148        pendingRecvParentRequest.push(recvRequest) ; 
    141149      } 
     
    175183    while(received) 
    176184    { 
     185      #ifdef _usingEP 
     186      MPI_Iprobe(-1,0,communicator,&received, &status) ; 
     187      #else 
    177188      MPI_Iprobe(MPI_ANY_SOURCE,0,communicator,&received, &status) ; 
     189      #endif 
    178190      if (received) 
    179191      { 
    180192        recvRequest=new SPendingRequest ; 
     193        #ifdef _usingEP 
     194        MPI_Irecv(recvRequest->buffer, 3, MPI_UNSIGNED_LONG, -1, 0, communicator, &recvRequest->request) ; 
     195        #else 
    181196        MPI_Irecv(recvRequest->buffer, 3, MPI_UNSIGNED_LONG, MPI_ANY_SOURCE, 0, communicator, &recvRequest->request) ; 
     197        #endif 
    182198        pendingRecvChildRequest.push_back(recvRequest) ; 
    183199      } 
  • XIOS/dev/branch_yushan/src/server.cpp

    r1085 r1110  
    281281       {       
    282282         traceOff() ; 
     283         #ifdef _usingEP 
     284         MPI_Iprobe(-1,1,CXios::globalComm, &flag, &status) ; 
     285         #else 
    283286         MPI_Iprobe(MPI_ANY_SOURCE,1,CXios::globalComm, &flag, &status) ; 
     287         #endif 
    284288         traceOn() ; 
    285289          
Note: See TracChangeset for help on using the changeset viewer.