<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=632035520-26022007><FONT face=Arial
color=#0000ff size=2>Sudarshan,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=632035520-26022007><FONT face=Arial
color=#0000ff
size=2>
How many MPI processes are you running on the 4-way SMP and how many processes
of the other application? Does the other application get any CPU at all?
sched_yield just gives up the current time slice for the process and moves it to
the end of the run queue. It will get run again when its turn comes. In other
words, the process doesn't sleep until some event happens. It shares the CPU
with other processes. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=632035520-26022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=632035520-26022007><FONT face=Arial
color=#0000ff size=2>Rajeev</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=632035520-26022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=632035520-26022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> owner-mpich-discuss@mcs.anl.gov
[mailto:owner-mpich-discuss@mcs.anl.gov] <B>On Behalf Of </B>Sudarshan
Raghunathan<BR><B>Sent:</B> Monday, February 26, 2007 11:42 AM<BR><B>To:</B>
mpich-discuss@mcs.anl.gov<BR><B>Subject:</B> [MPICH] MPI_Barrier on ch3:shm
and sched_yield<BR></FONT><BR></DIV>
<DIV></DIV>Dear all,<BR><BR>I have a MPI application where one of the ranks
enters a barrier a lot later than the others. When using the ch3:shm device, I
noticed that the other N-1 ranks chew up all the CPU and seem to be calling
sched_yield. When I start up another CPU-intensive application, the N-1 ranks
waiting on the barrier do not seem to yield to the application that actually
requires the CPU. Is there anything I can do to force the waiting processes to
yield CPU (isn't this the whole point of sched_yield?)? Would it work if I
reimplemented MPI_Barrier to not use MPI_Sendrecv (it would still have to call
MPI_Wait somewhere though..) <BR><BR>I am able to reproduce the problem with
MPICH 2-1.0.5p3 (compiled with the Intel C compiler version 9.1.045) running
on a 4 way Opteron SMP machine (uname -a shows: Linux gezora4 2.6.5-7.283-smp
#1 SMP Wed Nov 29 16:55:53 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux). The
following simple program seems to trigger the problem: <BR>#include
<stdio.h><BR>#include <unistd.h><BR>#include
<mpi.h><BR><BR>int main(void)<BR>{<BR> int
comm_rank;<BR><BR> MPI_Init(NULL, NULL);<BR>
MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);<BR><BR> printf("rank =
%d\t process ID = %d\n", comm_rank, getpid());<BR><BR> if (comm_rank ==
0) {<BR> sleep(600);<BR> }<BR><BR>
MPI_Barrier(MPI_COMM_WORLD);<BR> MPI_Finalize();<BR>}<BR><BR><BR>Thank
you much in advance.
<BR><BR>Regards,<BR>Sudarshan<BR></BLOCKQUOTE></BODY></HTML>