AMGX problem - multiple solvers simultaeously

I am having trouble using two or more solvers from the AMGX library simultaneously. Doing this leads to undefined behavior of one of the solvers, i.e. the reported convergence rate are considerably different (often diverging) even though matrices start guess, RHS and solver configuration are identical. It seems that some objects are shared between the solvers even though they have separate handle objects (resources, config, solve, matrix, vectors). In particular “resources_destroy” cannot be called without error on any of the resoruces objects active simultaneously. I am running on a single GPU system.

Do you know the cause of the issue? Or do you have a working example of simultaneous use of several AMGX solvers?

Yes, there is only one resources object that can exist at a time, but multiple solvers can share it. As long as only one solver is doing a solve() at a given time, and you don’t destroy the resources object before the last solve completes, this has been tested and shown to work.
AmgX is designed for large-scale problems, so it assumes each problem might consume all the available GPU resources. To do multiple identical systems, you will have to serialize them. This is a common use-case in CFD, first solve a pressure equation, then update velocities, then solve for temperatures for example.