{
smx_rdv_t mailbox;
- xbt_assert(!request->action,
- "Cannot (re)start a non-finished communication");
- if(request->flags & PREPARED)request->flags &= ~PREPARED;
- if(request->flags & RECV) {
+ xbt_assert(!request->action, "Cannot (re)start a non-finished communication");
+ request->flags &= ~PREPARED;
+ if (request->flags & RECV) {
print_request("New recv", request);
//FIXME: if receive is posted with a large size, but send is smaller, mailboxes may not match !
if (request->size < sg_cfg_get_int("smpi/async_small_thres"))
int flag;
//assume that request is not MPI_REQUEST_NULL (filtered in PMPI_Test or smpi_mpi_testall before)
- if ((*request)->action == NULL)
- flag = 1;
- else
- flag = simcall_comm_test((*request)->action);
- if(flag) {
- finish_wait(request, status);
- *request = MPI_REQUEST_NULL;
- }else{
- smpi_empty_status(status);
+ smpi_empty_status(status);
+ flag = 1;
+ if (!((*request)->flags & PREPARED)) {
+ if ((*request)->action != NULL)
+ flag = simcall_comm_test((*request)->action);
+ if (flag) {
+ finish_wait(request, status);
+ *request = MPI_REQUEST_NULL;
+ }
}
return flag;
}
map = xbt_new(int, count);
size = 0;
for(i = 0; i < count; i++) {
- if((requests[i]!=MPI_REQUEST_NULL) && requests[i]->action) {
+ if ((requests[i] != MPI_REQUEST_NULL) && requests[i]->action &&
+ !(requests[i]->flags & PREPARED)) {
xbt_dynar_push(comms, &requests[i]->action);
map[size] = i;
size++;
int flag=1;
int i;
for(i=0; i<count; i++){
- if(requests[i]!= MPI_REQUEST_NULL){
+ if (requests[i] != MPI_REQUEST_NULL && !(requests[i]->flags & PREPARED)) {
if (smpi_mpi_test(&requests[i], pstat)!=1){
flag=0;
}else{
void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
{
print_request("Waiting", *request);
+ if ((*request)->flags & PREPARED) {
+ smpi_empty_status(status);
+ return;
+ }
+
if ((*request)->action != NULL) { // this is not a detached send
simcall_comm_wait((*request)->action, -1.0);
}
size = 0;
XBT_DEBUG("Wait for one of %d", count);
for(i = 0; i < count; i++) {
- if(requests[i] != MPI_REQUEST_NULL) {
+ if (requests[i] != MPI_REQUEST_NULL && !(requests[i]->flags & PREPARED)) {
if (requests[i]->action != NULL) {
XBT_DEBUG("Waiting any %p ", requests[i]);
xbt_dynar_push(comms, &requests[i]->action);
//tag invalid requests in the set
if (status != MPI_STATUSES_IGNORE) {
for (c = 0; c < count; c++) {
- if (requests[c] == MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL) {
+ if (requests[c] == MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL ||
+ (requests[c]->flags & PREPARED)) {
smpi_empty_status(&status[c]);
} else if (requests[c]->src == MPI_PROC_NULL) {
smpi_empty_status(&status[c]);