-/* 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. */
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);
}
simgrid::smpi::Request::free_f(requests[indices[i]]);
requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
}
+ indices[i]++;
}
xbt_free(reqs);
}
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);
}
}
*ierr = MPI_Testsome(*incount, reqs, outcount, indices, FORT_STATUSES_IGNORE(statuses));
for(i=0;i<*incount;i++){
- if(indices[i] && reqs[indices[i]]==MPI_REQUEST_NULL){
+ if(reqs[indices[i]]==MPI_REQUEST_NULL){
simgrid::smpi::Request::free_f(requests[indices[i]]);
requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
}
+ indices[i]++;
}
xbt_free(reqs);
}