0

Can MPI_Get_count() return a negative value for the count? My message sizes never exceed 1138 integers. So it should not be a problem with the message length.

    if(MPI_Probe(MPI_ANY_SOURCE,0,MPI_COMM_WORLD,&status) == MPI_SUCCESS)
    {
     printf("probe flag true\n");
     MPI_Get_count(&status,MPI_DOUBLE,&recv_size);
    }

The value of recv_size I get is negative.

3
  • Declaration of recv_size, please? Commented Jun 14, 2012 at 22:03
  • recv_size is declared as an integer. Commented Jun 15, 2012 at 7:54
  • MPI_UNDEFINED is -32766 in both Open MPI and Intel MPI. Commented Jun 15, 2012 at 7:57

2 Answers 2

1

MPI_Get_count will return MPI_UNDEFINED (which is most likely negative) iff the message size is not a multiple of the size of the datatype given to MPI_Get_count. So maybe you are sending 5 Bytes as MPI_BYTE but you ask MPI_Get_count how many MPI_DOUBLES you received.

Sign up to request clarification or add additional context in comments.

1 Comment

This is my declaration of mpi_send : MPI_Send(T,(m->ncols),MPI_DOUBLE,map(j,procs),0,MPI_COMM_WORLD);
0

I just realised that it was a problem with the data I was sending. The values exceeded the sizeof double. Fixed it and the code worked. Thanks for the help and sorry for buggy code!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.