Status::empty(status);
*flag = 1;
if (((*request)->flags_ & MPI_REQ_PREPARED) == 0) {
- if ((*request)->action_ != nullptr){
+ if ((*request)->action_ != nullptr && (*request)->cancelled_ != 1){
try{
*flag = simcall_comm_test((*request)->action_);
} catch (const Exception&) {
*count = 0;
for (int i = 0; i < incount; i++) {
- if (requests[i] != MPI_REQUEST_NULL) {
+ if (requests[i] != MPI_REQUEST_NULL && not (requests[i]->flags_ & MPI_REQ_FINISHED)) {
ret = test(&requests[i], pstat, &flag);
if(ret!=MPI_SUCCESS)
error = 1;
int index = 0;
MPI_Status stat;
MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
-
index = waitany(incount, (MPI_Request*)requests, pstat);
if(index==MPI_UNDEFINED) return MPI_UNDEFINED;
if(status != MPI_STATUSES_IGNORE) {
indices[count] = index;
count++;
for (int i = 0; i < incount; i++) {
- if (i==index)
- continue;
- if (requests[i] != MPI_REQUEST_NULL) {
+ if (i!=index && requests[i] != MPI_REQUEST_NULL
+ && not(requests[i]->flags_ & MPI_REQ_FINISHED)) {
test(&requests[i], pstat,&flag);
if (flag==1){
indices[count] = i;