There are three calls to Zoltan_Migrate within Fluidity, each migrating a different set of data; nodes, halo nodes and fields. For each of these calls a different set of callbacks are provided to deal with packing and unpacking the different data being sent. Three callbacks need to be provided for each Zoltan_Migrate call:
The Zoltan communication buffer is a byte array. This makes directly transferring data between it and the Fluidity data structures complicated as most Fluidity data is real. To simplify the process an intermediary real array is used for the packing and unpacking callbacks when migrating fields data. In the packing routine data is first packed from the Fluidity data structures into the real array. The Fortran intrinsic procedure transfer is then used to copy the packed real data into the integer Zoltan communication buffer. When unpacking the data is first copied from the integer Zoltan communication buffer into a real array and then data is unpacked from the real array into the Fluidity data structures.
Jon Hill 2012-03-02