arcaneframework / alien

Alien: an interface for linear solvers
Apache License 2.0
8 stars 7 forks source link

Define a minimal interface for plugins (functions and symbols to explicitly resolve) #141

Open cedricchevalier19 opened 2 years ago

louis-goyard1 commented 2 years ago

Proposition (for the solver part of the backend):

A plugin shall provide an implementation (eg. PluginSolver) of the IInternalLinearSolver interface, and 4 additional functions to load classes through dlopen :

extern "C" {
  IInternalLinearSolver* createDefault()
  {
    return new PluginSolver();
  }

  IInternalLinearSolver* create(const Alien::BackEnd::Options& options)
  {
    return new PluginSolver(options);
  }

  void destroy(IInternalLinearSolver* p)
  {
    delete p;
  }

 BackEndId name() { return "pluginXX"; }
}

The name() function could be moved to IInternalLinearSolver::name()