On 27 April 2016 at 11:53, Patrick Sanan <[email protected]> wrote: >
> includes), and have them add a single registration line after > PetscInitialize which makes the new solver usable just as the built-in > ones are (via the options database and command line arguments). Actually, if you build your plugin as a shared library, then you can just -dll_append pcsupercool.so and get it registered, no need to modify code. > > I don't know of any packages that actually do this - are there some? > Don't know. But I would argue that many packages currently in PETSc could be reworked as plugins very easily. Oh! Hold on. We have some support for writing "plugins" in Python, and we dynamically load the Python shared library to bootstrap the Python runtime and then petsc4py. And IMHO, this is quite a bit more complicated that plain C plugins. > > Is this a hassle for reasons I haven't thought through fully yet? > The only hassle would be to updating it after new PETSc releases. And BTW, you could keep your code compatible with older PETSc releases with proper processor guards. A minor issue with dynamically loadable plugins is that using the command line is the only way to configure the package is through the command line. But that's a fair price to pay for not having to ever modify (nor recompile) your code. > The specific interest I have in this is that a student of Olaf's has > been working with an interface to (non-MKL) PARDISO which I think > could be useful, and I'm also interested in there being an interface > to ILUPack. > Go for it. I can help with comments and review. PS: I'm not 100% sure about the status of dynamic lib loading in PETSc, but I can help with any required refactoring of that machinery to better support plugins. -- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Extreme Computing Research Center (ECRC) King Abdullah University of Science and Technology (KAUST) http://ecrc.kaust.edu.sa/ 4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 0109 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa Office Phone: +966 12 808-0459
