Ignore:
Timestamp:
06/04/18 19:25:08 (4 years ago)
Author:
yushan
Message:

save dev. TO DO : test with xios

File:
1 edited

Legend:

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

    r1500 r1520  
    3333        status->ep_tag = (*request)->ep_tag; 
    3434        status->ep_datatype = (*request)->ep_datatype; 
    35         //delete request->mpi_request; 
     35        delete (*request)->mpi_request; 
     36        delete request; 
    3637      } 
    3738 
     
    6061        status->ep_tag = (*request)->ep_tag; 
    6162        status->ep_datatype = (*request)->ep_datatype; 
    62         //delete request->mpi_request; 
     63        delete (*request)->mpi_request; 
     64        delete request; 
    6365        //int count; 
    6466        //MPI_Get_count(status, request->ep_datatype, &count); 
     
    7577  { 
    7678    Debug("MPI_Testall with EP"); 
    77     *flag = true; 
    78     int i=0; 
    79     while(*flag && i<count ) 
     79 
     80    ::MPI_Request* mpi_request = new ::MPI_Request[count]; 
     81    ::MPI_Status* mpi_status = new ::MPI_Status[count]; 
     82 
     83 
     84    for(int i=0; i<count; i++) 
    8085    { 
    81       MPI_Test(&array_of_requests[i], flag, &array_of_statuses[i]); 
    82       i++; 
     86      mpi_request[i] = *static_cast< ::MPI_Request*>(array_of_requests[i]->mpi_request); 
     87    } 
     88 
     89    ::MPI_Testall(count, mpi_request, flag, mpi_status); 
     90 
     91    if(flag) 
     92    { 
     93      for(int i=0; i<count; i++) 
     94      { 
     95        array_of_statuses[i].mpi_status = &mpi_status[i]; 
     96        array_of_statuses[i].ep_src = array_of_requests[i]->ep_src; 
     97        array_of_statuses[i].ep_tag = array_of_requests[i]->ep_tag; 
     98        array_of_statuses[i].ep_datatype = array_of_requests[i]->ep_datatype; 
     99       
     100        memcheck("delete "<< array_of_requests[i]->mpi_request <<" : in ep_lib::MPI_Waitall, array_of_requests["<<i<<"]->mpi_request"); 
     101        delete array_of_requests[i]->mpi_request; 
     102        delete array_of_requests[i];  
     103      } 
     104       
    83105    } 
    84106 
     
    87109 
    88110} 
     111 
Note: See TracChangeset for help on using the changeset viewer.