[MPICH] thread safety
Rajeev Thakur
thakur at mcs.anl.gov
Mon Sep 12 09:18:53 CDT 2005
MPICH2 supports threads on Linux. Currently it's only for the default sock
channel. There are, however, some bugs in the 1.0.2p1 release, which we have
recently fixed.
The problem you have encountered is a different one though. In your program,
a process sends data to itself. In the non-threaded case, MPICH2 (currently)
requires that the receive be posted before the send, or the send be a
nonblocking one (Isend). That is, MPICH2 doesn't buffer the data internally.
We have been thinking of relaxing that requirement, and clearly in the
multithreaded case, we need to.
In the meanwhile, if you can ensure that the recv is posted before the
blocking send (when a process sends data to itself) the program will work.
For communication between threads on different processes work, replace the
file src/mpid/common/sock/poll/sock_wait.i with the attached file and rerun
make.
Rajeev
> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of
> lunasole at interfree.it
> Sent: Monday, September 12, 2005 3:54 AM
> To: mpich-discuss at mcs.anl.gov
> Subject: [MPICH] thread safety
>
>
> hi all,
> MPICH2 includes parts of MPI-2. from README, the sock channel
> now has preliminary support for MPI_THREAD_SERIALIZED and
> MPI_THREAD_MULTIPLE on both Unix and Microsoft Windows. Does
> it means that the thread safety isn't implemented in Linux?
> i implemented a simple example (a process creates 2 threads:
> one thread that it sends a buffer and an other that it
> receives this) but it doesn't work. In attached the source
> file and an example of output.
> thank's for you help.
>
>
> --------------------------------------------------------------
> -----------
> Visita http://domini.interfree.it, il sito di Interfree dove trovare
> soluzioni semplici e complete che soddisfano le tue esigenze
> in Internet,
> ecco due esempi di offerte:
>
> - Registrazione Dominio: un dominio con 1 MB di spazio disco
> + 2 caselle
> email a soli 18,59 euro
> - MioDominio: un dominio con 20 MB di spazio disco + 5 caselle email
> a soli 51,13 euro
>
> Vieni a trovarci!
>
> Lo Staff di Interfree
> --------------------------------------------------------------
> -----------
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sock_wait.i
Type: application/octet-stream
Size: 26792 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20050912/7a9ed334/attachment.obj>
More information about the mpich-discuss
mailing list