* mpi performance consideration
@ 1998-11-16 11:02 Bernard Van Renterghem
1998-11-16 12:39 ` Loic Prylli
1998-11-17 2:47 ` Mike
0 siblings, 2 replies; 6+ messages in thread
From: Bernard Van Renterghem @ 1998-11-16 11:02 UTC (permalink / raw)
To: axp-list
Hello all,
We have a cluster of 16 LX164 533Mhz on a 100 Mb fd switch.
We have bad performance with mpich 1.0.9 or lam 6.1 with both 2.0.35 or 2.1.126
kernel with eth drivers de4x5.c:V0.542 100Mb/s full duplex or tulip.c:v0.83 10/19/97
I include the small program latband.c, tested on two nodes, compiled with
gcc version egcs-2.92.17 19981026 and glibc 2.0.7
with 2.0.35 lam6.1 -c2c, we have around 64 µsec.
without -c2c, it's 300 µsec or worse, with all the combinaisons of mpi distr,
kernel, eth ...
If someone have better performance or any idea in order to improve it,
please feel free to contact myself.
(With OSF 4.0, it's around 30 µsec so the users want to switch to OSF :-| )
Regards,
Bernard Van Rent
#include "mpi.h"
#include <math.h>
#include <stdio.h>
#define MAXSIZE 1000000
#define NITER_L 10000
#define NITER_B 5
int main(int argc, char *argv[]) {
int myrank, numprocs, i, n=1;
double start_time, l_time, b_time, a[MAXSIZE];
double truc, sum;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
if (myrank==0) {
printf("Actual number of processors: %1d\n", numprocs);
printf("MPI timing resolution %.5E s\n", MPI_Wtick());
}
printf("Hello, I am process #%4d\n", myrank);
fflush(stdout);
start_time = MPI_Wtime();
if (myrank==0) {
printf("Starting latency measurements ... ");
fflush(stdout);
}
if (myrank == 0) {
sum = 0.0; truc = MPI_Wtime();
for (i=0; i<NITER_L; i++) {
truc = MPI_Wtime();
MPI_Send(&n, 1, MPI_INT, 1, 0, MPI_COMM_WORLD);
truc = MPI_Wtime() - truc;
sum += truc;
}
}
else {
for (i=0; i<NITER_L; i++)
MPI_Recv(&n, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
}
if (myrank == 0) {
printf("done.\nStarting bandwith measurements ... ");
fflush(stdout);
}
l_time = MPI_Wtime() - start_time;
if (myrank == 0) {
for (i=0; i<MAXSIZE; i++)
a[i] = i;
}
start_time = MPI_Wtime();
if (myrank == 0) {
for (i=0; i<NITER_B; i++)
MPI_Send(a, MAXSIZE, MPI_DOUBLE, 1, 0, MPI_COMM_WORLD);
}
else {
for (i=0; i<NITER_B; i++)
MPI_Recv(a, MAXSIZE, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, &
status);
}
b_time = MPI_Wtime() - start_time;
if (myrank == 0) {
printf("done.\n");
fflush(stdout);
}
if (myrank == 0) {
printf("Send_time (Latency measurement): %.2f sec.\n"
"Latency: %.6f M-5sec\n"
"Send_time (Bandwidth measurement): %.2f sec.\n"
"Bandwidth: %.3f MB/s\n",
l_time, 1E+06*l_time/((double) NITER_L),
b_time, NITER_B*MAXSIZE*sizeof(double)/(1024*1024*b_time
));
}
MPI_Finalize();
return 0;
} /* END main */
-------------------------------------------------
Bernard Van Renterghem UCL/MAPR/PCPM 010/47 81 91
Bat Boltzmann Pl croix du Sud,1 1348 LLN
16-Nov-98 11:19:59
-------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread* mpi performance consideration
1998-11-16 11:02 mpi performance consideration Bernard Van Renterghem
@ 1998-11-16 12:39 ` Loic Prylli
1998-11-16 15:35 ` Bernard Van Renterghem
1998-11-17 2:47 ` Mike
1 sibling, 1 reply; 6+ messages in thread
From: Loic Prylli @ 1998-11-16 12:39 UTC (permalink / raw)
To: axp-list
Bernard Van Renterghem writes:
> Hello all,
>
> We have a cluster of 16 LX164 533Mhz on a 100 Mb fd switch.
> We have bad performance with mpich 1.0.9 or lam 6.1 with both 2.0.35 or 2.1.126
> kernel with eth drivers de4x5.c:V0.542 100Mb/s full duplex or tulip.c:v0.83 10/19/97
>
> I include the small program latband.c, tested on two nodes, compiled with
> gcc version egcs-2.92.17 19981026 and glibc 2.0.7
>
> with 2.0.35 lam6.1 -c2c, we have around 64 µsec.
That looks like normal performance for these software/hardware combination.
> without -c2c, it's 300 µsec or worse, with all the combinaisons of mpi distr,
> kernel, eth ...
Yes this is also pretty consitent numbers (no -c2c C means each
message goes trough two intermediate daemons).
>
> If someone have better performance or any idea in order to improve it,
> please feel free to contact myself.
> (With OSF 4.0, it's around 30 µsec so the users want to switch to OSF :-| )
If OSF really has these numbers with LAM and Ethernet 100, I am really
impressed (maybe I will also switch :-)). I would be curious to know
where you got these results? Are you sure that does not refer to some
special DEC version of MPI, on some custom network hardware?
Regards,
Loic
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: mpi performance consideration
1998-11-16 12:39 ` Loic Prylli
@ 1998-11-16 15:35 ` Bernard Van Renterghem
1998-11-16 20:10 ` Wes Bauske
1998-11-17 16:17 ` Loic Prylli
0 siblings, 2 replies; 6+ messages in thread
From: Bernard Van Renterghem @ 1998-11-16 15:35 UTC (permalink / raw)
To: axp-list
On 16-Nov-98 Loic Prylli wrote:
>
> Bernard Van Renterghem writes:
> > Hello all,
> >
> > We have a cluster of 16 LX164 533Mhz on a 100 Mb fd switch.
> > We have bad performance with mpich 1.0.9 or lam 6.1 with both 2.0.35 or 2.1.126
> > kernel with eth drivers de4x5.c:V0.542 100Mb/s full duplex or tulip.c:v0.83 10/19/97
> >
> > I include the small program latband.c, tested on two nodes, compiled with
> > gcc version egcs-2.92.17 19981026 and glibc 2.0.7
> >
> > with 2.0.35 lam6.1 -c2c, we have around 64 µsec.
>
> That looks like normal performance for these software/hardware combination.
>
> > without -c2c, it's 300 µsec or worse, with all the combinaisons of mpi distr,
> > kernel, eth ...
>
> Yes this is also pretty consitent numbers (no -c2c C means each
> message goes trough two intermediate daemons).
>
I knew that...
What I mean is that the 2.1.126 have no better network performance.
> >
> > If someone have better performance or any idea in order to improve it,
> > please feel free to contact myself.
> > (With OSF 4.0, it's around 30 µsec so the users want to switch to OSF :-| )
>
> If OSF really has these numbers with LAM and Ethernet 100, I am really
> impressed (maybe I will also switch :-)). I would be curious to know
> where you got these results? Are you sure that does not refer to some
> special DEC version of MPI, on some custom network hardware?
>
Not at all. Those are 433Mhz alpha with tulip cards.
> Regards,
>
> Loic
>
Yes, but to switch, you have to pay for!
The lam used on the OSF1 are from OSS too (LAM 6.1 - Ohio Supercomputer Center)
and I got this (-c2c)
Send_time (Latency measurement): 1.12 sec.
Latency: 22.361679 µsec
Send_time (Bandwidth measurement): 13.26 sec.
Bandwidth: 5.753 MB/s
But whith Linux 2.0.35, the fasted (!):
Send_time (Latency measurement): 2.94 sec.
Latency: 58.886719 µsec
Send_time (Bandwidth measurement): 10.01 sec.
Bandwidth: 7.623 MB/s
Bernard Van Rent
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mpi performance consideration
1998-11-16 15:35 ` Bernard Van Renterghem
@ 1998-11-16 20:10 ` Wes Bauske
1998-11-17 16:17 ` Loic Prylli
1 sibling, 0 replies; 6+ messages in thread
From: Wes Bauske @ 1998-11-16 20:10 UTC (permalink / raw)
To: axp-list
Bernard Van Renterghem wrote:
>
> Yes, but to switch, you have to pay for!
> The lam used on the OSF1 are from OSS too (LAM 6.1 - Ohio Supercomputer Center)
>
> and I got this (-c2c)
> Send_time (Latency measurement): 1.12 sec.
> Latency: 22.361679 5sec
> Send_time (Bandwidth measurement): 13.26 sec.
> Bandwidth: 5.753 MB/s
>
> But whith Linux 2.0.35, the fasted (!):
> Send_time (Latency measurement): 2.94 sec.
> Latency: 58.886719 5sec
> Send_time (Bandwidth measurement): 10.01 sec.
> Bandwidth: 7.623 MB/s
>
Well, is the latency improvement worth the cost of
switching OS? I personally prefer higher bandwidth
over latency so Linux would win for your comparison
above. In other words are you sending lots of small
packets or lots of large ones in your applications?
Also, do you have the $$$ to switch??
Wes
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: mpi performance consideration
1998-11-16 15:35 ` Bernard Van Renterghem
1998-11-16 20:10 ` Wes Bauske
@ 1998-11-17 16:17 ` Loic Prylli
1 sibling, 0 replies; 6+ messages in thread
From: Loic Prylli @ 1998-11-17 16:17 UTC (permalink / raw)
To: axp-list
Bernard Van Renterghem writes:
>
> [...]
> The lam used on the OSF1 are from OSS too (LAM 6.1 - Ohio Supercomputer Center)
>
> and I got this (-c2c)
> Send_time (Latency measurement): 1.12 sec.
> Latency: 22.361679 µsec
> Send_time (Bandwidth measurement): 13.26 sec.
> Bandwidth: 5.753 MB/s
>
> But whith Linux 2.0.35, the fasted (!):
> Send_time (Latency measurement): 2.94 sec.
> Latency: 58.886719 µsec
> Send_time (Bandwidth measurement): 10.01 sec.
> Bandwidth: 7.623 MB/s
I gave a second look at your program, what you are doing is:
node0 node1
send recv
send recv
send recv
send recv
...
The LAM MPI implementation disable the NAGLE algorithm on the
underlying TCP connection which means most small sends will be sent in
a different network/buffer (Ethernet frame), except if contention
occurs. For some reason DU seems to do better at being more
intelligent than the MPI implementation and doing some aggregation of
messages, thus leading to better peformance. But you should also do
other comparisons like a ping-pong test instead of your original
benchmark. You can also change the LAM code to remove the
TCP_NODELAY option, and then Linux will perform much better.
Altough there is no ideal benchmark, the one you choose is probably
not a very significant one, not because it does show Linux at its
best, but because any parallel application decently written will
aggregate a bunch of small consecutive sends in bigger messages, and
then it looks like Linux beat DU in this area.
In conclusion, I admit that for your particular example, DU is better
(but this is because the design of LAM, and the linux network stack
consider this situation irrelevant in the real world). If you want
even this example to go faster on Linux, disable TCP_NODELAY in LAM,
or you can also try to apply the patch below to the Linux kernel. That
should improve TCP_NODELAY use for these kind of communication
patterns. But anyway, but I would bet that latency in the more usual
senses (either half round-trip time, round-trip time or CPU usage time
in communication) is much better under Linux than under DU.
Regards,
Loic
--- linux/net/ipv4/tcp.c.std Sat Oct 3 20:22:17 1998
+++ linux/net/ipv4/tcp.c Sat Oct 3 20:30:20 1998
@@ -1310,7 +1310,9 @@
* level code in tcp_sendmsg() will force any partial packets out
* after we finish building the largest packets this write allows.
*/
- if (copy < sk->mss && !(flags & MSG_OOB)) {
+ if (copy < sk->mss && !(flags & MSG_OOB) &&
+ // if nonagle the pack is likely to go now
+ !(sk->nonagle && sk->window_seq - sk->write_seq >= seglen && iovlen == 0)) {
tmp = tmp - copy + sk->mtu + 128;
delay = 1;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mpi performance consideration
1998-11-16 11:02 mpi performance consideration Bernard Van Renterghem
1998-11-16 12:39 ` Loic Prylli
@ 1998-11-17 2:47 ` Mike
1 sibling, 0 replies; 6+ messages in thread
From: Mike @ 1998-11-17 2:47 UTC (permalink / raw)
To: axp-list
At 12:02 PM 11/16/98 +0100, you wrote:
>Hello all,
>
>We have a cluster of 16 LX164 533Mhz on a 100 Mb fd switch.
>We have bad performance with mpich 1.0.9 or lam 6.1 with both 2.0.35 or
2.1.126
>kernel with eth drivers de4x5.c:V0.542 100Mb/s full duplex or
tulip.c:v0.83 10/19/97
>
>I include the small program latband.c, tested on two nodes, compiled with
>gcc version egcs-2.92.17 19981026 and glibc 2.0.7
>
>with 2.0.35 lam6.1 -c2c, we have around 64 µsec.
>without -c2c, it's 300 µsec or worse, with all the combinaisons of mpi distr,
> kernel, eth ...
>
>If someone have better performance or any idea in order to improve it,
>please feel free to contact myself.
>(With OSF 4.0, it's around 30 µsec so the users want to switch to OSF :-| )
>
>Regards,
>
>Bernard Van Rent
Well, I'm not an expert on MPI/clustering, but I'll throw in one
suggestion. On almost all Beowulf clusters that I have seen, the inter-node
bandwidth is usually 200-400 mbps. Is the limitation of your system the
inter-node bandwidth? Have you thought of adding bonded ethernet, and
perhaps another switch? If it's not a limitation there, I'd love to hear an
explaination from someone as to what exactly is happening.
Thanks,
Mike
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1998-11-17 16:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-16 11:02 mpi performance consideration Bernard Van Renterghem
1998-11-16 12:39 ` Loic Prylli
1998-11-16 15:35 ` Bernard Van Renterghem
1998-11-16 20:10 ` Wes Bauske
1998-11-17 16:17 ` Loic Prylli
1998-11-17 2:47 ` Mike
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox