static c4snet_data_t *MPIUnpackFun(void *buf) { void *tmp; c4snet_data_t *result; int vtype, type, count; MPIUnpack(buf, &vtype, MPI_INT, 1); MPIUnpack(buf, &count, MPI_INT, 1); MPIUnpack(buf, &type, MPI_INT, 1); if (vtype == VTYPE_array) { result = C4SNetAlloc(type, count, &tmp); MPIUnpack(buf, tmp, TypeToMPIType(type), count); } else { result = C4SNetAlloc(type, 1, &tmp); MPIUnpack(buf, tmp, TypeToMPIType(type), 1); } return result; }
void SNetDistribUnpack(void *dst, ...) { va_list args; mpi_buf_t *buf; MPI_Datatype type; int count; va_start(args, dst); buf = va_arg(args, mpi_buf_t *); type = va_arg(args, MPI_Datatype); count = va_arg(args, int); va_end(args); MPIUnpack(buf, dst, type, count); }
inline static void UnpackByte(void *buf, int count, char *dst) { MPIUnpack(buf, dst, MPI_BYTE, count); }
inline static void UnpackInt(void *buf, int count, int *dst) { MPIUnpack(buf, dst, MPI_INT, count); }
void SNetUnpackVoid(void *buf, int count, void **dst) { MPIUnpack(buf, dst, MPI_VOID_POINTER, count); }
void SNetUnpackLong(void *buf, int count, long *dst) { MPIUnpack(buf, dst, MPI_LONG, count); }
void SNetUnpackByte(void *buf, int count, char *dst) { MPIUnpack(buf, dst, MPI_BYTE, count); }
void SNetUnpackInt(void *buf, int count, int *dst) { MPIUnpack(buf, dst, MPI_INT, count); }