The problem is the following: I call several pairs of queries from root to slaves according to the following scheme:

MPI_isend -> MPI_irecv -> slave work -> MPI_wait_all 

At the MPI_isend stage, the MPI_isend sends the request also to itself, but at the MPI_wait_all stage the MPI_wait_all hangs on waiting for the processing of this request, if the slave work made from another thread.

Can anyone answer, is this a normal situation if the level of synchronization is set to MPI_THREAD_SERIALIZED ?

    1 answer 1

    This is not explicitly stated in the standard, therefore it depends on the implementation. I advise you not to make references to yourself, even asynchronous ones, since this is a potential clinch.

    • 2
      Try to write more detailed answers. Explain what is the basis of your opinion? - Nicolas Chabanovsky
    • In general, it is stipulated . I think MPI_wait_all starts working before the logic from the stream, so it blocks any calls to MPI, including parallel ones. At the time of the problem, I tried all the synchronization options, except for MPI_THREAD_MULTIPLE , which was not supported in the MS-MPI implementation. Perhaps in this mode, such a strategy would be workable. - mega
    • one
      Was inattentive, but in MPI_THREAD_SERIALIZED this is a logical behavior, since if MPI_wait_all is called before MPI_irecv in another thread, then the second thread has no chance to call MPI_irecv. In this case, it is better to use MPI_iprobe, for example with the indication ANY_SOURCE, which is certainly more troublesome, but also more reliable, since there are no blocking calls. - zhum