Changeset 1520 for XIOS/dev/branch_openmp/extern/src_ep_dev/ep_wait.cpp
- Timestamp:
- 06/04/18 19:25:08 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_wait.cpp
r1374 r1520 9 9 #include <mpi.h> 10 10 #include "ep_declaration.hpp" 11 #include "ep_mpi.hpp" 11 12 12 13 using namespace std; … … 22 23 int MPI_Wait(MPI_Request *request, MPI_Status *status) 23 24 { 24 if( request->type !=1 && request->type !=2 && request->type !=3)25 if((*request)->type !=1 && (*request)->type !=2 && (*request)->type !=3) 25 26 { 26 27 printf("Error in request type\n"); … … 29 30 } 30 31 31 while(request->type == 2) Request_Check(); 32 while((*request)->type == 2) Request_Check(); 33 34 ::MPI_Wait(to_mpi_request_ptr(*request), to_mpi_status_ptr(status)); 32 35 36 37 status->ep_src = (*request)->ep_src; 38 status->ep_tag = (*request)->ep_tag; 39 status->ep_datatype = (*request)->ep_datatype; 40 41 (*request)->state = 2; 33 42 34 //::MPI_Request mpi_request = static_cast< ::MPI_Request >(request->mpi_request); 35 ::MPI_Status mpi_status; 36 ::MPI_Wait(static_cast< ::MPI_Request*>(request->mpi_request), &mpi_status); 37 38 39 40 41 // request->mpi_request = mpi_request; 42 43 status->mpi_status = &mpi_status; 44 status->ep_src = request->ep_src; 45 status->ep_tag = request->ep_tag; 46 status->ep_datatype = request->ep_datatype; 43 memcheck("delete "<< (*request)->mpi_request << " : in ep_lib::MPI_Wait, delete (*request)->mpi_request"); 44 delete (*request)->mpi_request; 45 delete *request; 47 46 48 47 49 50 return MPI_SUCCESS; 48 return Request_Check(); 51 49 52 50 } /*end of mpi_wait*/ … … 69 67 for(int i=0; i<count; i++) 70 68 { 71 if(array_of_requests[i] .type !=1 && array_of_requests[i].type !=2 && array_of_requests[i].type !=3)69 if(array_of_requests[i]->type !=1 && array_of_requests[i]->type !=2 && array_of_requests[i]->type !=3) 72 70 { 73 71 printf("Error in request type\n"); … … 76 74 } 77 75 78 if(array_of_requests[i] .type == 2) Request_Check();79 if(array_of_requests[i] .type != 2 && finished.at(i) == 0)76 if(array_of_requests[i]->type == 2) Request_Check(); 77 if(array_of_requests[i]->type != 2 && finished.at(i) == 0) 80 78 { 81 79 finished.at(i) = 1; 82 //mpi_request[i] = static_cast< ::MPI_Request >(array_of_requests[i].mpi_request); 83 mpi_request[i] = *static_cast< ::MPI_Request*>(array_of_requests[i].mpi_request); 80 mpi_request[i] = *static_cast< ::MPI_Request*>(array_of_requests[i]->mpi_request); 84 81 } 85 82 } … … 91 88 { 92 89 array_of_statuses[i].mpi_status = &mpi_status[i]; 93 array_of_statuses[i].ep_src = array_of_requests[i].ep_src; 94 array_of_statuses[i].ep_tag = array_of_requests[i].ep_tag; 95 array_of_statuses[i].ep_datatype = array_of_requests[i].ep_datatype; 90 array_of_statuses[i].ep_src = array_of_requests[i]->ep_src; 91 array_of_statuses[i].ep_tag = array_of_requests[i]->ep_tag; 92 array_of_statuses[i].ep_datatype = array_of_requests[i]->ep_datatype; 93 94 array_of_requests[i]->state = 2; 95 96 memcheck("delete "<< array_of_requests[i]->mpi_request <<" : in ep_lib::MPI_Waitall, array_of_requests["<<i<<"]->mpi_request"); 97 delete array_of_requests[i]->mpi_request; 98 delete array_of_requests[i]; 96 99 } 97 100 … … 99 102 delete[] mpi_status; 100 103 101 102 return MPI_SUCCESS; 104 return Request_Check(); 103 105 } /* end of mpi_waitall*/ 104 106
Note: See TracChangeset
for help on using the changeset viewer.