Le 05/09/2012 17:40, Jeff Squyres a écrit :
> I agree -- all of the things you mention are do-able.
> But it's a whole lot more bookkeeping and care/feeding to ensure that nothing goes wrong vs. just calling a hwloc core function and assuming it's there. Such things will require maintenance over time.
> In the end -- it's a tradeoff:
> - do we want the maintenance associated with a struct full of core function pointers?
> - do we want to use the solution I mentioned in http://www.open-mpi.org/community/lists/hwloc-devel/2012/09/3253.php?
It may even be easier in hwloc since plugins are disabled by default. We
may just need to forbid --enable-static and --enabled-plugins
Did anybody ever complained about shared+static not being allowed
simultaneously in OMPI?
> Both have strengths / weaknesses.
> On Sep 5, 2012, at 11:25 AM, Samuel Thibault wrote:
>> Jeff Squyres, le Wed 05 Sep 2012 17:13:56 +0200, a écrit :
>>>> The source code shouldn't need to be modified:
>>>> #define hwloc_foo_bar(arg1, arg2) hwloc_funcs->foo_bar(arg1, arg2)
>>> You need to make sure that #define is only effected in certain places in the code.
>> Well, all the places that will constitute a plugin, no?
>>> And you need to ensure that hwloc_funcs->[foo] isn't attempted to be used before it has been filled in.
>> As I said in my earlier mail, hwloc_funcs would be provided by the
>> loader of the plugin, so it can make sure it's filled in (I forgot to
>> mention that what I call hwloc_funcs above is an internal variable of
>> the plugin, not a symbol provided by libhwloc.so).
>>> And unless there is a very fixed set of functions that can be called by plugins,
>> Well, I believe we'll have to have that anyway. That was part of the
>> whole discussion about plugins a long time ago.
>>> you'll probably need to grow hwloc_funcs over time, which may lead to ABI issues...?
>> Sure. We can for instance make the plugin check for the size of
>> hwloc_funcs provided by the plugin loader vs the size that it was
>> compiled against, and thus refuse to get loaded by an older hwloc.
>> hwloc-devel mailing list