Rats! I was hoping you already had an answer to this question.
We're designing some code right now that has to address this
problem for our MPICH-dependent version of MPI-IO.
If the packing size has to be data dependent, that opens up
all kinds of problems. For example, if you build an MPI
structure that contains datatypes, you have to pick the
indices of subsequent elements based on the maximum expected
size of the datatype representation. And if you send any
object containing a datatype, you have to probe for the size
at the receiving end and possibly reallocate a buffer before
you can receive the object.
Sorry to present more questions that answers here. If we
come up with any solutions, I'll let you know.
John