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

refactor: Refactor log & CSV statistics #3406

Merged
merged 357 commits into from
Jan 16, 2025

Conversation

arng40
Copy link
Contributor

@arng40 arng40 commented Oct 21, 2024

This PR aims to improve log statitistics by using tables.
Additionally, the table log output now includes enhanced features for greater flexibility:

  • Possibility to add sub-columns,
  • Support for merging cells in data,
  • Possibility to add separators.

Statitistics output improves, for SinglePhaseStatistics for instance:

SinglePhaseFlowStatistics, Channel (time 5000 s): Pressure (min, average, max): -3780035.4055568296, 150575.0804809972, 6003777.073592767 Pa
SinglePhaseFlowStatistics, Channel (time 5000 s): Delta pressure (min, max): -3780035.4055568296, 6003777.073592767 Pa
SinglePhaseFlowStatistics, Channel (time 5000 s): Temperature (min, average, max): 0, 0, 0 K
SinglePhaseFlowStatistics, Channel (time 5000 s): Total dynamic pore volume: 50.007528754192336 rm^3
SinglePhaseFlowStatistics, Channel (time 5000 s): Total fluid mass: 50011.30583965373 kg
-----------------------------------------------------------------------------------------------------------------
|                                   compflowStatistics, leakyWell (time 1 s):                                   |
-----------------------------------------------------------------------------------------------------------------
|              statistics               |         min          |       average        |           max           |
-----------------------------------------------------------------------------------------------------------------
|                         Pressure[Pa]  |   6852287.971327121  |   7668119.995536645  |      8491215.639425274  |
|                  Delta pressure [Pa]  |                   0  |                   /  |                      0  |
|                      Temperature [K]  |  302.39500000000004  |  304.74998595102636  |     307.12749999999994  |
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
|                           statistics  |               phase  |                                         value  |
-----------------------------------------------------------------------------------------------------------------
|     Total dynamic pore volume [rm^3]  |                 all  |                             1.695591360000082  |
-----------------------------------------------------------------------------------------------------------------
|    Phase dynamic pore volume: [rm^3]  |                 gas  |                                             0  |
|                                       |               water  |                                       1.69559  |
-----------------------------------------------------------------------------------------------------------------
|                      Phase mass [kg]  |                 gas  |                                             0  |
|                                       |               water  |                                       1795.74  |
-----------------------------------------------------------------------------------------------------------------
|   Trapped phase mass (metric 1) [kg]  |                 gas  |                                             0  |
|                                       |               water  |                                       359.149  |
-----------------------------------------------------------------------------------------------------------------
|             nonTrappedPhaseMass [kg]  |                 gas  |                                             0  |
|                                       |               water  |                                        1436.6  |
-----------------------------------------------------------------------------------------------------------------
|  Immobile phase mass (metric 2) [kg]  |                 gas  |                                             0  |
|                                       |               water  |                                             0  |
-----------------------------------------------------------------------------------------------------------------
|    Mobile phase mass (metric 2) [kg]  |                 gas  |                                             0  |
|                                       |               water  |                                       1795.74  |
-----------------------------------------------------------------------------------------------------------------
|                  Component mass [kg]  |            gas, co2  |                                             0  |
|                                       |          gas, water  |                                             0  |
|                                       |          water, co2  |                         0.0017957448773396687  |
|                                       |        water, water  |                            1795.7430815947907  |
-----------------------------------------------------------------------------------------------------------------

Allowing this kind of output, i.e Mesh partitioning over ranks in DomainPartition.cpp:

 ---------------------------------------------------------------------------------------------------------------------------------------------------------
