-
- auto comm2 = get_comm_or_nullptr(req2);
-
- /* First case: that's not the same kind of request (we also know that req1 < req2 alphabetically) */
- if (req1->call_ != req2->call_) {
- if (req1->call_ == IRECV && req2->call_ == ISEND)
- return false;
-
- if ((req1->call_ == IRECV || req1->call_ == ISEND) && req2->call_ == WAIT) {
- auto mbox1 = get_mbox_remote_addr(req1);
- auto mbox2 = remote(comm2->mbox_cpy);
-
- if (mbox1 != mbox2 && simcall_comm_wait__get__timeout(req2) <= 0)
- return false;
-
- if ((req1->issuer_ != comm2->src_actor_.get()) && (req1->issuer_ != comm2->dst_actor_.get()) &&
- simcall_comm_wait__get__timeout(req2) <= 0)
- return false;
-
- if ((req1->call_ == ISEND) && (comm2->type_ == kernel::activity::CommImpl::Type::SEND) &&
- (comm2->src_buff_ != simcall_comm_isend__get__src_buff(req1)) && simcall_comm_wait__get__timeout(req2) <= 0)
- return false;
-
- if ((req1->call_ == IRECV) && (comm2->type_ == kernel::activity::CommImpl::Type::RECEIVE) &&
- (comm2->dst_buff_ != simcall_comm_irecv__get__dst_buff(req1)) && simcall_comm_wait__get__timeout(req2) <= 0)
- return false;
- }
-
- /* FIXME: the following rule assumes that the result of the isend/irecv call is not stored in a buffer used in the
- * test call. */
-#if 0
- if((req1->call == ISEND || req1->call == IRECV)
- && req2->call == TEST)
- return false;
-#endif
-
- return true;
- }
-
- /* Second case: req1 and req2 are of the same call type */
- switch (req1->call_) {
- case ISEND:
- return simcall_comm_isend__get__mbox(req1) == simcall_comm_isend__get__mbox(req2);
- case IRECV:
- return simcall_comm_irecv__get__mbox(req1) == simcall_comm_irecv__get__mbox(req2);
- default:
- return true;
- }