Index: pml_ob1_comm.c =================================================================== --- pml_ob1_comm.c (revision 25195) +++ pml_ob1_comm.c (working copy) @@ -56,6 +56,7 @@ OBJ_CONSTRUCT(&comm->matching_lock, opal_mutex_t); comm->recv_sequence = 0; comm->procs = NULL; + comm->last_probed = 0; comm->num_procs = 0; } Index: pml_ob1_comm.h =================================================================== --- pml_ob1_comm.h (revision 25195) +++ pml_ob1_comm.h (working copy) @@ -58,6 +58,7 @@ opal_list_t wild_receives; /**< queue of unmatched wild (source process not specified) receives */ mca_pml_ob1_comm_proc_t* procs; size_t num_procs; + size_t last_probed; }; typedef struct mca_pml_comm_t mca_pml_ob1_comm_t; Index: pml_ob1_recvreq.c =================================================================== --- pml_ob1_recvreq.c (revision 25195) +++ pml_ob1_recvreq.c (working copy) @@ -900,19 +900,34 @@ * There is an outer loop over lists of messages from each * process, then an inner loop over the messages from the * process. + * + * In order to avoid starvation do this in a round-robin fashion. */ - for (i = 0; i < proc_count; i++) { + for (i = comm->last_probed + 1; i < comm->num_procs; i++) { mca_pml_ob1_recv_frag_t* frag; /* loop over messages from the current proc */ if((frag = recv_req_match_specific_proc(req, &proc[i]))) { *p = &proc[i]; + comm->last_probed = i; req->req_recv.req_base.req_proc = proc[i].ompi_proc; prepare_recv_req_converter(req); return frag; /* match found */ } } + for (i = 0; i < comm->last_probed; i++) { + mca_pml_ob1_recv_frag_t* frag; + /* loop over messages from the current proc */ + if((frag = recv_req_match_specific_proc(req, &proc[i]))) { + *p = &proc[i]; + comm->last_probed = i; + req->req_recv.req_base.req_proc = proc[i].ompi_proc; + prepare_recv_req_converter(req); + return frag; /* match found */ + } + } + *p = NULL; return NULL; }