3 dimensionnal matching to partition transformation
What they actually do is a composition of two reductions (and some optimization). The first is from 3DM to SUBSET-SUM, and the second is from SUBSET-SUM to PARTITION. For the first part, I have it written down here, and the second reduction is quite well known, e.g. here.

Note that there is a small caveat in the first reduction, where we assume that the numbers are encoded in base $|X|+1$, while SUBSET-SUM requires the numbers to be in binary. The reduction you mention does the conversion explicitly, which accounts for the strange $p$ you encountered (which is just the base-conversion constant).