Vector types and MPI


What is the recommended way of MPI-sending a vector type such as float2?

  • Is there by any chance a built-in custom MPI_Datatype?
  • Should I create a custom MPI_Datatype?
  • Or since a floatX is a struct of X contiguous elements, should I just use MPI_Send(buf, X, MPI_FLOAT, …) ? But then what about float3 – is it a special case? does it use some kind of padding? The opacity here isn’t helping…

Am I missing a more obvious solution?


float2 and float3 are defined in vector_types.h which, on a typical linux install, can be found in /usr/local/cuda/include

vector types are packed without empty space, so it should be sufficient to send multiples of the base type.

1 Like