+ if(r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_IRECV)
+ return FALSE;
+
+ if(r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_ISEND)
+ return FALSE;
+
+ /*if( (r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
+ && r2->call == SIMCALL_COMM_WAIT){
+
+ if(simcall_comm_wait__get__comm(r2)->comm.rdv == NULL)
+ return FALSE;
+
+ smx_rdv_t rdv = r1->call == SIMCALL_COMM_ISEND ? simcall_comm_isend__get__rdv(r1) : simcall_comm_irecv__get__rdv(r1);
+
+ if(simcall_comm_wait__get__comm(r2)->comm.rdv != rdv)
+ return FALSE;
+
+ if(simcall_comm_wait__get__comm(r2)->comm.type == SIMIX_COMM_SEND && r1->call == SIMCALL_COMM_ISEND)
+ return FALSE;
+
+ if(simcall_comm_wait__get__comm(r2)->comm.type == SIMIX_COMM_RECEIVE && r1->call == SIMCALL_COMM_IRECV)
+ return FALSE;
+ }
+
+ if( (r2->call == SIMCALL_COMM_ISEND || r2->call == SIMCALL_COMM_IRECV)
+ && r1->call == SIMCALL_COMM_WAIT){
+
+ if(simcall_comm_wait__get__comm(r1)->comm.rdv != NULL)
+ return FALSE;
+
+ smx_rdv_t rdv = r2->call == SIMCALL_COMM_ISEND ? simcall_comm_isend__get__rdv(r2) : simcall_comm_irecv__get__rdv(r2);
+
+ if(simcall_comm_wait__get__comm(r1)->comm.rdv != rdv)
+ return FALSE;
+
+ if(simcall_comm_wait__get__comm(r1)->comm.type == SIMIX_COMM_SEND && r2->call == SIMCALL_COMM_ISEND)
+ return FALSE;
+
+ if(simcall_comm_wait__get__comm(r1)->comm.type == SIMIX_COMM_RECEIVE && r2->call == SIMCALL_COMM_IRECV)
+ 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( (r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
+ && r2->call == SIMCALL_COMM_TEST)
+ 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( (r2->call == SIMCALL_COMM_ISEND || r2->call == SIMCALL_COMM_IRECV)
+ && r1->call == SIMCALL_COMM_TEST)
+ return FALSE;*/
+
+ if(r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_ISEND
+ && simcall_comm_isend__get__rdv(r1) != simcall_comm_isend__get__rdv(r2))
+ return FALSE;
+
+ if(r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_IRECV
+ && simcall_comm_irecv__get__rdv(r1) != simcall_comm_irecv__get__rdv(r2))
+ return FALSE;
+
+ if(r1->call == SIMCALL_COMM_WAIT && (r2->call == SIMCALL_COMM_WAIT || r2->call == SIMCALL_COMM_TEST)
+ && (simcall_comm_wait__get__comm(r1)->comm.src_proc == NULL
+ || simcall_comm_wait__get__comm(r1)->comm.dst_proc == NULL))
+ return FALSE;
+
+ if(r2->call == SIMCALL_COMM_WAIT && (r1->call == SIMCALL_COMM_WAIT || r1->call == SIMCALL_COMM_TEST)
+ && (simcall_comm_wait__get__comm(r2)->comm.src_proc == NULL
+ || simcall_comm_wait__get__comm(r2)->comm.dst_proc == NULL))
+ return FALSE;
+
+ if(r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_WAIT
+ && simcall_comm_wait__get__comm(r1)->comm.src_buff == simcall_comm_wait__get__comm(r2)->comm.src_buff
+ && simcall_comm_wait__get__comm(r1)->comm.dst_buff == simcall_comm_wait__get__comm(r2)->comm.dst_buff)
+ return FALSE;
+
+ if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_WAIT
+ && simcall_comm_wait__get__comm(r1)->comm.src_buff != NULL
+ && simcall_comm_wait__get__comm(r1)->comm.dst_buff != NULL
+ && simcall_comm_wait__get__comm(r2)->comm.src_buff != NULL
+ && simcall_comm_wait__get__comm(r2)->comm.dst_buff != NULL
+ && simcall_comm_wait__get__comm(r1)->comm.dst_buff != simcall_comm_wait__get__comm(r2)->comm.src_buff
+ && simcall_comm_wait__get__comm(r1)->comm.dst_buff != simcall_comm_wait__get__comm(r2)->comm.dst_buff
+ && simcall_comm_wait__get__comm(r2)->comm.dst_buff != simcall_comm_wait__get__comm(r1)->comm.src_buff)
+ return FALSE;
+
+ if(r1->call == SIMCALL_COMM_TEST &&
+ (simcall_comm_test__get__comm(r1) == NULL
+ || simcall_comm_test__get__comm(r1)->comm.src_buff == NULL
+ || simcall_comm_test__get__comm(r1)->comm.dst_buff == NULL))
+ return FALSE;
+
+ if(r2->call == SIMCALL_COMM_TEST &&
+ (simcall_comm_test__get__comm(r2) == NULL
+ || simcall_comm_test__get__comm(r2)->comm.src_buff == NULL
+ || simcall_comm_test__get__comm(r2)->comm.dst_buff == NULL))
+ return FALSE;
+
+ if(r1->call == SIMCALL_COMM_TEST && r2->call == SIMCALL_COMM_WAIT
+ && simcall_comm_test__get__comm(r1)->comm.src_buff == simcall_comm_wait__get__comm(r2)->comm.src_buff
+ && simcall_comm_test__get__comm(r1)->comm.dst_buff == simcall_comm_wait__get__comm(r2)->comm.dst_buff)