nest-simulator icon indicating copy to clipboard operation
nest-simulator copied to clipboard

Create NEST Extension Interface for NEST compatible with new registration scheme and unloading

Open heplesser opened this issue 1 year ago • 4 comments

The title says it all. This is still in draft stage as I need to iron out some problems, especially segfaults on lt_dlclose() of the module. ResetKernel() works and one can install the module again afterwards, but I have not yet checked what happens if the module changes between reloads. At present, I need to provide the (DY)LD_LIBRARY_PATH to the install location of the module. The old DynamicLoader is replaced by ModuleManager and NESTExtensionInterface is the base class for extension modules.

In https://github.com/nest/nest-extension-module/pull/26 you will find a version of mymodule (in the modulemgr branch) that works with this branch of NEST.

This fixes #3064.

heplesser avatar Feb 12 '24 17:02 heplesser

Everything works now, including loading a modified module after ResetKernel(). One still needs to make sure that the path to the extension module is explicitly set in (DY)LD_LIBRARY_PATH, even if it is the same as the installation location for the NEST libs. Got to see if one can improve on this, would need some search-path expansion in the module manager. But otherwise, this is ready for review.

heplesser avatar Feb 13 '24 08:02 heplesser

@pnbabu Thank you for your review! I have fixed most items and commented on the two remaining.

heplesser avatar Feb 20 '24 21:02 heplesser

@clinssen This PR should definitely go into 3.7, but after discussion with @terhorstd I remove the milestone again for technical reasons.

heplesser avatar Feb 29 '24 08:02 heplesser

@clinssen @pnbabu I have now removed the four metadata methods from the NESTExtensionModule interface. I also made a corresponding update to the extension module branch.

heplesser avatar Mar 01 '24 15:03 heplesser

Marked as blocked, because I just discovered a bug in the PR: Changing the number of threads will unload all models from extension modules. I know how to fix this. Also switching to Draft to avoid it being merged by accident.

heplesser avatar Mar 08 '24 15:03 heplesser

@pnbabu @clinssen @terhorstd I fixed the reloading problem now. In the process I made two minor changes to the NESTExtensionModuleInterface:

  • The class is now in namespace nest, I had forgotten this before
  • The init() method is renamed initialize() for consistency with NEST managers

heplesser avatar Mar 11 '24 08:03 heplesser

@terhorstd Thanks for your comments! Could you take a look at my replies?

heplesser avatar Mar 12 '24 11:03 heplesser