Add cycle counter-based MPI sampler using ARMv9 cntvct_el0 register#100
Draft
Copilot wants to merge 3 commits intonsccsz-toolfrom
Draft
Add cycle counter-based MPI sampler using ARMv9 cntvct_el0 register#100Copilot wants to merge 3 commits intonsccsz-toolfrom
Copilot wants to merge 3 commits intonsccsz-toolfrom
Conversation
Co-authored-by: yuyangJin <37532408+yuyangJin@users.noreply.github.com>
… constant Co-authored-by: yuyangJin <37532408+yuyangJin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add cycle counter-based timer using ARMv9 assembly
Add cycle counter-based MPI sampler using ARMv9 cntvct_el0 register
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a third sampling mode using the ARM cycle counter register for high-precision timing on ARMv9 systems, with automatic fallback to POSIX timer on non-ARM architectures.
Changes
New sampler implementation (
src/sampler/mpi_sampler_cycle_counter.cpp)mrs %0, cntvct_el0/cntfrq_el0__aarch64__,__ARM_ARCH) + runtime validationConfiguration via
PERFLOW_TIMER_METHODenv varauto(default): Use cycle counter on ARM, POSIX elsewherecycle: Request cycle counter (falls back with warning if unavailable)posix: Force POSIX timer onlyBuild system - Added
perflow_mpi_sampler_cycle_countertarget in CMakeLists.txtDocumentation - New user guide at
docs/user-guide/CYCLE_COUNTER_SAMPLER.mdUsage
LD_PRELOAD=lib/libperflow_mpi_sampler_cycle_counter.so \ PERFLOW_TIMER_METHOD=auto \ PERFLOW_SAMPLING_FREQ=1000 \ mpirun -n 4 ./appOutput format identical to existing samplers—compatible with all analysis tools.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.