Changeset 1374


Ignore:
Timestamp:
12/13/17 15:12:08 (4 years ago)
Author:
yushan
Message:

unify type : MPI_Request

Location:
XIOS/dev/branch_openmp
Files:
7 edited

Legend:

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

    r1362 r1374  
    3737      Debug("Message probing for intracomm\n"); 
    3838       
    39  
    40       //#ifdef _openmpi 
    4139      #pragma omp critical (_mpi_call) 
    4240      { 
     
    5149        } 
    5250      } 
    53       //#elif _intelmpi 
    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       //#endif 
     51 
    6652       
    6753      if(flag) 
     
    9076        } 
    9177         
    92         delete msg_block;         
     78        delete msg_block; 
    9379      } 
    9480 
     
    117103      Debug("Message probing for intracomm\n"); 
    118104 
    119       //#ifdef _openmpi 
    120105      #pragma omp critical (_mpi_call) 
    121106      { 
     
    170155      Debug("Message probing for intracomm\n"); 
    171156      
    172       //#ifdef _openmpi 
    173157      #pragma omp critical (_mpi_call) 
    174158      { 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_recv.cpp

    r1373 r1374  
    101101 
    102102    ::MPI_Request mpi_request; 
    103     //::MPI_Message mpi_message = *(static_cast< ::MPI_Message* >(message->mpi_message)); 
    104103    ::MPI_Imrecv(buf, count, to_mpi_type(datatype), static_cast< ::MPI_Message* >(message->mpi_message), &mpi_request);          
    105     //::MPI_Imrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_request); 
    106104 
    107105    request->mpi_request = new ::MPI_Request(mpi_request); 
     
    121119 
    122120    ::MPI_Status mpi_status; 
    123     //::MPI_Message mpi_message = *(static_cast< ::MPI_Message* >(message->mpi_message)); 
    124121    ::MPI_Mrecv(buf, count, to_mpi_type(datatype), static_cast< ::MPI_Message* >(message->mpi_message), &mpi_status); 
    125     //::MPI_Mrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_status); 
    126122 
    127123    status->mpi_status = new ::MPI_Status(mpi_status); 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_test.cpp

    r1373 r1374  
    2525    { 
    2626      ::MPI_Status mpi_status; 
    27       ::MPI_Test((request->mpi_request), flag, &mpi_status); 
     27      ::MPI_Test(static_cast< ::MPI_Request*>(request->mpi_request), flag, &mpi_status); 
    2828       
    2929      if(*flag)  
     
    5050      ::MPI_Status mpi_status; 
    5151       
    52       ::MPI_Test((request->mpi_request), flag, &mpi_status); 
     52      ::MPI_Test(static_cast< ::MPI_Request*>(request->mpi_request), flag, &mpi_status); 
    5353       
    5454       
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp

    r1373 r1374  
    6767  } 
    6868   
    69   MPI_Request::MPI_Request(int* request) 
     69  MPI_Request::MPI_Request(void* request) 
    7070  { 
    71     //mpi_request = request; 
    72     mpi_request = new int; 
    73     *mpi_request = *request; 
    74   } 
    75    
    76 //  MPI_Request::MPI_Request(void* request) 
    77 //  { 
    78 //    //mpi_request = request; 
    79 //    mpi_request = new int; 
    80 //    static_cast< ::MPI_Request>(*mpi_request) = *(static_cast< ::MPI_Request*>(request); 
    81 //  } 
    82    
    83   MPI_Request::MPI_Request() 
    84   { 
    85     //mpi_request = request; 
    86     mpi_request = new int; 
    87     //*(static_cast< ::MPI_Request*>(mpi_request)) = *(static_cast< ::MPI_Request*>(request)); 
     71    mpi_request = new ::MPI_Request; 
     72    *(static_cast< ::MPI_Request*>(mpi_request)) = *static_cast< ::MPI_Request*>(request); 
    8873  } 
    8974   
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp

    r1373 r1374  
    230230    public: 
    231231 
    232       int* mpi_request; 
     232      void* mpi_request; 
    233233 
    234234      int type; //! type of the non-blocking communication. 1: Isend; 2:Irecv; 3:Imrecv; 4:Issend 
     
    241241      MPI_Comm comm;    //! EP communicator related to the communication 
    242242 
    243       MPI_Request(); 
    244       MPI_Request(int* request); 
     243      MPI_Request() {} 
     244      MPI_Request(void* request); 
    245245      bool operator == (MPI_Request right); 
    246246 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_wait.cpp

    r1373 r1374  
    3434    //::MPI_Request mpi_request = static_cast< ::MPI_Request >(request->mpi_request); 
    3535    ::MPI_Status mpi_status; 
    36     ::MPI_Wait((request->mpi_request), &mpi_status); 
     36    ::MPI_Wait(static_cast< ::MPI_Request*>(request->mpi_request), &mpi_status); 
    3737 
    3838    
     
    8181          finished.at(i) = 1; 
    8282          //mpi_request[i] = static_cast< ::MPI_Request >(array_of_requests[i].mpi_request); 
    83           mpi_request[i] = *(array_of_requests[i].mpi_request); 
     83          mpi_request[i] = *static_cast< ::MPI_Request*>(array_of_requests[i].mpi_request); 
    8484        } 
    8585      }     
  • XIOS/dev/branch_openmp/src/client.cpp

    r1347 r1374  
    188188 
    189189        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; 
     190 
    192191        delete [] buff ; 
    193192 
Note: See TracChangeset for help on using the changeset viewer.