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

fix(memory_print_option): fix summary output #1466

Merged

Conversation

jdhughes-usgs
Copy link
Contributor

Addition of context to mem_path affected search for unique paths in mem_unique_origins(). Add a function (strip_context_mem_path) to remove a context prepended to the mem_path.

Addition of context to mem_path affected search for unique paths in
mem_unique_origins(). Add a function (strip_context_mem_path) to
remove a context prepended to the mem_path.
@jdhughes-usgs
Copy link
Contributor Author

Before fix:

SUMMARY INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER, IN KILOBYTES
 ----------------------------------------------------------------------------------------------------
 COMPONENT               CHARACTER        LOGICAL         INTEGER          REAL            TOTAL     
 ----------------------------------------------------------------------------------------------------
 SIM                   0.0000000       0.0000000       0.0000000       0.0000000       0.0000000     
 __INPUT__             14.757000       0.0000000       10.548000       33.568000       58.873000     
 FREYBE                6.5340000       2.80000000E-02  107.16000       230.23200       343.95400     
 TDIS                  0.0000000       1.20000000E-02  2.40000000E-02  8.80000000E-02  0.12400000    
 FREYBERG              6.5340000       2.80000000E-02  107.16000       230.23200       343.95400     
 SLN_1                 0.0000000       0.0000000       47.256000       108.91200       156.16800     
 TMPSLN_1              0.0000000       0.0000000       2.80000000E-02  3.20000000E-02  6.00000000E-02
 ----------------------------------------------------------------------------------------------------

After fix:

SUMMARY INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER, IN KILOBYTES
 ----------------------------------------------------------------------------------------------------
 COMPONENT               CHARACTER        LOGICAL         INTEGER          REAL            TOTAL     
 ----------------------------------------------------------------------------------------------------
 SIM                   3.3000000       0.0000000       4.00000000E-02  0.0000000       3.3400000     
 FREYBERG              17.991000       2.80000000E-02  117.66800       263.80000       399.48700     
 TDIS                  0.0000000       1.20000000E-02  2.40000000E-02  8.80000000E-02  0.12400000    
 SLN_1                 0.0000000       0.0000000       47.256000       108.91200       156.16800     
 TMPSLN_1              0.0000000       0.0000000       2.80000000E-02  3.20000000E-02  6.00000000E-02
 ----------------------------------------------------------------------------------------------------

Note: there is a discrepancy in the character total when compared to the total storage.

MEMORY MANAGER TOTAL STORAGE BY DATA TYPE, IN KILOBYTES  
-------------------------------                          
                   ALLOCATED                             
DATA TYPE           MEMORY                               
-------------------------------                          
Character        9.8970000                               
Logical          4.00000000E-02                          
Integer          165.24400                               
Real             372.37600                               
-------------------------------                          
Total            547.55700                               
Virtual          0.0000000                               
-------------------------------                          

Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it true that by removing the prepended context that memory on the IDM side will just be tallied with the memory on the model side? I guess we will also have prepended dunderscores for virtual models and exchanges. Not sure if that is relevant here. Changes seems reasonable. The table is clearly fixed.

@jdhughes-usgs
Copy link
Contributor Author

Is it true that by removing the prepended context that memory on the IDM side will just be tallied with the memory on the model side? I guess we will also have prepended dunderscores for virtual models and exchanges. Not sure if that is relevant here. Changes seems reasonable. The table is clearly fixed.

Virtual model and exchanges will all be under whatever root path there is after __context__

@jdhughes-usgs
Copy link
Contributor Author

revised PR to keep context so there are separate entries for components with a context

SUMMARY INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER, IN KILOBYTES
 ----------------------------------------------------------------------------------------------------
 COMPONENT               CHARACTER        LOGICAL         INTEGER          REAL            TOTAL     
 ----------------------------------------------------------------------------------------------------
 __INPUT__/SIM         3.3000000       0.0000000       4.00000000E-02  0.0000000       3.3400000     
 __INPUT__/FREYBERG    11.457000       0.0000000       10.508000       33.568000       55.533000     
 TDIS                  0.0000000       1.20000000E-02  2.40000000E-02  8.80000000E-02  0.12400000    
 FREYBERG              6.5340000       2.80000000E-02  107.16000       230.23200       343.95400     
 SLN_1                 0.0000000       0.0000000       47.256000       108.91200       156.16800     
 TMPSLN_1              0.0000000       0.0000000       2.80000000E-02  3.20000000E-02  6.00000000E-02
 ----------------------------------------------------------------------------------------------------

add get_mem_path_context character function
Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how this looks.

@jdhughes-usgs jdhughes-usgs merged commit a923d66 into MODFLOW-USGS:develop Dec 6, 2023
15 checks passed
@jdhughes-usgs jdhughes-usgs deleted the fix-memory_print_option branch February 5, 2024 22:19
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