First, if an MPI implementation without thread support does
not need to provide even dummy versions of MPI_OK_Threads
and MPI_Thread_enabled, how can the example programs shown
be compiled for these implementations?
Second, I don't understand why both MPI_Thread_enabled and
MPI_OK_Threads are necessary. If I understand the descriptions
correctly, the only case where one function could return true
and the other false is when some thread can call MPI but the
current one can't. In the example, this is shown as
happening after an implementation has reported that it
supports threads. Is it meaningful for an MPI implementation to
claim that it supports threads when it really only supports
one thread calling MPI? Or will there be implementations where
more than one but fewer than all the threads can call MPI?
A related question: are there any impelementations where
multithreading is unsafe even when only one thread is making