Thanks a lot. But maybe I need to make my point a bit more clear. First, wait or 
waitpid  is not what Posix Thread have implemented. It's part of Unix(linux) AFAIK. 
And I think Pthread do provide some sybchronization function.So from the program, I 
think pthread_join used by the main process don't return until the child thread it 
created exit/cancled. And I've tried to put wait in the main process, but the same 
problem exsits. 

Second, we just want to make this program running on a Beowulf-like SMP Cluster.  In 
the SMP node, I just program not to use mpi's communication, but rather accessing 
shared variable. I've  attached the src code of the PI program. please check.

> 
 > In a special Beowulf-like cluster with SMP nodes you might think of a
> benefit using threads to do the communication between the SMP-CPUs and
> let TCP/IP (or other network related communication software, perhaps
> SCI, Myrinet) do the work between the nodes.
> 
> BUT: This technique IS available within mpich-1.2.x and LAM/MPI and
> Cray's and Sun's implementations of MPI on cc-NUMA architectures are
> able to do shared memory accesses on top of MPI calls to have an
> improved performance between the SMP CPU's on the same node.
> 
> So why use threads with MPI?

We run the program on a 2-way SMP. The MPI is MPICH-1.2.0.
And we just want to take advantage of the merits u mentioned above.


pi.c

Reply via email to