barbagroup / fmm-bem-relaxed Goto Github PK
View Code? Open in Web Editor NEWSource code for the paper on inexact Krylov iterations with FMM BEM
Source code for the paper on inexact Krylov iterations with FMM BEM
According to the relaxation strategy that std::log2
instead of std::log
in predict_p function.
I am not sure if this repository / the research work is actively maintained. I am following your paper and this code for my research work. But i have trouble in making it work for mixed and robin boundary conditions since you only have examples that deal with one specific type of boundary condition in a run.
If there is any example (even if its very elementary) would be really useful.
Thanks in advance.
I am trying to use the code to reproduce the speedup for Laplace 1st-kind problem. So I ran the first non-relaxed case (corresponding to the non-relaxed case on the first row of the table below) using:
theta = 0.5, N = 2048 (recursions = 5) , ncrit = 400
In the terminal, I first ran (without preconditioning)
./LaplaceBEM -theta 0.5 -ncrit 400 -p 8 -recursions 5 -fixed_p -gmres -solver_tol 1e-5
and I got the result like this:
initialised 2048 triangles
...
Solver: GMRES
Preconditioner: Identity
it: 001, res: 2.311e-04, fmm_req_p: 8
it: 002, res: 9.630e-05, fmm_req_p: 8
it: 003, res: 4.506e-05, fmm_req_p: 8
it: 004, res: 1.935e-05, fmm_req_p: 8
Final residual: 9.2838e-06, after 5 iterations
TIMING:
setup : 3.6045e+00s
solve : 1.5399e+01s
external phi: 0.192, exact: 0.19245, error: 2.3505e-03
error: 5.344e-03
The answer seemed to be correct, so then I tried to used the diagonal matrix as the preconditioner (try to match the "t_solve = 0.27" in the table):
./LaplaceBEM -theta 0.5 -ncrit 400 -p 8 -recursions 5 -fixed_p -gmres -diagonal -solver_tol 1e-5
I got this:
initialised 2048 triangles
......
Creating plan: 0.00376582
Executing plan: 3.58662
1st-kind equation being solved
TIMING:
setup : 3.5906e+00s
solve : 4.9171e-03s
external phi: 2.1197e-10, exact: 0.19245, error: 1.0000e+00
error: 1.000e+00
it seems that the preconditioner is not working this time. I tried the "local" preconditioned with "fgmres" solver, and got the same error. I compiled the code using the Makefile in the "examples" folder, and gave me no error on LaplaceBEM executable. And the gcc version on phantom is 4.6.
Would you @slayton58 help me out on how to use the diagonal preconditioner correctly to get a similar performance of t_solve = 0.27 in this case?
Thank you.
Tingyu
I used massif tool in valgrind to monitor the heap usage of StokesBEM running on phantom (for 4 threads). I didn't recorded the stack usage for StokesBEM since it would slow down valgrind a lot for a large problem size (recursions=6).
In the figures below, x-axis shows the number of instructions executed, y-axis gives how much heap memory is used.
The heap usage peaks when the code is generating RHS. There is an almost doubled memory usage at that point. When I enable lazy evaluation, I think it is creating the RHS plan that doubles the memory usage. (line 198 in LaplaceBEM.cpp)
FMM_plan<kernel_type> rhs_plan = FMM_plan<kernel_type>(K,panels,opts);
I read the class definition of FMM_plan but could not find where the code needs to allocate extra heap. Would you recall and help me on that? @slayton58 Thanks.
Here is the stack+heap usage on a smaller case (recursions=4). I found a similar peak.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.