|
33 | 33 | multipole_acceptance = 0.3... |
34 | 34 |
|
35 | 35 | Best Parameters: |
36 | | - leaf_size_source: [90] |
| 36 | + leaf_size_source: [114] |
37 | 37 | expansion_order: 1 |
38 | 38 | multipole_acceptance: 0.3 |
39 | | - cost: 0.182980358 seconds |
| 39 | + cost: 0.182874213 seconds |
40 | 40 |
|
41 | 41 | multipole_acceptance = 0.4... |
42 | 42 |
|
43 | 43 | Best Parameters: |
44 | | - leaf_size_source: [45] |
| 44 | + leaf_size_source: [57] |
45 | 45 | expansion_order: 2 |
46 | 46 | multipole_acceptance: 0.4 |
47 | | - cost: 0.172838057 seconds |
| 47 | + cost: 0.172793256 seconds |
48 | 48 |
|
49 | 49 | multipole_acceptance = 0.5... |
50 | 50 |
|
51 | 51 | Best Parameters: |
52 | 52 | leaf_size_source: [110] |
53 | 53 | expansion_order: 1 |
54 | 54 | multipole_acceptance: 0.5 |
55 | | - cost: 0.182957063 seconds |
| 55 | + cost: 0.18288315 seconds |
56 | 56 |
|
57 | 57 | multipole_acceptance = 0.6... |
58 | 58 |
|
59 | 59 | Best Parameters: |
60 | | - leaf_size_source: [875] |
| 60 | + leaf_size_source: [876] |
61 | 61 | expansion_order: 1 |
62 | 62 | multipole_acceptance: 0.6 |
63 | | - cost: 0.18274234 seconds |
| 63 | + cost: 0.182574935 seconds |
64 | 64 |
|
65 | 65 | multipole_acceptance = 0.7... |
66 | 66 |
|
67 | 67 | Best Parameters: |
68 | | - leaf_size_source: [437] |
| 68 | + leaf_size_source: [438] |
69 | 69 | expansion_order: 1 |
70 | 70 | multipole_acceptance: 0.7 |
71 | | - cost: 0.182818002 seconds |
| 71 | + cost: 0.182580796 seconds |
72 | 72 |
|
73 | 73 | multipole_acceptance = 0.8... |
74 | 74 | <span class="sgr33"><span class="sgr1">┌ Warning: </span></span>Error tolerance 0.0001 not reached! Using max expansion order P=3. |
|
77 | 77 | <span class="sgr33"><span class="sgr1">└ </span></span><span class="sgr90">@ FastMultipole ~/work/FastMultipole.jl/FastMultipole.jl/src/translate.jl:990</span> |
78 | 78 |
|
79 | 79 | Best Parameters: |
80 | | - leaf_size_source: [218] |
| 80 | + leaf_size_source: [219] |
81 | 81 | expansion_order: 6 |
82 | 82 | multipole_acceptance: 0.8 |
83 | | - cost: 0.163710486 seconds |
| 83 | + cost: 0.167430904 seconds |
84 | 84 |
|
85 | 85 | Finished autotune! |
86 | 86 |
|
87 | 87 | Parameters: |
88 | | - leaf_size_source: [218] |
| 88 | + leaf_size_source: [219] |
89 | 89 | expansion_order: 6 |
90 | 90 | multipole_acceptance: 0.8 |
91 | | - cost: 0.163710486 seconds |
| 91 | + cost: 0.167430904 seconds |
92 | 92 |
|
93 | 93 | #===============================================# |
94 | 94 |
|
95 | | -Optimal parameters: (leaf_size_source = [218], expansion_order = 6, multipole_acceptance = 0.8)</code></pre><p>This will return a named tuple of the optimal parameters, which can then be passed to the <code>fmm!</code> function. The <code>cache</code> is a preallocated buffer that can be used to reduce memory allocations during the FMM call.</p><pre><code class="language-julia hljs"># run FMM without default parameters |
| 95 | +Optimal parameters: (leaf_size_source = [219], expansion_order = 6, multipole_acceptance = 0.8)</code></pre><p>This will return a named tuple of the optimal parameters, which can then be passed to the <code>fmm!</code> function. The <code>cache</code> is a preallocated buffer that can be used to reduce memory allocations during the FMM call.</p><pre><code class="language-julia hljs"># run FMM without default parameters |
96 | 96 | println("Default Tuning Parameters:") |
97 | 97 | system.potential .= 0.0 |
98 | 98 | t1 = @elapsed fmm!(system; scalar_potential=true, gradient=false, hessian=false, error_tolerance=PowerAbsolutePotential(1e-4)) |
|
110 | 110 | println("\tmax error: ", maximum(abs.(phi_direct .- phi_fmm))) |
111 | 111 | println("\ttime cost: ", t2, " seconds")</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Default Tuning Parameters: |
112 | 112 | max error: 0.00033237800897240044 |
113 | | - time cost: 0.174775679 seconds |
| 113 | + time cost: 0.19163484 seconds |
114 | 114 | Optimal Tuning Parameters: |
115 | 115 | max error: 0.00033237800897240044 |
116 | | - time cost: 0.192555186 seconds</code></pre><p>Note that the <code>tune_fmm</code> function iterates over each requested <code>multipole_acceptance</code> criterion, so it is not optimal to call it before every FMM call. Instead, <code>tune_fmm</code> can be called once for a representative system primarily to choose <code>multipole_acceptance</code>. Since the optimal parameters depend on the size, distribution, and strengths of the sources and targets, it is recommended to set the keyword argument <code>tune=true</code> to iteratively update the <code>expansion_order</code> and <code>leaf_size_source</code> parameters each time <code>fmm!</code> is called. This will allow the FMM to adapt to the system as it evolves, and will ensure that the optimal parameters are used for each call.</p><div class="admonition is-success" id="Tip-709239aed0176e90"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-709239aed0176e90" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function can be used to automatically tune the FMM parameters to satisfy an error tolerance. It returns a named tuple of the optimal parameters and a preallocated buffer to reduce memory allocations.</p></div></div><div class="admonition is-warning" id="Warning-36707f035a97fc82"><header class="admonition-header">Warning<a class="admonition-anchor" href="#Warning-36707f035a97fc82" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function is computationally expensive, so it should not be called before every FMM call. Instead, it should be called once for a representative system to choose the optimal <code>multipole_acceptance</code> parameter. Then, the optimal parameters will be updated in each <code>fmm!</code> call if the <code>tune=true</code> keyword argument is set. This allows the FMM to adapt to the system as it evolves.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../advanced_usage/">« Multiple Systems</a><a class="docs-footer-nextpage" href="../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Thursday 4 September 2025 20:11">Thursday 4 September 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
| 116 | + time cost: 0.19606729 seconds</code></pre><p>Note that the <code>tune_fmm</code> function iterates over each requested <code>multipole_acceptance</code> criterion, so it is not optimal to call it before every FMM call. Instead, <code>tune_fmm</code> can be called once for a representative system primarily to choose <code>multipole_acceptance</code>. Since the optimal parameters depend on the size, distribution, and strengths of the sources and targets, it is recommended to set the keyword argument <code>tune=true</code> to iteratively update the <code>expansion_order</code> and <code>leaf_size_source</code> parameters each time <code>fmm!</code> is called. This will allow the FMM to adapt to the system as it evolves, and will ensure that the optimal parameters are used for each call.</p><div class="admonition is-success" id="Tip-709239aed0176e90"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-709239aed0176e90" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function can be used to automatically tune the FMM parameters to satisfy an error tolerance. It returns a named tuple of the optimal parameters and a preallocated buffer to reduce memory allocations.</p></div></div><div class="admonition is-warning" id="Warning-36707f035a97fc82"><header class="admonition-header">Warning<a class="admonition-anchor" href="#Warning-36707f035a97fc82" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function is computationally expensive, so it should not be called before every FMM call. Instead, it should be called once for a representative system to choose the optimal <code>multipole_acceptance</code> parameter. Then, the optimal parameters will be updated in each <code>fmm!</code> call if the <code>tune=true</code> keyword argument is set. This allows the FMM to adapt to the system as it evolves.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../advanced_usage/">« Multiple Systems</a><a class="docs-footer-nextpage" href="../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 5 September 2025 19:00">Friday 5 September 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
0 commit comments