Communication
References
Model
The communication time for one packet is modeled as
t_{comm} = t_s + (m*t_w + t_h)*l
where t_s is the startup time (adding header, establishing
connection, etc); t_w is the transfer time (seconds per word,
its reciprocal is the bandwidth, i.e., words per second);
t_h is the hop time (time for the header to travel from processor
to its adjacent processor). Usually it is small and negligible;
m is the message size (words); l is the number of links between
two communicating processors. Usually, for direct connection,
we use
t_{comm} = t_s + m*t_w
The startup time t_s is usually much larger than the
transfer time t_w. So, it is more efficient to send
few and long messages than to send many short messages.
For example, over an Ethernet, a cluster of workstations running PVM,
t_s is around 10^2 to 10^5 cycles and t_w is around
1e-9 to 1e-7 seconds per byte.
Routing mechanism
Static interconnection networks
Performance analysis (broadcast)
Store-and-forward
Ring, we can broadcast in both directions.
t_{bcast} = (t_s + m*t_w)*p/2
Mesh (2D), we first broadcast in a row then in all columns.
t_{bcast} = (t_s + m*t_w)*sqrt(p)
Hypercube, we first broadcast to the node differs in the m.s.b., then
to the nodes differ in the second m.s.b, ..., finally to the nodes
differ in the l.s.b.
t_{bcast} = (t_s + m*t_w)*log(p)
Cut-through
Ring, first P0 sends to P(p/2), then both P0 and P(p/2)
send to P(p/4) and P(3p/4), ...
t_{bcast} = (t_s + m*t_w)*log(p)
Mesh (2D), first broadcast in a row, then in all
columns simultaneously.
t_{comm} = 2*(t_s + m*t_w)*log(sqrt(p))
Hypercube, broadcast in a balanced binary tree
t_{comm} = (t_s + m*t_w)*log(p)
Example
Dynamic interconnection networks
Message Passing
A message passing parallel program is usually written in
a conventional sequential language such as Fortran or C
or C++ with a communication library. We use
MPI
(message passing interface) as the communication library.
Any MPI program starts with
int MPI_Init(
int* argc,
char** argv[])
and ends with
int MPI_Finalize(void)
A short tutorial is available.
One-to-one communication
Collective communication