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

Performance issue with computeTransportVariables? #19

Open
dreamer2368 opened this issue Dec 10, 2022 · 0 comments
Open

Performance issue with computeTransportVariables? #19

dreamer2368 opened this issue Dec 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dreamer2368
Copy link
Owner

dreamer2368 commented Dec 10, 2022

computeTransportVariables in src/CNSHelperImpl.f90 exhibits a significantly different performance depending on the value of powerLawExponent.

This is the time profile of examples/DeformingWall2D with the default value viscosity_power_law_exponent = 0.666:

magudi profile (timers may not be mutually exclusive):
================================================================================
                     name     % time          calls  total seconds  seconds/call
--------------------------------------------------------------------------------
                    total     100.00              1         4.4058    4.4058E+00
               runForward      97.60              1         4.3001    4.3001E+00
            applyOperator      72.26            410         3.1838    7.7653E-03
           substepForward      70.32             40         3.0981    7.7454E-02
               computeRhs      69.08             40         3.0434    7.6086E-02
        computeRhsForward      67.61             40         2.9789    7.4472E-02
           addDissipation      39.42             40         1.7366    4.3416E-02
updateStateVelocityGradie      18.49             42         0.8148    1.9400E-02
          computeGradient      17.48             84         0.7703    9.1704E-03
updateStateTransportVaria       3.65             42         0.1607    3.8252E-03
           saveRegionData       1.17              2         0.0514    2.5705E-02
updateStateDependentVaria       1.01             42         0.0446    1.0620E-03
            updatePatches       0.80              1         0.0355    3.5464E-02
           loadRegionData       0.73              3         0.0320    1.0677E-02
       addFarFieldPenalty       0.52             80         0.0231    2.8853E-04
           collectAtPatch       0.25             84         0.0109    1.2941E-04
              setupRegion       0.21              1         0.0092    9.2170E-03
 addIsothermalWallPenalty       0.16             80         0.0068    8.5506E-05
  setupBoundaryConditions       0.15              1         0.0064    6.4432E-03
addImpenetrableWallPenalt       0.09             80         0.0038    4.7157E-05
               addSources       0.00             40         0.0001    2.9975E-06
================================================================================

where updateStateTransportVariable takes about 3.8252E-03 seconds/call.
On the other hand, if viscosity_power_law_exponent = 0.5,
the same routine experiences a significant slow down:

magudi profile (timers may not be mutually exclusive):
================================================================================
                     name     % time          calls  total seconds  seconds/call
--------------------------------------------------------------------------------
                    total     100.00              1       209.4751    2.0948E+02
               runForward      99.93              1       209.3246    2.0932E+02
updateStateTransportVaria      96.79             42       202.7568    4.8275E+00
            applyOperator       2.40            410         5.0293    1.2267E-02
           substepForward       2.36             40         4.9395    1.2349E-01
               computeRhs       2.31             40         4.8489    1.2122E-01
        computeRhsForward       2.27             40         4.7451    1.1863E-01
           addDissipation       1.32             40         2.7554    6.8886E-02
updateStateVelocityGradie       0.62             42         1.3086    3.1157E-02
          computeGradient       0.59             84         1.2349    1.4702E-02
            updatePatches       0.04              1         0.0744    7.4369E-02
updateStateDependentVaria       0.03             42         0.0705    1.6780E-03
           saveRegionData       0.03              2         0.0534    2.6711E-02
           loadRegionData       0.03              3         0.0530    1.7673E-02
       addFarFieldPenalty       0.02             80         0.0378    4.7223E-04
           collectAtPatch       0.01             84         0.0175    2.0869E-04
 addIsothermalWallPenalty       0.01             80         0.0119    1.4833E-04
addImpenetrableWallPenalt       0.00             80         0.0065    8.1120E-05
  setupBoundaryConditions       0.00              1         0.0027    2.7114E-03
              setupRegion       0.00              1         0.0026    2.5857E-03
               addSources       0.00             40         0.0002    4.5540E-06
================================================================================

This slow-down happens with certain values of viscosity_power_law_exponent, however not clear why:

  • Slow-down observed: 0.1, 0.3, 0.5, 0.7
  • No slow-down observed: 0.666, 0.2, 0.4, 0.6, 0.8

This occurs both for release and debug.
The cause is not investigated yet. The time profiles are measured on docker container dreamer2368/magudi_env:v0.0.7.

@dreamer2368 dreamer2368 added the bug Something isn't working label Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant