Reduce overhead of read_data and write_data
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- numpy, python
- Lĩnh vực
- api, performance
Hướng nghiên cứu
Bắt đầu từ các điểm vào của Python binding là read_data và write_data, sử dụng chuỗi thảo luận Discourse được liên kết để hiểu overhead đã được báo cáo cũng như các ghi chú về reshape, việc cấp phát và kiểm tra lỗi. So sánh thời gian đo ở phía Python với thời gian đo của preCICE, sau đó xác minh rằng các hàm vẫn giữ nguyên hành vi đồng thời tránh các thao tác sao chép và cấp phát không cần thiết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Cython
- Star
- 30
- Fork
- 19
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của precice/python-bindings
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
precice/python-bindings#258 · 1 reaction ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
precice/python-bindings#175 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
precice/python-bindings#255 ·
-
good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
precice/python-bindings#248 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
precice/python-bindings#238 · 6 bình luận ·
Tất cả issue của precice/python-bindings
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100