Home

MPIScatter

MPIScatter is a collective communication operation in the Message Passing Interface (MPI) that distributes blocks of data from one root process to all processes within a communicator. Each process receives a distinct block of data, enabling data parallelism across the participating processes.

In a typical scatter operation, the root process provides a send buffer containing a sequence of data

The standard prototype in C is MPI_Scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm). In Fortran,

MPIScatter is often used as a building block for parallel algorithms that require dividing input data evenly

elements
arranged
for
all
processes.
The
data
is
divided
into
equal-sized
blocks,
with
sendcount
elements
of
type
sendtype
allocated
to
each
process.
The
process
with
rank
i
in
the
communicator
receives
its
block
into
its
own
receive
buffer,
recvbuf,
which
holds
recvcount
elements
of
type
recvtype.
All
processes
in
the
communicator
participate
in
the
call;
the
root
process
is
responsible
for
supplying
the
send
buffer,
while
non-root
processes
supply
a
receive
buffer.
The
contents
of
the
send
buffer
are
mapped
to
processes
in
rank
order.
the
order
and
types
differ,
but
the
conceptual
behavior
remains
the
same.
On
non-root
processes,
the
sendbuf
parameter
is
ignored;
on
the
root,
the
sendbuf
must
contain
at
least
sendcount
multiplied
by
the
number
of
processes
elements,
arranged
so
that
each
process
receives
a
contiguous
block.
among
processes,
such
as
distributed
initializations,
processing
of
independent
data
chunks,
or
parallel
reductions
following
per-process
computations.
Related
operations
include
MPI_Scatterv,
which
allows
varying
block
sizes,
and
MPI_Gather,
which
reverses
the
data
distribution.