static inline uint16_t get_new_tid(void) { uint16_t r = ((unsigned) random()) & 0xffff; // check if the tid is already requested if (rq_find(r)) return get_new_tid(); return r; }
int MPI_Cancel(MPI_Request *request) { int returnVal; request_list *rq; rq_find( requests_head_1, *request, rq ); if (rq) rq->status |= RQ_CANCEL; /* be sure to check on the Test or Wait if it was really cancelled */ returnVal = PMPI_Cancel( request ); return returnVal; }