I am trying to get the value of MPI_TAG_UB using the following code:

  MPI_Aint  * maxTag;;
  int error, flag;
 
  error = MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &maxTag, &flag);
 
  if(error != MPI_SUCCESS || !flag ){
  printf( " ERROR IN native mpitagub\n");
  }
 
  printf( "mpitagub = %d\n", *maxTag);



For MPICH3 I get

mpitagub = 1073741823

I also did it for OpenMPI and I get

mpitagub = 2147483647

The value from OpenMPI makes sense since its 2^31 -1. But at the end the MPI_TAG_UB is MPI implementation dependent.

So I was wondering the value that I got from MPICH3 (mpitagub = 1073741823) is this OK? or my code is wrong somewhere?

Thanks
Bibrak