Re: [OMPI users] waiting for message either from MPI communicator or from TCP socket

2017-06-25 Thread Trevour Spencer
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 :

> 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
> 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 :
>
>> 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
>>
>>
>> 
>>  Virenfrei.
>> www.avast.com
>> 
>>
>
>
>
> ___
> 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

Re: [OMPI users] waiting for message either from MPI communicator or from TCP socket

2017-06-25 Thread Brice Goglin
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
> 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  >:
>
> 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
>
> 
> 
>   Virenfrei. www.avast.com
> 
> 
>
>
>
>
>
> ___
> 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

Re: [OMPI users] waiting for message either from MPI communicator or from TCP socket

2017-06-25 Thread r...@open-mpi.org
I suspect nobody is answering because the question makes no sense to us. You 
are implying that the TCP socket is outside of MPI since it isn’t tied to a 
communicator. If you want to setup a non-MPI communication path between two 
procs and monitor it separate from the MPI library, you can certainly do so - 
there is nothing that prevents you from doing it.

I suspect that question went similarly unanswered for the same reason.

> On Jun 25, 2017, at 11:08 AM, Trevour Spencer  
> wrote:
> 
> 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 
> 
> 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  >:
> 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
> 
>  
> 
> Virenfrei. www.avast.com 
> 
>  
> ___
> 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

Re: [OMPI users] waiting for message either from MPI communicator or from TCP socket

2017-06-25 Thread Trevour Spencer
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
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 :

> 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
>
>
> 
>  Virenfrei.
> www.avast.com
> 
> <#m_-4216220911187895472_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
___
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users