|                                                             Mesh partitioning over ranks                                                              |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|       Ranks        |            Nodes             |             Edges              |              Faces              |             Elems              |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|                    |  Local  |  Ghost  |  Total   |  Local   |  Ghost   |  Total   |  Local   |  Ghost   |   Total   |  Local   |  Ghost   |  Total   |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|                 0  |  2,522  |    547  |   3,069  |  15,604  |   3,382  |  18,986  |  25,318  |   5,470  |   30,788  |  12,235  |   2,635  |  14,870  |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|                 1  |  2,312  |    817  |   3,129  |  15,059  |   4,302  |  19,361  |  24,993  |   6,396  |   31,389  |  12,238  |   2,908  |  15,146  |
|                 2  |  2,275  |    828  |   3,103  |  14,936  |   4,293  |  19,229  |  24,894  |   6,290  |   31,184  |  12,230  |   2,824  |  15,054  |
|                 3  |  2,092  |    971  |   3,063  |  14,437  |   4,547  |  18,984  |  24,579  |   6,199  |   30,778  |  12,232  |   2,618  |  14,850  |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|               sum  |  9,201  |  3,163  |  12,364  |  60,036  |  16,524  |  76,560  |  99,784  |  24,355  |  124,139  |  48,935  |  10,985  |  59,920  |
|               min  |  2,092  |    547  |   2,639  |  14,437  |   3,382  |  17,819  |  24,579  |   5,470  |   30,049  |  12,230  |   2,618  |  14,848  |
|               max  |  2,522  |    971  |   3,493  |  15,604  |   4,547  |  20,151  |  25,318  |   6,396  |   31,714  |  12,238  |   2,908  |  15,146  |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|  min(local/total)  |           0.682990532158015  |            0.7604825115887063  |             0.7962343496129217  |             0.808002112769048  |
|  max(local/total)  |          0.8217660475724992  |             0.821868745391341  |             0.8223333766402494  |            0.8237037037037037  |
---------------------------------------------------------------------------------------------------------------------------------------------------------

Copy link
Contributor

@paveltomin paveltomin left a comment

Choose a reason for hiding this comment

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

just a few minor things to clean up

@paveltomin paveltomin added ci: run code coverage enables running of the code coverage CI jobs flag: no rebaseline Does not require rebaseline labels Jan 13, 2025
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 89.81723% with 117 lines in your changes missing coverage. Please review.

Project coverage is 56.88%. Comparing base (8f9126c) to head (9653438).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...rs/fluidFlow/CompositionalMultiphaseStatistics.cpp 71.27% 52 Missing ⚠️
...coreComponents/common/format/table/TableLayout.cpp 84.25% 20 Missing ⚠️
...eComponents/common/format/table/TableFormatter.cpp 96.05% 12 Missing ⚠️
.../physicsSolvers/fluidFlow/SourceFluxStatistics.cpp 85.50% 10 Missing ⚠️
...olvers/solidMechanics/SolidMechanicsStatistics.cpp 0.00% 7 Missing ⚠️
...physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp 91.17% 6 Missing ⚠️
...c/coreComponents/common/format/table/TableData.cpp 85.71% 2 Missing ⚠️
...reComponents/mesh/generators/WellGeneratorBase.cpp 86.66% 2 Missing ⚠️
...physicsSolvers/fluidFlow/StencilDataCollection.cpp 0.00% 2 Missing ⚠️
...c/coreComponents/common/format/table/TableData.hpp 83.33% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3406      +/-   ##
===========================================
+ Coverage    56.53%   56.88%   +0.35%     
===========================================
  Files         1157     1157              
  Lines       100617   101214     +597     
===========================================
+ Hits         56880    57580     +700     
+ Misses       43737    43634     -103     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paveltomin
Copy link
Contributor

@MelReyCG requested changes, so it can not be merged

@CusiniM
Copy link
Collaborator

CusiniM commented Jan 15, 2025

I am moving this out of the merge queue coz it is still failing all CI jobs.

@arng40
Copy link
Contributor Author

arng40 commented Jan 16, 2025

I also updated the mesh partitioning table, you can find the new version in the PR description
@paveltomin @rrsettgast

@rrsettgast rrsettgast merged commit 9365098 into develop Jan 16, 2025
25 checks passed
@rrsettgast rrsettgast deleted the feature/dudes/statistics-log-csv-outpout branch January 16, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: no rebaseline Does not require rebaseline type: cleanup / refactor Non-functional change (NFC) type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EPIC] Outputs in GEOS Use data tables for log, and CSV / HDF5 to output statistics
6 participants