[ofiwg] [libfabric-users] same process, multiple endpoints

Maurizio Drocco drocco at di.unito.it
Mon May 23 13:52:14 PDT 2016

Thank you Sean,

I try to explain better what I need. Please also find some comments 
inline with your reply.

Assume a single process P which needs to communicate with two other 
processes PA and PB over two different channels A and B.

In TCP terms, this can be done by using two sockets in P, both at IP 
hostP but each bound to a specific TCP port (hostP:portA and 
hostP:portB) etc.

Mapping it to libfabric, I would create two endpoints from P but I don't 
know how to realize the behavior of communicating with two different 
peers over the two endpoints. Is there some way to "bind" an endpoint to 
a host:port pair?

> Re-posting to ofiwg mail list, as this is more of a developer question.
>> Hi all,
>> I am from the alpha group [http://alpha.di.unito.it/] (CS dept. @ Univ. of
>> Torino, Italy).
>> We just started to integrate libfabric into FastFlow [link], on the track
>> of the great job by Paolo Inaudi with the A3Cube provider.
>> After several readings of all the man pages and some online tutorials, I
>> still cannot understand how to work with contexts, domains and endpoints.
> I'm not sure what you're referring to exactly by context.  In the documentation, a context is probably easiest to think of a command queue or work queue.  In the simplest case, an endpoint has 2 contexts -- one for sending and another for receiving.
> Note that we use the term context rather than queue because there's no guarantee that work that has been posted to an endpoint completes in order.
Sorry I made some confusion with terminology here. I was talking about 
the hierarchy from [http://www.slideshare.net/seanhefty/ofi-overview]:
- Fabric domain (fi_getinfo)
- domain (fi_domain)
- endpoint (fi_endpoint)

Here I don't know how to obtain the two endpoints I need: I need to 
obtain different fi_info structures (by two different calls to 
fi_getinfo with same IP address and different TCP ports) but I want them 
to share the same domain. The domain itself comes from a preliminary 
fi_getinfo call which is "agnostic" with respect to addresses.
>> I try to illustrate the problem:
>> 1) single process attached to NIC with address X
>> 2) two connection-less endpoints A and B
>> 3) endpoint A should accept data from X:portA, while B from X:portB
>> If I try to map the hierarchy proposed in the libfabric "object model" I
>> would instantiate one context, one domain and both endpoints (and
>> respective queues) to that single domain. In this setting, I cannot find
>> how to specify the different ports for the endpoints. Actually I just need
>> to ensure endpoint A will find only messages sent to portA in its
>> completion queue, but I cannot figure out how to do it.
> It sounds like you need different addresses for the two ports.  Then assign address A from port A to endpoint A, and address B from port B to endpoint B.
> An example from IP land would be to assign port A address and port B  Endpoint A would have address, and B address  The '12345' in this example are transport (e.g. UDP or TCP port) numbers.
As I said, I need two different TCP ports on the same IP host.
I hope I was a bit more clear now.

Thank you again :)

>> Conversely, all the examples I saw (e.g. fabtests benchmarks) use a single
>> endpoint per process and the libfabric context is initialized with hints
>> and arguments specific to the endpoint. This means I should prefer to
>> instantiate one domain (and one context) for each endpoint?
> If you have a single NIC, a single domain should be sufficient.
> - Sean

Maurizio Drocco
PhD Student
University of Torino, department of Computer Science
Via Pessinetto 12, 10149 Torino - Italy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofiwg/attachments/20160523/e9879653/attachment.html>

More information about the ofiwg mailing list