You've rolled up a few questions here
Absolutely, proceses can specify different or even zero amounts of data to the collective
MPI_File_write_all
routine. Not only can thecount
parameter differ, there's no reason thedatatype
parameter needs to be the same either.Problem #1: If you want to write more than an
int
worth of MPI_BYTE data, you'll have to create a new datatpye. For example, let's say you wanted to write 9 billion bytes. Create a contig type of size 1 billion, then write 9 of those. (if the amount of data you want to write is not evenly divisible, you might need an hindexed or struct type).problem #2: It's not at all a problem to have every MPI process create its own datatype or count of datatype.