Ignore:
Timestamp:
06/05/18 19:14:40 (6 years ago)
Author:
yushan
Message:

Test_client 6*8 clients 2 servers OK. TO DO : intercomm->intracomm, comm_free_intercomm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp

    r1503 r1522  
    66namespace ep_lib 
    77{ 
     8  int MPI_Iprobe_mpi(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 
     9  { 
     10    status->ep_src = src; 
     11    status->ep_tag = tag; 
     12    return ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, to_mpi_status_ptr(*status)); 
     13  } 
    814 
    915  int MPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 
    1016  { 
    11     *flag = false; 
    12  
    1317    if(!comm->is_ep) 
    1418    { 
    15       Debug("calling MPI_Iprobe MPI\n"); 
    16       ::MPI_Status mpi_status; 
    17       ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_status); 
     19      Debug("MPI_Iprobe with MPI\n"); 
     20      return MPI_Iprobe_mpi(src, tag, comm, flag, status); 
     21    } 
     22     
     23    else 
     24    { 
     25      Debug("MPI_Iprobe with EP\n"); 
     26       
     27      *flag = false; 
     28     
     29      Message_Check(comm); 
    1830 
    19       status->mpi_status = &mpi_status; 
    20       status->ep_src = src; 
    21       status->ep_tag = tag; 
    22       return 0; 
    23     } 
     31      #pragma omp flush 
    2432 
    25     Debug("calling MPI_Iprobe EP\n"); 
    26     Message_Check(comm); 
    27  
    28     #pragma omp flush 
    29  
    30     #pragma omp critical (_query) 
    31     if(!comm->ep_comm_ptr->message_queue->empty()) 
    32     { 
     33      #pragma omp critical (_query) 
    3334      for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 
    3435      { 
     
    3940        { 
    4041          Debug("find message\n"); 
    41           *flag = true; 
     42           
    4243 
    43           ::MPI_Status mpi_status = *(static_cast< ::MPI_Status *>((*it)->mpi_status)); 
    44  
    45           status->mpi_status = (*it)->mpi_status; 
     44          status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 
    4645          status->ep_src = (*it)->ep_src; 
    4746          status->ep_tag = (*it)->ep_tag; 
    4847 
     48          *flag = true; 
    4949          break; 
    5050        } 
    5151      } 
    5252    } 
    53  
    54     return 0; 
    5553  } 
    5654 
Note: See TracChangeset for help on using the changeset viewer.