Skip to content

[OpenMP] [NFC] Remove KMP_NESTED_HOT_TEAMS macro #143584

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions openmp/runtime/src/kmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,6 @@ class kmp_stats_list;
#define USE_FAST_MEMORY 3
#endif

#ifndef KMP_NESTED_HOT_TEAMS
#define KMP_NESTED_HOT_TEAMS 0
#define USE_NESTED_HOT_ARG(x)
#else
#if KMP_NESTED_HOT_TEAMS
#define USE_NESTED_HOT_ARG(x) , x
#else
#define USE_NESTED_HOT_ARG(x)
#endif
#endif

// Assume using BGET compare_exchange instruction instead of lock by default.
#ifndef USE_CMP_XCHG_FOR_BGET
#define USE_CMP_XCHG_FOR_BGET 1
Expand Down Expand Up @@ -2940,14 +2929,12 @@ typedef struct kmp_free_list {
// sync list)
} kmp_free_list_t;
#endif
#if KMP_NESTED_HOT_TEAMS
// Hot teams array keeps hot teams and their sizes for given thread. Hot teams
// are not put in teams pool, and they don't put threads in threads pool.
typedef struct kmp_hot_team_ptr {
kmp_team_p *hot_team; // pointer to hot_team of given nesting level
kmp_int32 hot_team_nth; // number of threads allocated for the hot_team
} kmp_hot_team_ptr_t;
#endif
typedef struct kmp_teams_size {
kmp_int32 nteams; // number of teams in a league
kmp_int32 nth; // number of threads in each team of the league
Expand Down Expand Up @@ -3022,9 +3009,7 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
int th_nt_sev; // error severity for strict modifier
const char *th_nt_msg; // error message for strict modifier
int th_set_nested_nth_sz;
#if KMP_NESTED_HOT_TEAMS
kmp_hot_team_ptr_t *th_hot_teams; /* array of hot teams */
#endif
kmp_proc_bind_t
th_set_proc_bind; /* if != proc_bind_default, use request for next fork */
kmp_teams_size_t
Expand Down Expand Up @@ -3580,10 +3565,8 @@ extern int __kmp_dflt_max_active_levels;
extern bool __kmp_dflt_max_active_levels_set;
extern int __kmp_dispatch_num_buffers; /* max possible dynamic loops in
concurrent execution per team */
#if KMP_NESTED_HOT_TEAMS
extern int __kmp_hot_teams_mode;
extern int __kmp_hot_teams_max_level;
#endif

#if KMP_MIC_SUPPORTED
extern enum mic_type __kmp_mic_type;
Expand Down Expand Up @@ -4067,16 +4050,16 @@ extern void __kmp_suspend_uninitialize_thread(kmp_info_t *th);

extern kmp_info_t *__kmp_allocate_thread(kmp_root_t *root, kmp_team_t *team,
int tid);
extern kmp_team_t *
__kmp_allocate_team(kmp_root_t *root, int new_nproc, int max_nproc,
extern kmp_team_t *__kmp_allocate_team(kmp_root_t *root, int new_nproc,
int max_nproc,
#if OMPT_SUPPORT
ompt_data_t ompt_parallel_data,
ompt_data_t ompt_parallel_data,
#endif
kmp_proc_bind_t proc_bind, kmp_internal_control_t *new_icvs,
int argc USE_NESTED_HOT_ARG(kmp_info_t *thr));
kmp_proc_bind_t proc_bind,
kmp_internal_control_t *new_icvs,
int argc, kmp_info_t *thr);
extern void __kmp_free_thread(kmp_info_t *);
extern void __kmp_free_team(kmp_root_t *,
kmp_team_t *USE_NESTED_HOT_ARG(kmp_info_t *));
extern void __kmp_free_team(kmp_root_t *, kmp_team_t *, kmp_info_t *);
extern kmp_team_t *__kmp_reap_team(kmp_team_t *);

/* ------------------------------------------------------------------------ */
Expand Down
1 change: 0 additions & 1 deletion openmp/runtime/src/kmp_config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
# define BUILD_I8 1
#endif

#define KMP_NESTED_HOT_TEAMS 1
#define KMP_ADJUST_BLOCKTIME 1
#define BUILD_PARALLEL_ORDERED 1
#define KMP_ASM_INTRINS 1
Expand Down
2 changes: 0 additions & 2 deletions openmp/runtime/src/kmp_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ int __kmp_tp_cached = 0;
int __kmp_dispatch_num_buffers = KMP_DFLT_DISP_NUM_BUFF;
int __kmp_dflt_max_active_levels = 1; // Nesting off by default
bool __kmp_dflt_max_active_levels_set = false; // Don't override set value
#if KMP_NESTED_HOT_TEAMS
int __kmp_hot_teams_mode = 0; /* 0 - free extra threads when reduced */
/* 1 - keep extra threads when reduced */
int __kmp_hot_teams_max_level = 1; /* nesting level of hot teams */
#endif
enum library_type __kmp_library = library_none;
enum sched_type __kmp_sched =
kmp_sch_default; /* scheduling method for runtime scheduling */
Expand Down
Loading
Loading