// Check if team size was changed. Then create new region domain for this
// location
unsigned int frm = (loc->reserved_2 & 0x0000FFFF) - 1;
- if ((frm < KMP_MAX_FRAME_DOMAINS) &&
- (__kmp_itt_region_team_size[frm] != team_size)) {
+ if (frm >= KMP_MAX_FRAME_DOMAINS)
+ return; // something's gone wrong, returning
+ if (__kmp_itt_region_team_size[frm] != team_size) {
char *buff = NULL;
kmp_str_loc_t str_loc = __kmp_str_loc_init(loc->psource, 1);
buff = __kmp_str_format("%s$omp$parallel:%d@%s:%d:%d", str_loc.func,
}
hot_teams = master->th.th_hot_teams;
if (level < __kmp_hot_teams_max_level && hot_teams &&
- hot_teams[level]
- .hot_team) { // hot team has already been allocated for given level
+ hot_teams[level].hot_team) {
+ // hot team has already been allocated for given level
use_hot_team = 1;
} else {
use_hot_team = 0;
}
+ } else {
+ // check we won't access uninitialized hot_teams, just in case
+ KMP_DEBUG_ASSERT(new_nproc == 1);
}
#endif
// Optimization to use a "hot" team
#define KMP_STATS_LOOP_END(stat) /* Nothing */
#endif
+static ident_t loc_stub = {0, KMP_IDENT_KMPC, 0, 0, ";unknown;unknown;0;0;;"};
+static inline void check_loc(ident_t *&loc) {
+ if (loc == NULL)
+ loc = &loc_stub; // may need to report location info to ittnotify
+}
+
template <typename T>
static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid,
kmp_int32 schedtype, kmp_int32 *plastiter,
__kmp_forkjoin_frames_mode == 3 && th->th.th_teams_microtask == NULL &&
team->t.t_active_level == 1) {
kmp_uint64 cur_chunk = chunk;
+ check_loc(loc);
// Calculate chunk in case it was not specified; it is specified for
// kmp_sch_static_chunked
if (schedtype == kmp_sch_static) {
d_tn = __kmp_find_shared_task_common(&__kmp_threadprivate_d_table, gtid,
tn->gbl_addr);
-
- KMP_DEBUG_ASSERT(d_tn);
-
+ if (d_tn == NULL)
+ continue;
if (d_tn->is_vec) {
if (d_tn->dt.dtorv != 0) {
(void)(*d_tn->dt.dtorv)(tn->par_addr, d_tn->vec_len);