The Message Passing Interface APIs always use int as a type for count variables. For instance, the prototype for MPI_Send is:
int
count
MPI_Send
I haven't used it myself, but there is a wrapper that exists to help you out called BigMPI. You'll have to take a look at the Github README to find out more about how to use it, but I think it takes care of some of the nastiness of this.