[Ns-bugs] [Bug 1079] MPI code doesn't compile
code at nsnam.ece.gatech.edu
Mon Apr 11 11:35:04 PDT 2011
--- Comment #3 from Gustavo J. A. M. Carneiro <gjcarneiro at gmail.com> 2011-04-11 14:35:03 EDT ---
(In reply to comment #2)
> (In reply to comment #1)
> > Why not make MpiNetDevice a new ns3::Object that is aggregated to the existing
> > ns3::NetDevice subclass? Inside PointToPointNetDevice you can
> > GetObject<MpiNetDevice> (). It's the logical thing to do IMHO...
> Hi, John and I discussed this for a while today, and while he probably has a
> better understanding of the situation, I am still not certain of the best way
> to proceed. I was wondering why we shouldn't just add a virtual function to the
> NetDevice called Receive (or MpiReceive). It seems to me that this should be in
> there anyway (don't all netdevices need to receive?).
I guess the interface between Channel and NetDevice is proprietary for each
link layer technology type, therefore it does not need an abstract virtual
method. This gives l2 models more freedom...
> This way, in
> mpi-interface, we can just use a generic NetDevice to call Receive (or
> MpiReceive) and the appropriate net-device object calls its receive function.
> BTW, the whole reason we have this issue is because we are trying to avoid a
> dependency on point-to-point (or any other more specific) net-device within the
> mpi model, which I couldn't figure out how to eliminate if using the
> AggregateObject method suggested above.
What we have now is:
class PointToPointNetDevice : public NetDevice, public MpiNetDevice
AggregateObject is a (saner) alternative to multiple-inheritance.
Sure, you don't have dependency on point-to-point in the mpi model, but you
have dependency on mpi in the point-to-point model. I suggest only to replace
multiple-inheritance with "interface aggregation" (which is what
AggregateObject means with a non-intuitive name IMHO) functionality of
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Ns-bugs