Ignore:
Timestamp:
05/28/18 17:28:07 (4 years ago)
Author:
yushan
Message:

rank_map is passed from vector to map, in order to have more flexibility in comm_split

File:
1 edited

Legend:

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

    r1500 r1503  
    1313    if(!comm->is_ep) 
    1414    { 
    15       ::MPI_Status *mpi_status = static_cast< ::MPI_Status* >(status->mpi_status); 
    16       ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, mpi_status); 
     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); 
    1718 
    18       status->mpi_status = mpi_status; 
     19      status->mpi_status = &mpi_status; 
    1920      status->ep_src = src; 
    2021      status->ep_tag = tag; 
     
    2324 
    2425    Debug("calling MPI_Iprobe EP\n"); 
    25  
    2626    Message_Check(comm); 
    2727 
     
    4343          ::MPI_Status mpi_status = *(static_cast< ::MPI_Status *>((*it)->mpi_status)); 
    4444 
    45           status->mpi_status = new ::MPI_Status(mpi_status); 
     45          status->mpi_status = (*it)->mpi_status; 
    4646          status->ep_src = (*it)->ep_src; 
    4747          status->ep_tag = (*it)->ep_tag; 
     
    4949          break; 
    5050        } 
    51  
    5251      } 
    5352    } 
     
    6059  int MPI_Improbe(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status) 
    6160  { 
     61    int ep_rank_loc = comm->ep_comm_ptr->size_rank_info[1].first; 
     62    int mpi_rank    = comm->ep_comm_ptr->size_rank_info[2].first; 
    6263    *flag = false; 
    6364    if(!comm->is_ep) 
     
    102103      for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 
    103104      { 
    104  
    105         //printf("in ep_lib::Improbe, it->mpi_message = %p, it->mpi_status = %p, it->ep_src = %d, it->ep_tag = %d\n",  
    106         //                            (*(*it))->mpi_message,(*(*it))->mpi_status,(*(*it))->ep_src,(*(*it))->ep_tag); 
    107105                                           
    108106        bool src_matched = src<0? true: (*it)->ep_src == src; 
     
    113111          *flag = true; 
    114112 
    115           status->mpi_status = (*it)->mpi_status; 
     113          status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 
     114          memcheck("new "<< status->mpi_status << " : in ep_lib::MPI_Improbe, status->mpi_status = new ::MPI_Status"); 
    116115          status->ep_src = (*it)->ep_src; 
    117116          status->ep_tag = (*it)->ep_tag; 
    118117 
    119           (*message)->mpi_message = (*it)->mpi_message; 
     118          (*message)->mpi_message = new ::MPI_Message(*static_cast< ::MPI_Message*>((*it)->mpi_message)); 
     119          memcheck("new "<< (*message)->mpi_message <<" : in ep_lib::MPI_Improbe, (*message)->mpi_message = new ::MPI_Message"); 
    120120          (*message)->ep_src = (*it)->ep_src; 
    121121          (*message)->ep_tag = (*it)->ep_tag; 
    122            
    123           int test_count; 
    124           ::MPI_Get_count(to_mpi_status_ptr(status), 1275070475, &test_count); 
    125           printf("status = %p, test_count = %d\n", to_mpi_status_ptr(status), test_count); 
    126            
    127            
    128           ::MPI_Get_count(static_cast< ::MPI_Status* >(comm->ep_comm_ptr->message_queue->back()->mpi_status), 1275070475, &test_count); 
    129           printf("in ep_lib::Improbe, status = %p, test_count = %d\n", static_cast< ::MPI_Status* >(comm->ep_comm_ptr->message_queue->back()->mpi_status), test_count); 
    130122                                       
    131123 
    132124          #pragma omp critical (_query2) 
    133125          {               
    134             printf("delete %p : in ep_lib::Message_Check, delete (*it)->mpi_message\n", (*it)->mpi_message); 
    135             printf("delete %p : in ep_lib::Message_Check, delete (*it)->mpi_status\n", (*it)->mpi_status); 
    136             printf("delete %p : in ep_lib::Message_Check, delete (*it)\n", (*it)); 
     126            memcheck("delete "<< (*it)->mpi_message <<" : in ep_lib::Message_Check, delete (*it)->mpi_message"); 
     127            memcheck("delete "<< (*it)->mpi_status <<" : in ep_lib::Message_Check, delete (*it)->mpi_status"); 
     128            memcheck("delete "<< (*it) <<" : in ep_lib::Message_Check, delete (*it)"); 
     129             
    137130             
    138131            delete (*it)->mpi_message;      
     
    140133            delete *it; 
    141134             
     135                        
    142136            comm->ep_comm_ptr->message_queue->erase(it); 
    143             printf("message queue siez = %lu\n", comm->ep_comm_ptr->message_queue->size()); 
     137            memcheck("message_queue["<<mpi_rank<<","<<ep_rank_loc<<"]->size = "<<comm->ep_comm_ptr->message_queue->size()); 
    144138            #pragma omp flush 
    145139          } 
Note: See TracChangeset for help on using the changeset viewer.