neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
381 stars 114 forks source link

Allow choosing specific regions to measure via instrumentation API #2983

Closed pramodk closed 1 month ago

pramodk commented 1 month ago
# without profiling
./x86_64/special -python test.py
NEURON RUN with 1 threads took 0.649262

# with likwid profiling
likwid-perfctr -C 0 -m -g FLOPS_DP x86_64/special -python test.py
NEURON RUN with 1 threads took 10.734261

i.e. 0.6 sec vs 10.73 sec
export NRN_PROFILE_REGIONS=psolve,state-hh
likwid-perfctr -C 0 -m -g FLOPS_DP x86_64/special -python test.py

....
NEURON RUN with 1 threads took 0.836292
...

Region psolve, Group 1: FLOPS_DP
+-------------------+------------+
|    Region Info    | HWThread 0 |
+-------------------+------------+
| RDTSC Runtime [s] |   0.835792 |
|     call count    |          1 |
+-------------------+------------+

+------------------------------------------+---------+------------+
|                   Event                  | Counter | HWThread 0 |
+------------------------------------------+---------+------------+
|             INSTR_RETIRED_ANY            |  FIXC0  | 5336280000 |
|           CPU_CLK_UNHALTED_CORE          |  FIXC1  | 1987773000 |
|           CPU_CLK_UNHALTED_REF           |  FIXC2  | 1523973000 |
| FP_ARITH_INST_RETIRED_128B_PACKED_DOUBLE |   PMC0  |     489202 |
|    FP_ARITH_INST_RETIRED_SCALAR_DOUBLE   |   PMC1  |  729407200 |
| FP_ARITH_INST_RETIRED_256B_PACKED_DOUBLE |   PMC2  |          0 |
| FP_ARITH_INST_RETIRED_512B_PACKED_DOUBLE |   PMC3  |      -     |
+------------------------------------------+---------+------------+
...
Region state-Nav1_6, Group 1: FLOPS_DP
+-------------------+------------+
|    Region Info    | HWThread 0 |
+-------------------+------------+
| RDTSC Runtime [s] |   0.167490 |
|     call count    |        400 |
+-------------------+------------+

+------------------------------------------+---------+------------+
|                   Event                  | Counter | HWThread 0 |
+------------------------------------------+---------+------------+
|             INSTR_RETIRED_ANY            |  FIXC0  | 1341566000 |
|           CPU_CLK_UNHALTED_CORE          |  FIXC1  |  505899600 |
|           CPU_CLK_UNHALTED_REF           |  FIXC2  |  387861900 |
| FP_ARITH_INST_RETIRED_128B_PACKED_DOUBLE |   PMC0  |          0 |
|    FP_ARITH_INST_RETIRED_SCALAR_DOUBLE   |   PMC1  |  224568600 |
| FP_ARITH_INST_RETIRED_256B_PACKED_DOUBLE |   PMC2  |          0 |
| FP_ARITH_INST_RETIRED_512B_PACKED_DOUBLE |   PMC3  |      -     |
+------------------------------------------+---------+------------+

i.e. only specified regions are enabled and with less overhead.

NOTE: I will document this in the developer docs in a separate PR including LIKWID

azure-pipelines[bot] commented 1 month ago

✔️ 2478ba880d67ecc22f3d638843f1dc4ae0f60249 -> Azure artifacts URL

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 61.11111% with 7 lines in your changes missing coverage. Please review.

Project coverage is 67.28%. Comparing base (2ace814) to head (6578ba1).

Files Patch % Lines
src/coreneuron/utils/profile/profiler_interface.h 61.11% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2983 +/- ## ========================================== - Coverage 67.29% 67.28% -0.01% ========================================== Files 572 572 Lines 104951 104967 +16 ========================================== + Hits 70626 70631 +5 - Misses 34325 34336 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #221715 (:white_check_mark:) have been uploaded here!

Status and direct links:

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

azure-pipelines[bot] commented 1 month ago

✔️ 6578ba1229b97efd94f0766fa9f9f77139b41965 -> Azure artifacts URL

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #221747 (:white_check_mark:) have been uploaded here!

Status and direct links: