Skip to content

Statistics subsystem: new available statistics, plotting scripts, tests #74

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

Merged
merged 35 commits into from
Sep 11, 2022

Conversation

Piccions
Copy link
Contributor

This PR aims at improving the usability and the capabilities of the statistics subsystem used to take internal measurements of the simulator behaviour. In particular:

  • The following statistics have been inserted in the simulator, the python interface and the default generated textual report:
    • Anti-messages count
    • Recovery costs, intended as the cost to restore a LP checkpoint and send the related anti-messages; the coasting forward operation costs are captured in another statistics value
    • Size of LP states when checkpointed
    • Costs of checkpoints
    • Event execution costs
    • Count of LPs
  • A comprehensive test for the statistics subsystem, including the related python scripts, has been implemented
  • Several bug related to the statistics subsystem have been fixed
    • Serial runtime statistics issues
    • Edge cases with divisions by zero in absence of rollbacks/checkpoints/processes messages

Piccions added 18 commits July 6, 2022 15:48
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Also updated the textual report with the correct logged average
logged state size.

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
This allows to use high resolution timers and
meaningfully compare them to normal timer values

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
In the previous commit we added a new node wide value which is now
properly documented

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
TODO: put actual testing logic inside of it!

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@Piccions Piccions marked this pull request as draft July 21, 2022 01:33
@github-actions
Copy link

Documentation coverage is 69.9% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  40.3% (27/67)
Enums      :  36.4% (4/11)
Files      :  95.7% (66/69)
Functions  :  71.3% (239/335)
Namespaces :   0.0% (0/2)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  61.7% (113/183)
-----------------------------------
Total      :  69.9% (591/846)

@Piccions
Copy link
Contributor Author

This PR is a work in progress, things are missing and/or broken (we are still missing the full suite of python plotting scripts 😢 ).
I would appreciate some opinions on how to properly test the statistics python scripts. Right now the approach is kind of hacky: I invoke the python interpreter from C code using the system() function and the resulting textual report is checked with the help of another python script. Yes, also this latter script is invoked using system(). Any good ideas in this regard?

Piccions added 2 commits July 21, 2022 13:16
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Now we have two separate plotting scripts to plot single runs and
multi runs statistics.

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@alessandropellegrini
Copy link
Member

Another possibility can be to have python tests, not necessarily using a python testing framework (if the number of python tests increases it can be introduced).

We can launch these python tests directly from ctest:

find_package(Python REQUIRED)
add_test(python_test_whateber
   ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/tests/log/test.py
  )

From there, we could import the various functions from the scripts and test them.
The binary file could be an asset in the test directory.

This does not test the generation-parsing interaction. In that case we could call the simple model from python (using some $<TARGET_FILE:model> generator).

@Piccions
Copy link
Contributor Author

Unfortunately FindPython is not available in CMake 3.10, it has been introduced in the 3.12 version. We can still write a Python test though, but we will have to hardcode the Python interpreter path.
Also, I feel like the binary file shouldn't be a static asset in the repository since the test wouldn't break when it should, e.g.: after heavy changes in the statistics module.
So my new proposal would be to split the current test in two parts: the one that tests the C code and the one that tests the Python parsing script. We can then impose a dependency relationship on those two tests (the Python parsing script consumes the output of the C test). CMake offers this feature to do this!

@alessandropellegrini
Copy link
Member

I don't see any major problem in bumping the CMake version to 3.12 though, because we are anyhow planning to package everything on our side. In this case, having a "newer" dependency is less critical if we can directly provide binaries.

Regarding the test dependency, that's the solution I like the most. I couldn't check this feature's availability (again, luckily, I'm not the CMake expert! 😄).

@Piccions
Copy link
Contributor Author

The only issue in bumping the version to 3.12 is that Ubuntu 18 LTS ships with CMake version 3.10. Yeah, not a big issue. If you agree, we will bump CMake version to 3.12!

@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Merging #74 (362cccd) into develop (7bb0c8d) will increase coverage by 0.51%.
The diff coverage is 70.58%.

@@             Coverage Diff             @@
##           develop      #74      +/-   ##
===========================================
+ Coverage    84.93%   85.44%   +0.51%     
===========================================
  Files           46       46              
  Lines         2131     2158      +27     
  Branches        56       55       -1     
===========================================
+ Hits          1810     1844      +34     
+ Misses         298      293       -5     
+ Partials        23       21       -2     
Impacted Files Coverage Δ
src/datatypes/msg_queue.c 93.93% <ø> (ø)
src/distributed/mpi.c 55.88% <ø> (ø)
test/tests/mm/buddy_hard.c 87.09% <ø> (ø)
test/tests/mm/main.c 100.00% <ø> (ø)
test/tests/visibility/visibility_override.c 100.00% <ø> (ø)
test/tests/visibility/visibility_weak.c 100.00% <ø> (ø)
src/lib/random/random.c 34.28% <7.14%> (ø)
test/framework/test.c 87.64% <50.00%> (-3.72%) ⬇️
test/tests/datatypes/bitmap.c 88.00% <80.00%> (-0.47%) ⬇️
src/log/stats.c 67.50% <88.88%> (-0.30%) ⬇️
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 69.0% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  40.3% (27/67)
Enums      :  36.4% (4/11)
Files      :  94.4% (67/71)
Functions  :  71.5% (254/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  58.2% (113/194)
-----------------------------------
Total      :  69.0% (607/880)

@Piccions Piccions marked this pull request as ready for review July 28, 2022 01:32
@Piccions Piccions linked an issue Jul 28, 2022 that may be closed by this pull request
Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 68.8% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  40.3% (27/67)
Enums      :  36.4% (4/11)
Files      :  94.4% (67/71)
Functions  :  71.5% (254/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  57.7% (113/196)
-----------------------------------
Total      :  68.8% (607/882)

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 68.8% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  40.3% (27/67)
Enums      :  36.4% (4/11)
Files      :  94.4% (67/71)
Functions  :  71.5% (254/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  57.7% (113/196)
-----------------------------------
Total      :  68.8% (607/882)

@github-actions
Copy link

Documentation coverage is 69.4% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  40.3% (27/67)
Enums      :  36.4% (4/11)
Files      :  94.4% (67/71)
Functions  :  71.8% (255/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  69.4% (612/882)

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 69.4% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  40.3% (27/67)
Enums      :  36.4% (4/11)
Files      :  94.4% (67/71)
Functions  :  71.8% (255/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  69.4% (612/882)

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 71.8% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  70.1% (47/67)
Enums      :  45.5% (5/11)
Files      :  94.4% (67/71)
Functions  :  71.8% (255/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  71.8% (633/882)

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 71.9% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  70.1% (47/67)
Enums      :  45.5% (5/11)
Files      :  94.4% (67/71)
Functions  :  72.0% (255/354)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  71.9% (633/881)

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 71.9% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  70.1% (47/67)
Enums      :  45.5% (5/11)
Files      :  94.4% (67/71)
Functions  :  72.0% (255/354)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  71.9% (633/881)

Implemented a new ROOT-Sim API that allows to interrupt a currently
running simulation

Also fixed a bug in the logging module initialization

Criticism and suggestions are always welcome!

Signed-off-by: Andrea Piccione <piccione@diag.uniroma1.it>
@github-actions
Copy link

Documentation coverage is 71.8% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  70.1% (47/67)
Enums      :  45.5% (5/11)
Files      :  94.4% (67/71)
Functions  :  71.8% (255/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  71.8% (633/882)

Copy link
Member

@alessandropellegrini alessandropellegrini left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! Just one minor comment in the review.

@github-actions
Copy link

Documentation coverage is 71.8% 👍

Classes    : 100.0% (1/1)
Defines    :  75.4% (107/142)
Enum Values:  70.1% (47/67)
Enums      :  45.5% (5/11)
Files      :  94.4% (67/71)
Functions  :  71.8% (255/355)
Namespaces :   0.0% (0/3)
Pages      : 100.0% (3/3)
Structs    :  95.2% (20/21)
Typedefs   :  91.7% (11/12)
Variables  :  59.7% (117/196)
-----------------------------------
Total      :  71.8% (633/882)

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Found 11 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Found 38 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Found 41 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Found 68 potential problems in the proposed changes. Check the Files changed tab for more details.

@Piccions Piccions merged commit b1fa574 into develop Sep 11, 2022
@Piccions Piccions deleted the stats_examples branch October 1, 2022 23:00
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.

Test the stats subsystem
2 participants