X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b5722ab23a4292eeaffc735aa511e36b47670d00..2d37e348a09783cda723c7019640ee69de168324:/src/smpi/bindings/smpi_f77_request.cpp diff --git a/src/smpi/bindings/smpi_f77_request.cpp b/src/smpi/bindings/smpi_f77_request.cpp index f2e77aed6f..ec705b2196 100644 --- a/src/smpi/bindings/smpi_f77_request.cpp +++ b/src/smpi/bindings/smpi_f77_request.cpp @@ -1,9 +1,9 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "private.h" +#include "private.hpp" #include "smpi_comm.hpp" #include "smpi_datatype.hpp" #include "smpi_request.hpp" @@ -171,9 +171,12 @@ void mpi_waitany_(int* count, int* requests, int* index, MPI_Status* status, int reqs[i] = simgrid::smpi::Request::f2c(requests[i]); } *ierr = MPI_Waitany(*count, reqs, index, status); - if(reqs[*index]==MPI_REQUEST_NULL){ - simgrid::smpi::Request::free_f(requests[*index]); - requests[*index]=MPI_FORTRAN_REQUEST_NULL; + if(*index!=MPI_UNDEFINED){ + if(reqs[*index]==MPI_REQUEST_NULL){ + simgrid::smpi::Request::free_f(requests[*index]); + requests[*index]=MPI_FORTRAN_REQUEST_NULL; + } + *index=*index+1; } xbt_free(reqs); } @@ -251,9 +254,12 @@ void mpi_testany_ (int* count, int* requests, int *index, int *flag, MPI_Status* reqs[i] = simgrid::smpi::Request::f2c(requests[i]); } *ierr = MPI_Testany(*count, reqs, index, flag, FORT_STATUS_IGNORE(status)); - if(*index!=MPI_UNDEFINED && reqs[*index]==MPI_REQUEST_NULL){ + if(*index!=MPI_UNDEFINED){ + if(reqs[*index]==MPI_REQUEST_NULL){ simgrid::smpi::Request::free_f(requests[*index]); requests[*index]=MPI_FORTRAN_REQUEST_NULL; + } + *index=*index+1; } xbt_free(reqs); }