Skip to content

Conversation

@brownbaerchen
Copy link
Contributor

After profiling the code on GPUs some more, I noticed some efficiency can be gained from reducing the number of matrix multiplications. That is all that I am doing here: Rather than computing derivatives by multiplying each component with the derivative matrix separately, I construct a large matrix containing the derivative matrix multiple times in order to compute all derivatives simultaneously. Also, I cache the $L$ matrix in the basis of Chebychov T polynomials, rather than computing it every time. This is not a huge difference, but saves a few ms in every call of the function on both CPU and GPU.

@pancetta
Copy link
Member

Please merge master again

@pancetta pancetta merged commit 85dc966 into Parallel-in-Time:master Oct 8, 2024
86 checks passed
@brownbaerchen brownbaerchen deleted the RBC_efficiency branch October 8, 2024 16:01
brownbaerchen added a commit to brownbaerchen/pySDC that referenced this pull request Oct 26, 2025
#!!!!!!!!!! WARNING: RUFF FAILED !!!!!!!!!!: 

#pySDC/projects/GPU/analysis_scripts/compare_RBC3D.py:494:9: E722 Do not use bare `except`
#    |
Parallel-in-Time#492 |                 k[_s > 1e-16], _s[_s > 1e-16], color=last_line.get_color(), ls=last_line.get_linestyle(), label=label
Parallel-in-Time#493 |             )
Parallel-in-Time#494 |         except:
#    |         ^^^^^^ E722
Parallel-in-Time#495 |             pass
#    |
#
#pySDC/projects/GPU/analysis_scripts/compare_RBC3D.py:593:5: F841 Local variable `Delta_Nu` is assigned to but never used
#    |
Parallel-in-Time#591 |     t = data['t']
Parallel-in-Time#592 |     avg_Nu = np.array([np.mean(Nu[40 : 40 + i + 1]) for i in range(len(Nu[40:]))])
Parallel-in-Time#593 |     Delta_Nu = np.array([abs(avg_Nu[i + 1] - avg_Nu[i]) for i in range(len(avg_Nu) - 1)])
#    |     ^^^^^^^^ F841
Parallel-in-Time#594 |     # ax.plot(data['t'][40:-1], Delta_Nu / avg_Nu[:-1])
Parallel-in-Time#595 |     # ax.plot(data['t'], np.abs(avg_Nu - avg_Nu[-1]) / avg_Nu[-1])
#    |
#    = help: Remove assignment to unused variable `Delta_Nu`:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants