Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary memory allocation in supdateSurfacePoint #14

Open
flx-wlf opened this issue Feb 29, 2020 · 0 comments
Open

Unnecessary memory allocation in supdateSurfacePoint #14

flx-wlf opened this issue Feb 29, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request performance Fixing this issue will increase performance

Comments

@flx-wlf
Copy link
Member

flx-wlf commented Feb 29, 2020

Profiling suggests that up to 40% of runtime is spent in updateSurfacePoint. We can get rid of the memory allocation for the buffer by introducing a buffer that persists between calls, either in the Patch class, globally in a namespace, or as an argument to the function. All possibilities should be benchmarked and considered w.r.t. code-complexity and one should be implemented. Note that the solution must be threadsafe since the updatreSurfacePoint is called from an omp-environment.

@flx-wlf flx-wlf added the enhancement New feature or request label Feb 29, 2020
@flx-wlf flx-wlf self-assigned this Feb 29, 2020
@flx-wlf flx-wlf added the performance Fixing this issue will increase performance label Feb 29, 2020
jdoelz added a commit that referenced this issue Jan 30, 2023
…ix to an std::vector of the size of the number of elements. This is to address cache based performance issues with larger refinement levels. Running the tests indicates that there is no significant change in performance. Logs below.

Before changes:
===============================================================================

Running tests...
Test project /home/doelz/Dokumente/Codes/bembeldev_juergen/build
      Start  1: Spline
 1/18 Test  #1: Spline ............................   Passed    0.02 sec
      Start  2: GeometryImportAndEval
 2/18 Test  #2: GeometryImportAndEval .............   Passed    0.01 sec
      Start  3: SurfacePointUpdate
 3/18 Test  #3: SurfacePointUpdate ................   Passed    0.01 sec
      Start  4: Projector
 4/18 Test  #4: Projector .........................   Passed    0.02 sec
      Start  5: Glue
 5/18 Test  #5: Glue ..............................   Passed    0.39 sec
      Start  6: FMMTransferMatrices
 6/18 Test  #6: FMMTransferMatrices ...............   Passed    0.03 sec
      Start  7: FMMForwardTransformation
 7/18 Test  #7: FMMForwardTransformation ..........   Passed    0.06 sec
      Start  8: FMMBackwardTransformation
 8/18 Test  #8: FMMBackwardTransformation .........   Passed    0.05 sec
      Start  9: DuffyTrick
 9/18 Test  #9: DuffyTrick ........................   Passed   10.56 sec
      Start 10: AnsatzSpaceExample
10/18 Test #10: AnsatzSpaceExample ................   Passed    0.01 sec
      Start 11: BlockClusterTreeExample
11/18 Test #11: BlockClusterTreeExample ...........   Passed   12.52 sec
      Start 12: GeometryExample
12/18 Test #12: GeometryExample ...................   Passed    0.01 sec
      Start 13: LaplaceSingleLayerFullExample
13/18 Test #13: LaplaceSingleLayerFullExample .....   Passed   21.49 sec
      Start 14: LaplaceSingleLayerH2Example
14/18 Test #14: LaplaceSingleLayerH2Example .......   Passed   19.89 sec
      Start 15: HelmholtzSingleLayerFullExample
15/18 Test #15: HelmholtzSingleLayerFullExample ...   Passed   27.73 sec
      Start 16: HelmholtzSingleLayerH2Example
16/18 Test #16: HelmholtzSingleLayerH2Example .....   Passed   16.72 sec
      Start 17: MaxwellSingleLayerFullExample
17/18 Test #17: MaxwellSingleLayerFullExample .....   Passed   49.92 sec
      Start 18: MaxwellSingleLayerH2Example
18/18 Test #18: MaxwellSingleLayerH2Example .......   Passed  216.39 sec

100% tests passed, 0 tests failed out of 18

Total Test time (real) = 375.87 sec

After changes:
===============================================================================
Running tests...
Test project /home/doelz/Dokumente/Codes/bembeldev_juergen/build
      Start  1: Spline
 1/18 Test  #1: Spline ............................   Passed    0.02 sec
      Start  2: GeometryImportAndEval
 2/18 Test  #2: GeometryImportAndEval .............   Passed    0.01 sec
      Start  3: SurfacePointUpdate
 3/18 Test  #3: SurfacePointUpdate ................   Passed    0.01 sec
      Start  4: Projector
 4/18 Test  #4: Projector .........................   Passed    0.02 sec
      Start  5: Glue
 5/18 Test  #5: Glue ..............................   Passed    0.39 sec
      Start  6: FMMTransferMatrices
 6/18 Test  #6: FMMTransferMatrices ...............   Passed    0.03 sec
      Start  7: FMMForwardTransformation
 7/18 Test  #7: FMMForwardTransformation ..........   Passed    0.06 sec
      Start  8: FMMBackwardTransformation
 8/18 Test  #8: FMMBackwardTransformation .........   Passed    0.03 sec
      Start  9: DuffyTrick
 9/18 Test  #9: DuffyTrick ........................   Passed   10.42 sec
      Start 10: AnsatzSpaceExample
10/18 Test #10: AnsatzSpaceExample ................   Passed    0.02 sec
      Start 11: BlockClusterTreeExample
11/18 Test #11: BlockClusterTreeExample ...........   Passed   12.42 sec
      Start 12: GeometryExample
12/18 Test #12: GeometryExample ...................   Passed    0.01 sec
      Start 13: LaplaceSingleLayerFullExample
13/18 Test #13: LaplaceSingleLayerFullExample .....   Passed   17.39 sec
      Start 14: LaplaceSingleLayerH2Example
14/18 Test #14: LaplaceSingleLayerH2Example .......   Passed   19.76 sec
      Start 15: HelmholtzSingleLayerFullExample
15/18 Test #15: HelmholtzSingleLayerFullExample ...   Passed   23.60 sec
      Start 16: HelmholtzSingleLayerH2Example
16/18 Test #16: HelmholtzSingleLayerH2Example .....   Passed   16.52 sec
      Start 17: MaxwellSingleLayerFullExample
17/18 Test #17: MaxwellSingleLayerFullExample .....   Passed   47.77 sec
      Start 18: MaxwellSingleLayerH2Example
18/18 Test #18: MaxwellSingleLayerH2Example .......   Passed  216.50 sec

100% tests passed, 0 tests failed out of 18

Total Test time (real) = 365.03 sec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Fixing this issue will increase performance
Projects
None yet
Development

No branches or pull requests

1 participant