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

CORE: Add fn name to score print #1078

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nsarka
Copy link
Collaborator

@nsarka nsarka commented Feb 21, 2025

This PR adds the name of the init function in the score print when debug logging is enabled. It grabs the name using dladdr. If it can't find the symbol, it will show as ?.

I found this useful for my own purposes, so I'm opening this PR in case it might be useful for others as well.

Here is the before-and-after:

Before

       ucc_team.c:471  UCC  INFO  ===== COLL_SCORE_MAP (team_id 32768, size 144) =====
ucc_coll_score_map.c:230  UCC  INFO  Allgather:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..4095}:TL_UCP:10 {4K..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Allgatherv:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Allreduce:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..4095}:TL_UCP:10 {4K..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Alltoall:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..18575}:TL_UCP:10 {18576..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Alltoallv:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Barrier:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Bcast:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..32767}:TL_UCP:10 {32K..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Fanin:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Fanout:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Gather:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Gatherv:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10
ucc_coll_score_map.c:230  UCC  INFO  Reduce:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10

After (with UCC_LOG_LEVEL>=DEBUG)

       ucc_team.c:471  UCC  INFO  ===== COLL_SCORE_MAP (team_id 32768, size 144) =====
ucc_coll_score_map.c:230  UCC  INFO  Allgather:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..4095}:TL_UCP:10=ucc_tl_ucp_allgather_knomial_init {4K..inf}:TL_UCP:10=ucc_tl_ucp_allgather_neighbor_init
ucc_coll_score_map.c:230  UCC  INFO  Allgatherv:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10=ucc_tl_ucp_allgatherv_ring_init
ucc_coll_score_map.c:230  UCC  INFO  Allreduce:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..4095}:TL_UCP:10=ucc_tl_ucp_allreduce_knomial_init {4K..inf}:TL_UCP:10=ucc_tl_ucp_allreduce_sra_knomial_init
ucc_coll_score_map.c:230  UCC  INFO  Alltoall:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..18575}:TL_UCP:10=ucc_tl_ucp_alltoall_bruck_init {18576..inf}:TL_UCP:10=ucc_tl_ucp_coll_init
ucc_coll_score_map.c:230  UCC  INFO  Alltoallv:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10=ucc_tl_ucp_alltoallv_hybrid_init
ucc_coll_score_map.c:230  UCC  INFO  Barrier:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10=ucc_tl_ucp_coll_init
ucc_coll_score_map.c:230  UCC  INFO  Bcast:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..32767}:TL_UCP:10=ucc_tl_ucp_bcast_knomial_init {32K..inf}:TL_UCP:10=ucc_tl_ucp_bcast_sag_knomial_init
ucc_coll_score_map.c:230  UCC  INFO  Fanin:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10=ucc_tl_ucp_coll_init
ucc_coll_score_map.c:230  UCC  INFO  Fanout:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10=ucc_tl_ucp_coll_init
ucc_coll_score_map.c:230  UCC  INFO  Gather:
ucc_coll_score_map.c:230  UCC  INFO  	Host: {0..inf}:TL_UCP:10=ucc_tl_ucp_coll_init

@nsarka nsarka self-assigned this Feb 21, 2025
@nsarka nsarka requested a review from samnordmann February 21, 2025 22:00
Copy link
Collaborator

@janjust janjust left a comment

Choose a reason for hiding this comment

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

much needed - thanks a lot

@artemry-nv
Copy link
Collaborator

bot:retest

@nsarka nsarka force-pushed the nsarka/score-print-fns branch from 3921e7f to 70b9a6b Compare February 26, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants