-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize/deserialize preconditioner? #141
Comments
Serialization is not currently possible in amgcl. I am not even sure it is possible to implement it in a generic way: amgcl moves preconditioner data (matrices and vectors) to the backend selected by the user as soon as it does not need the internal structures. Some of the backends (such as CUDA/CUSPARSE) store the data in opaque, non-serializable, formats. I guess it could be implemented for the builtin backend, using something like What kind of preconditioner do you use? Does setup really take much longer than the solution? I would make sure that compiler optimizations are enabled during compilation, as C++ can be really slow in debug mode. |
I guess the way to do it would be to serialize whatever internal structures are built right before sending them to the backend. I'm using the MPI+AMG preconditioner with Chebyshev, and VexCL backend (using CUDA/GPUs). Compiler optimizations (-O3 etc.) are definitely enabled. For a very large (few billion degrees of freedom) and distributed system, with a sufficiently strong preconditioner, constructing the preconditioner can take 3-5min while solving the system is like 2min. So I think there would be a legitimate benefit to being able to quickly load a pre-computed preconditioner rather than rebuilding the same preconditioner every time. But not sure how common my use case is :) |
Yes, that is a viable idea.
By the way, is it possible to setup the preconditioner once and then use it with different right-hand-sides within a single run of the program? |
I have a program that I run multiple times. Each time the program runs it uses the same linear system
A
and solvesAx=b
(using AMGCL) with a different right-hand side. Therefore, every time my program runs it's recomputing the preconditioner for the system with AMGCL. Is there any way to serialize the preconditioner to disk (some binary file etc.), and then deserialize the preconditioner (or solver object?) on a subsequent run? It would save a significant amount of time if this were possible since constructing the preconditioner is slow. Thanks for any tips or ideas you might have!The text was updated successfully, but these errors were encountered: