X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b0d45659b3ca3d1a18fa754bb04ed74396b3bd7..841493f1159e95a32f05ae19760ab669279d647e:/src/smpi/smpi_receiver.c diff --git a/src/smpi/smpi_receiver.c b/src/smpi/smpi_receiver.c index 34a6280c1b..4f214184c0 100644 --- a/src/smpi/smpi_receiver.c +++ b/src/smpi/smpi_receiver.c @@ -50,8 +50,6 @@ int smpi_receiver(int argc, char **argv) SIMIX_mutex_unlock(smpi_global->start_stop_mutex); do { - request = NULL; - message = NULL; // FIXME: better algorithm, maybe some kind of balanced tree? or a heap? @@ -69,15 +67,19 @@ int smpi_receiver(int argc, char **argv) if ( request->comm == message->comm && (MPI_ANY_SOURCE == request->src || request->src == message->src) && - (MPI_ANY_TAG == request->tag || request->tag == message->tag) && - (message->action != SURF_ACTION_READY && message->action != SURF_ACTION_RUNNING) - ) { + (MPI_ANY_TAG == request->tag || request->tag == message->tag)) { xbt_fifo_remove_item(request_queue, request_item); + xbt_fifo_free_item(request_item); xbt_fifo_remove_item(message_queue, message_item); + xbt_fifo_free_item(message_item); goto stopsearch; } } } + + request = NULL; + message = NULL; + stopsearch: SIMIX_mutex_unlock(message_queue_mutex); SIMIX_mutex_unlock(request_queue_mutex);