Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarkauskas committed Feb 26, 2025
1 parent 89e9d7a commit 3921e7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/coll_score/ucc_coll_score.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ucc_status_t ucc_coll_score_dup(const ucc_coll_score_t *in,
void ucc_coll_score_set(ucc_coll_score_t *score,
ucc_score_t value);

void ucc_coll_score_map_print_info(const ucc_score_map_t *score);
void ucc_coll_score_map_print_info(const ucc_score_map_t *score, int verbosity);

ucc_status_t ucc_coll_score_update(ucc_coll_score_t *score,
ucc_coll_score_t *update,
Expand Down
30 changes: 13 additions & 17 deletions src/coll_score/ucc_coll_score_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#include "utils/ucc_string.h"
#include "schedule/ucc_schedule.h"

#if ENABLE_DEBUG == 1
#include <dlfcn.h>
#endif

typedef struct ucc_score_map {
ucc_coll_score_t *score;
Expand Down Expand Up @@ -161,7 +159,6 @@ ucc_status_t ucc_coll_init(ucc_score_map_t *map,
} \
}

#if ENABLE_DEBUG == 1
static const char *get_fn_name(ucc_base_coll_init_fn_t init_fn)
{
int status;
Expand All @@ -173,9 +170,8 @@ static const char *get_fn_name(ucc_base_coll_init_fn_t init_fn)
}
return fn_ptr_str;
}
#endif

void ucc_coll_score_map_print_info(const ucc_score_map_t *map)
void ucc_coll_score_map_print_info(const ucc_score_map_t *map, int verbosity)
{
size_t left;
ucc_msg_range_t *range;
Expand Down Expand Up @@ -211,18 +207,18 @@ void ucc_coll_score_map_print_info(const ucc_score_map_t *map)
sizeof(range_str));
ucc_score_to_str(range->super.score, score_str,
sizeof(score_str));
#if ENABLE_DEBUG == 1
// If debug, get the name of the init function through dladdr
STR_APPEND(coll_str, left, 256, "{%s}:%s:%s=%s ",
range_str,
range->super.team->context->lib->log_component.name,
score_str, get_fn_name(range->super.init));
#else
STR_APPEND(coll_str, left, 256, "{%s}:%s:%s ",
range_str,
range->super.team->context->lib->log_component.name,
score_str);
#endif
if (verbosity >= UCC_LOG_LEVEL_DEBUG) {
// Get the name of the init function through dladdr
STR_APPEND(coll_str, left, 256, "{%s}:%s:%s=%s ",
range_str,
range->super.team->context->lib->log_component.name,
score_str, get_fn_name(range->super.init));
} else {
STR_APPEND(coll_str, left, 256, "{%s}:%s:%s ",
range_str,
range->super.team->context->lib->log_component.name,
score_str);
}
}
STR_APPEND(coll_str, left, 4, "\n");
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/ucc_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ ucc_status_t ucc_team_create_test_single(ucc_context_t *context,
team->rank == 0) {
ucc_info("===== COLL_SCORE_MAP (team_id %d, size %u) =====",
team->id, team->size);
ucc_coll_score_map_print_info(team->score_map);
ucc_coll_score_map_print_info(team->score_map,
ucc_global_config.log_component.log_level);
ucc_info("================================================");
}
/* TODO: add team/coll selection and check if some teams are never
Expand Down

0 comments on commit 3921e7f

Please sign in to comment.