Thank you, Brice,
you confirmed what I worried about already. So, I will either have a
significant overhead from thread context switches or a good amount of my
cpu power will go into polling. This is really bad. If there is no
interrupt based mechanism such as select(), which can wait for a number of
sockets without wasting cpu cycles, I doubt that my master/worker type
application (as mentioned by the other guy on the MPICH list) will run with
decent efficiency. It seems like I'll have to sacrifice an extra node to
serve as interface between the control commands coming in via TCP and the
worker messages via MPI, so that the remaining nodes can run at full
performance.

Nevertheless, your answer was very helpful to me. Thanks!
Trevour

2017-06-25 21:19 GMT+02:00 Brice Goglin <brice.gog...@inria.fr>:

> Usually, when you want to listen to two kinds of event, you use
> poll/select on Unix (or epoll on Linux). This strategy doesn't work for MPI
> events because MPI doesn't provide a Unix file descriptor to pass to
> poll/select/epoll. One work-around is to have one thread listen to MPI
> events. When it receives your MPI message, it writes something into a pipe.
> Then your main thread uses poll/select/epoll to listen to your socket and
> to this pipe at the same time.
>
> Another solution is to not busy polling alternatively on both kinds of
> them: MPI_Test*() on your communicator, then non-blocking read() on your
> socket, then MPI_Test(), etc. Works but wastes CPU cycles. Fortunately MPI
> often uses busy polling when waiting for messages anyway, so not sure it
> matters.
>
> Brice
>
>
>
>
> Le 25/06/2017 20:08, Trevour Spencer a écrit :
>
> Dear all,
> I have not yet found a solution for waiting for an event (incoming
> message) to occur either on a TCP socket or on a MPI communicator. I wish I
> could receive some comments from you MPI experts.
> If my question was unclear, I found the same problem described on the
> MPICH list two years ago:
> <https://lists.mpich.org/pipermail/discuss/2015-June/004049.html>
> https://lists.mpich.org/pipermail/discuss/2015-June/004049.html
> He received no reply either.
>
> Is the question stupid for some reason, is the answer trivial, or is there
> no solution to this problem?
>
> Cheers
> Trevour
>
> 2017-06-20 20:15 GMT+02:00 Trevour Spencer <trevourspen...@gmail.com>:
>
>> Dear all,
>> I am looking for a solution to receive messages either via MPI or via a
>> TCP socket, whichever arrives next.
>>
>> Using the select() method as described for example at
>> http://developerweb.net/viewtopic.php?id=2933, I can have my code wait
>> until any of a given set of TCP sockets receives some data.
>>
>> Does a similar solution exist, such that the code waits until data is
>> available either from an MPI communicator or from a TCP socket?
>>
>> Cheers
>> Trevour
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>>  Virenfrei.
>> www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>>
>
>
>
> _______________________________________________
> users mailing 
> listus...@lists.open-mpi.orghttps://rfd.newmexicoconsortium.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users@lists.open-mpi.org
> https://rfd.newmexicoconsortium.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Reply via email to