Reduce overhead of read_data and write_data
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- numpy, python
- 領域
- api, performance
調査の方向性
Python バインディングのエントリーポイントである read_data と write_data から始め、リンクされた Discourse スレッドを使って、報告されているオーバーヘッドと reshape、アロケーション、エラーチェックに関する注記を理解してください。Python 側の計測時間を preCICE の計測時間と比較し、そのうえで、不要なコピーやアロケーションを避けながら関数が動作を維持していることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
In this discourse thread, I tracked down the increased duration spent in the "do-nothing solver" down to read_data and write_data.
Most logical explanation would be the additional
- input
vertex_idsandvaluesare copied to a vector, even though passingnp.reshape(X, -1)to the preCICE API suffices and prevents copies. - output values are allocated, then passed to the API, then allocated to build an
np.array - we do a lot of additional error checking (which is good)
Example of rhoVW on solver2, being vectorial data of large mesh:
- Time measured in preCICE: 7ms (note: this doesn't allocate)
- Time measured in Python: 40ms (including overhead from activating profiling in python, this needs to allocate, so overhead scales with size)
Notes:
- With some tweaking I can get this down to 30ms. This makes the function actually shorter, simpler, and easier to follow.
np.flatten()copies the input, whilenp.reshapedoesn't if it can avoid it.- The majority of the generated code seems to be error handling, which we could potentially be avoided by using the CPP API directly for calls to
getDataDimensionsand do this in one place. - This overhead could be profiled with something like https://github.com/precice/precice/issues/1647
- 主要言語
- Cython
- スター
- 30
- フォーク
- 19
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
precice/python-bindings のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
precice/python-bindings#258 · リアクション 1 件 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
precice/python-bindings#175 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
precice/python-bindings#255 ·
-
good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
precice/python-bindings#248 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
precice/python-bindings#238 · コメント 6 件 ·
precice/python-bindings の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
external-issue to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-swift#1151 ·
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
langchain-ai/langgraph#9074 · コメント 1 件 ·
-
documentation specification
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
openai/openai-openapi#584 ·