This was seen when user's code was using MPI_ANY_TAG to receive any message (from the userland code), and lead to confusions.
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = COLL_TAG_BCAST;
+ int tag = -COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
int rank, size;
int i, j, k;
- int tag = COLL_TAG_BCAST;
+ int tag = -COLL_TAG_BCAST;
int will_send[BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE];
int sent_count;
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = COLL_TAG_BCAST;
+ int tag = -COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = COLL_TAG_BCAST;
+ int tag = -COLL_TAG_BCAST;//in order to use ANY_TAG, make this one positive
int header_tag = 10;
MPI_Status status;
int rank;
rank = smpi_comm_rank(comm);
- int tag = COLL_TAG_REDUCE;
+ int tag = -COLL_TAG_REDUCE;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
} s_smpi_mpi_datatype_t;
-#define COLL_TAG_REDUCE 111
-#define COLL_TAG_SCATTER 222
-#define COLL_TAG_SCATTERV 333
-#define COLL_TAG_GATHER 444
-#define COLL_TAG_ALLGATHER 555
-#define COLL_TAG_ALLGATHERV 666
-#define COLL_TAG_BARRIER 777
-#define COLL_TAG_REDUCE_SCATTER 888
-#define COLL_TAG_ALLTOALLV 999
-#define COLL_TAG_ALLTOALL 1111
-#define COLL_TAG_GATHERV 2222
-#define COLL_TAG_BCAST 3333
-#define COLL_TAG_ALLREDUCE 4444
+#define COLL_TAG_REDUCE -112
+#define COLL_TAG_SCATTER -223
+#define COLL_TAG_SCATTERV -334
+#define COLL_TAG_GATHER -445
+#define COLL_TAG_ALLGATHER -556
+#define COLL_TAG_ALLGATHERV -667
+#define COLL_TAG_BARRIER -778
+#define COLL_TAG_REDUCE_SCATTER -889
+#define COLL_TAG_ALLTOALLV -1000
+#define COLL_TAG_ALLTOALL -1112
+#define COLL_TAG_GATHERV -2223
+#define COLL_TAG_BCAST -3334
+#define COLL_TAG_ALLREDUCE -4445
//*****************************************************************************************
typedef struct s_smpi_mpi_request {
xbt_assert(ref, "Cannot match recv against null reference");
xbt_assert(req, "Cannot match recv against null request");
if((ref->src == MPI_ANY_SOURCE || req->src == ref->src)
- && (ref->tag == MPI_ANY_TAG || req->tag == ref->tag)){
+ && ((ref->tag == MPI_ANY_TAG && req->tag >=0) || req->tag == ref->tag)){
//we match, we can transfer some values
// FIXME : move this to the copy function ?
if(ref->src == MPI_ANY_SOURCE)ref->real_src = req->src;
if(req->detached==1){
ref->detached_sender=req; //tie the sender to the receiver, as it is detached and has to be freed in the receiver
}
+ XBT_DEBUG("match succeeded");
return 1;
}else return 0;
}
xbt_assert(req, "Cannot match send against null request");
if((req->src == MPI_ANY_SOURCE || req->src == ref->src)
- && (req->tag == MPI_ANY_TAG || req->tag == ref->tag))
+ && ((req->tag == MPI_ANY_TAG && ref->tag >=0)|| req->tag == ref->tag))
{
if(req->src == MPI_ANY_SOURCE)req->real_src = ref->src;
if(req->tag == MPI_ANY_TAG)req->real_tag = ref->tag;
if(ref->detached==1){
req->detached_sender=ref; //tie the sender to the receiver, as it is detached and has to be freed in the receiver
}
-
+ XBT_DEBUG("match succeeded");
return 1;
} else return 0;
}
static void tree_bcast(void *buf, int count, MPI_Datatype datatype,
MPI_Comm comm, proc_tree_t tree)
{
- int system_tag = 999; // used negative int but smpi_create_request() declares this illegal (to be checked)
+ int system_tag = COLL_TAG_BCAST;
int rank, i;
MPI_Request *requests;
static void tree_antibcast(void *buf, int count, MPI_Datatype datatype,
MPI_Comm comm, proc_tree_t tree)
{
- int system_tag = 999; // used negative int but smpi_create_request() declares this illegal (to be checked)
+ int system_tag = COLL_TAG_BCAST;
int rank, i;
MPI_Request *requests;