It says nothing about whether a particular Sun library is thread-safe.
The sentence says only that, if a library is thread-safe, then it will be
safe to call it from MPI. That's obvious. Calling a thread-safe function
from a threaded or a non-threaded program is always safe. It's only
when a THREADED program calls a function that the function's thread
safety matters.
MPI is not multithreaded. Therefore ALL library functions called from
MPI will have no problems with thread safety. A more interesting
question is whether MPI functions may be called safely from inside a
multi-threaded program. As long as all the MPI variables are declared
as global, it ought to be safe. But each shared-memory computer is
different in its ability to maintain memory coherence. It's possible that
some compilers on some machines may not recognize some MPI buffers
as aliased to global variables, and could introduce bugs.
In terms of MPI, when you run any MPI program, an MPI executive
process is created to manage the MPI processes -- creating them,
synchronizing I/O, scheduling processes, and reaping them. The
executive MPI process (probably) is not threaded. If you're having
problems making sense of MPI I/O output, it may be that the MPI
executive is poorly written, and it's buffering the output improperly,
and thereby, mixing and combining the characters when printing then
to the standard Unix streams such as stdout or stderr.
But this is unlikely, since each MPI process's I/O is generally maintained
separately throughout execution and combined in a coordinated manner
by the executive.
Randy
> Dear all,
> I am using SunOS5.8, with SUN's MPI 5.0 implementation
> installed in the machine. My question is: is this
> version of MPI multithreaded-safe?
> In SUN's document: SUN MPI 5.0 Programming and Reference
> Manual, it says:
> ...When you are linked to one of the thread-safe libraries,
> Sun MPI calls are thread safe...
> What does this mean?
> Any help appreciated.
> Yong
Randy Crawford http://cac.engin.umich.edu