diff options
Diffstat (limited to 'runtime/src/kmp_settings.cpp')
-rw-r--r-- | runtime/src/kmp_settings.cpp | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/runtime/src/kmp_settings.cpp b/runtime/src/kmp_settings.cpp index 4733e28..c4fb9f2 100644 --- a/runtime/src/kmp_settings.cpp +++ b/runtime/src/kmp_settings.cpp @@ -137,8 +137,8 @@ static size_t __kmp_round4k(size_t size) { size &= ~(_4k - 1); if (size <= KMP_SIZE_T_MAX - _4k) { size += _4k; // Round up if there is no overflow. - }; // if - }; // if + } + } return size; } // __kmp_round4k @@ -282,7 +282,7 @@ static void __kmp_stg_parse_bool(char const *name, char const *value, } else { __kmp_msg(kmp_ms_warning, KMP_MSG(BadBoolValue, name, value), KMP_HNT(ValidBoolValues), __kmp_msg_null); - }; // if + } } // __kmp_stg_parse_bool static void __kmp_stg_parse_size(char const *name, char const *value, @@ -297,7 +297,7 @@ static void __kmp_stg_parse_size(char const *name, char const *value, if (value) { if (is_specified != NULL) { *is_specified = 1; - }; // if + } __kmp_str_to_size(value, out, factor, &msg); if (msg == NULL) { if (*out > size_max) { @@ -312,9 +312,9 @@ static void __kmp_stg_parse_size(char const *name, char const *value, if (*out != round4k) { *out = round4k; msg = KMP_I18N_STR(NotMultiple4K); - }; // if + } #endif - }; // if + } } else { // If integer overflow occurred, * out == KMP_SIZE_T_MAX. Cut it to // size_max silently. @@ -322,8 +322,8 @@ static void __kmp_stg_parse_size(char const *name, char const *value, *out = size_max; } else if (*out > size_max) { *out = size_max; - }; // if - }; // if + } + } if (msg != NULL) { // Message is not empty. Print warning. kmp_str_buf_t buf; @@ -332,8 +332,8 @@ static void __kmp_stg_parse_size(char const *name, char const *value, KMP_WARNING(ParseSizeIntWarn, name, value, msg); KMP_INFORM(Using_str_Value, name, buf.str); __kmp_str_buf_free(&buf); - }; // if - }; // if + } + } } // __kmp_stg_parse_size #if KMP_AFFINITY_SUPPORTED @@ -362,7 +362,7 @@ static void __kmp_stg_parse_int( } else if (uint > (unsigned int)max) { msg = KMP_I18N_STR(ValueTooLarge); uint = max; - }; // if + } } else { // If overflow occurred msg contains error message and uint is very big. Cut // tmp it to INT_MAX. @@ -370,8 +370,8 @@ static void __kmp_stg_parse_int( uint = min; } else if (uint > (unsigned int)max) { uint = max; - }; // if - }; // if + } + } if (msg != NULL) { // Message is not empty. Print warning. kmp_str_buf_t buf; @@ -380,7 +380,7 @@ static void __kmp_stg_parse_int( __kmp_str_buf_print(&buf, "%" KMP_UINT64_SPEC "", uint); KMP_INFORM(Using_uint64_Value, name, buf.str); __kmp_str_buf_free(&buf); - }; // if + } *out = uint; } // __kmp_stg_parse_int @@ -581,7 +581,7 @@ static void __kmp_stg_parse_device_thread_limit(char const *name, rc = __kmp_stg_check_rivals(name, value, rivals); if (rc) { return; - }; // if + } if (!__kmp_strcasecmp_with_sentinel("all", value, 0)) { __kmp_max_nth = __kmp_xproc; __kmp_allThreadsSpecified = 1; @@ -647,9 +647,9 @@ static void __kmp_stg_parse_blocktime(char const *name, char const *value, __kmp_msg(kmp_ms_warning, KMP_MSG(LargeValue, name, value), __kmp_msg_null); KMP_INFORM(MaxValueUsing, name, __kmp_dflt_blocktime); - }; // if + } __kmp_env_blocktime = TRUE; // KMP_BLOCKTIME was specified. - }; // if + } #if KMP_USE_MONITOR // calculate number of monitor thread wakeup intervals corresponding to // blocktime. @@ -718,7 +718,7 @@ static void __kmp_stg_parse_wait_policy(char const *name, char const *value, rc = __kmp_stg_check_rivals(name, value, wait->rivals); if (rc) { return; - }; // if + } if (wait->omp) { if (__kmp_str_match("ACTIVE", 1, value)) { @@ -735,7 +735,7 @@ static void __kmp_stg_parse_wait_policy(char const *name, char const *value, } } else { KMP_WARNING(StgInvalidValue, name, value); - }; // if + } } else { if (__kmp_str_match("serial", 1, value)) { /* S */ __kmp_library = library_serial; @@ -749,8 +749,8 @@ static void __kmp_stg_parse_wait_policy(char const *name, char const *value, __kmp_library = library_throughput; } else { KMP_WARNING(StgInvalidValue, name, value); - }; // if - }; // if + } + } __kmp_aux_set_library(__kmp_library); } // __kmp_stg_parse_wait_policy @@ -769,7 +769,7 @@ static void __kmp_stg_print_wait_policy(kmp_str_buf_t *buffer, char const *name, case library_throughput: { value = "PASSIVE"; } break; - }; // switch + } } else { switch (__kmp_library) { case library_serial: { @@ -781,11 +781,11 @@ static void __kmp_stg_print_wait_policy(kmp_str_buf_t *buffer, char const *name, case library_throughput: { value = "throughput"; } break; - }; // switch - }; // if + } + } if (value != NULL) { __kmp_stg_print_str(buffer, name, value); - }; // if + } } // __kmp_stg_print_wait_policy @@ -882,7 +882,7 @@ static void __kmp_stg_parse_stacksize(char const *name, char const *value, rc = __kmp_stg_check_rivals(name, value, stacksize->rivals); if (rc) { return; - }; // if + } __kmp_stg_parse_size(name, // Env var name value, // Env var value __kmp_sys_min_stksize, // Min value @@ -1105,7 +1105,7 @@ static void __kmp_stg_parse_num_threads(char const *name, char const *value, __kmp_dflt_team_nth_ub = __kmp_dflt_team_nth; } } - }; // if + } K_DIAG(1, ("__kmp_dflt_team_nth == %d\n", __kmp_dflt_team_nth)); } // __kmp_stg_parse_num_threads @@ -1311,22 +1311,22 @@ static void __kmp_stg_parse_debug(char const *name, char const *value, __kmp_stg_parse_int(name, value, 0, INT_MAX, &debug); if (kmp_a_debug < debug) { kmp_a_debug = debug; - }; // if + } if (kmp_b_debug < debug) { kmp_b_debug = debug; - }; // if + } if (kmp_c_debug < debug) { kmp_c_debug = debug; - }; // if + } if (kmp_d_debug < debug) { kmp_d_debug = debug; - }; // if + } if (kmp_e_debug < debug) { kmp_e_debug = debug; - }; // if + } if (kmp_f_debug < debug) { kmp_f_debug = debug; - }; // if + } } // __kmp_stg_parse_debug static void __kmp_stg_parse_debug_buf(char const *name, char const *value, @@ -1604,7 +1604,7 @@ static void __kmp_stg_parse_force_reduction(char const *name, char const *value, rc = __kmp_stg_check_rivals(name, value, reduction->rivals); if (rc) { return; - }; // if + } if (reduction->force) { if (value != 0) { if (__kmp_str_match("critical", 0, value)) @@ -1667,7 +1667,7 @@ static void __kmp_stg_parse_storage_map(char const *name, char const *value, } else { __kmp_storage_map_verbose = FALSE; __kmp_stg_parse_bool(name, value, &__kmp_storage_map); // !!! - }; // if + } } // __kmp_stg_parse_storage_map static void __kmp_stg_print_storage_map(kmp_str_buf_t *buffer, char const *name, @@ -1960,7 +1960,7 @@ static void __kmp_parse_affinity_env(char const *name, char const *value, _var = _val; \ } else { \ EMIT_WARN(FALSE, (AffParamDefined, name, start)); \ - }; \ + } \ ++_guard; \ } @@ -1978,7 +1978,7 @@ static void __kmp_parse_affinity_env(char const *name, char const *value, *out_gran_levels = levels; \ } else { \ EMIT_WARN(FALSE, (AffParamDefined, name, start)); \ - }; \ + } \ ++gran; \ } @@ -2157,7 +2157,7 @@ static void __kmp_parse_affinity_env(char const *name, char const *value, number[count] = n; } else { KMP_WARNING(AffManyParams, name, start); - }; // if + } ++count; } else { EMIT_WARN(TRUE, (AffInvalidParam, name, start)); @@ -2205,18 +2205,18 @@ static void __kmp_parse_affinity_env(char const *name, char const *value, case affinity_physical: { if (count > 0) { *out_offset = number[0]; - }; // if + } if (count > 1) { KMP_WARNING(AffManyParamsForLogic, name, number[1]); - }; // if + } } break; case affinity_balanced: { if (count > 0) { *out_compact = number[0]; - }; // if + } if (count > 1) { *out_offset = number[1]; - }; // if + } if (__kmp_affinity_gran == affinity_gran_default) { #if KMP_MIC_SUPPORTED @@ -2239,10 +2239,10 @@ static void __kmp_parse_affinity_env(char const *name, char const *value, case affinity_compact: { if (count > 0) { *out_compact = number[0]; - }; // if + } if (count > 1) { *out_offset = number[1]; - }; // if + } } break; case affinity_explicit: { if (*out_proclist == NULL) { @@ -2256,20 +2256,20 @@ static void __kmp_parse_affinity_env(char const *name, char const *value, case affinity_none: { if (count > 0) { KMP_WARNING(AffNoParam, name, "none"); - }; // if + } } break; case affinity_disabled: { if (count > 0) { KMP_WARNING(AffNoParam, name, "disabled"); - }; // if + } } break; case affinity_default: { if (count > 0) { KMP_WARNING(AffNoParam, name, "default"); - }; // if + } } break; - default: { KMP_ASSERT(0); }; - }; // switch + default: { KMP_ASSERT(0); } + } } // __kmp_parse_affinity_env static void __kmp_stg_parse_affinity(char const *name, char const *value, @@ -3262,7 +3262,7 @@ static void __kmp_stg_parse_ld_balance_interval(char const *name, __kmp_load_balance_interval = interval; } else { KMP_WARNING(StgInvalidValue, name, value); - }; // if + } } // __kmp_stg_parse_load_balance_interval static void __kmp_stg_print_ld_balance_interval(kmp_str_buf_t *buffer, @@ -3283,7 +3283,7 @@ static void __kmp_stg_parse_init_at_fork(char const *name, char const *value, __kmp_stg_parse_bool(name, value, &__kmp_need_register_atfork); if (__kmp_need_register_atfork) { __kmp_need_register_atfork_specified = TRUE; - }; + } } // __kmp_stg_parse_init_at_fork static void __kmp_stg_print_init_at_fork(kmp_str_buf_t *buffer, @@ -3343,7 +3343,7 @@ static void __kmp_stg_parse_schedule(char const *name, char const *value, KMP_WARNING(EmptyClause, name); } while ((value = semicolon ? semicolon + 1 : NULL)); } - }; // if + } } // __kmp_stg_parse__schedule @@ -3519,7 +3519,7 @@ static void __kmp_stg_parse_atomic_mode(char const *name, char const *value, // 0 rather that max value. if (mode > 0) { __kmp_atomic_mode = mode; - }; // if + } } // __kmp_stg_parse_atomic_mode static void __kmp_stg_print_atomic_mode(kmp_str_buf_t *buffer, char const *name, @@ -3543,7 +3543,7 @@ static void __kmp_stg_parse_consistency_check(char const *name, __kmp_env_consistency_check = FALSE; } else { KMP_WARNING(StgInvalidValue, name, value); - }; // if + } } // __kmp_stg_parse_consistency_check static void __kmp_stg_print_consistency_check(kmp_str_buf_t *buffer, @@ -3718,7 +3718,7 @@ static void __kmp_stg_parse_gtid_mode(char const *name, char const *value, } else { __kmp_gtid_mode = mode; __kmp_adjust_gtid_mode = FALSE; - }; // if + } } // __kmp_str_parse_gtid_mode static void __kmp_stg_print_gtid_mode(kmp_str_buf_t *buffer, char const *name, @@ -4613,9 +4613,9 @@ static inline kmp_setting_t *__kmp_stg_find(char const *name) { for (i = 0; i < __kmp_stg_count; ++i) { if (strcmp(__kmp_stg_table[i].name, name) == 0) { return &__kmp_stg_table[i]; - }; // if - }; // for - }; // if + } + } + } return NULL; } // __kmp_stg_find @@ -4675,7 +4675,7 @@ static void __kmp_stg_init(void) { #ifdef KMP_GOMP_COMPAT if (gomp_stacksize != NULL) { rivals[i++] = gomp_stacksize; - }; // if + } #endif rivals[i++] = omp_stacksize; rivals[i++] = NULL; @@ -4684,7 +4684,7 @@ static void __kmp_stg_init(void) { #ifdef KMP_GOMP_COMPAT if (gomp_stacksize != NULL) { gomp_stacksize->data = &gomp_data; - }; // if + } #endif omp_stacksize->data = &omp_data; } @@ -4704,13 +4704,13 @@ static void __kmp_stg_init(void) { rivals[i++] = kmp_library; if (omp_wait_policy != NULL) { rivals[i++] = omp_wait_policy; - }; // if + } rivals[i++] = NULL; kmp_library->data = &kmp_data; if (omp_wait_policy != NULL) { omp_wait_policy->data = &omp_data; - }; // if + } } { // Initialize KMP_DEVICE_THREAD_LIMIT and KMP_ALL_THREADS @@ -4800,23 +4800,23 @@ static void __kmp_stg_init(void) { rivals[i++] = kmp_force_red; if (kmp_determ_red != NULL) { rivals[i++] = kmp_determ_red; - }; // if + } rivals[i++] = NULL; kmp_force_red->data = &force_data; if (kmp_determ_red != NULL) { kmp_determ_red->data = &determ_data; - }; // if + } } initialized = 1; - }; // if + } // Reset flags. int i; for (i = 0; i < __kmp_stg_count; ++i) { __kmp_stg_table[i].set = 0; - }; // for + } } // __kmp_stg_init @@ -4826,15 +4826,15 @@ static void __kmp_stg_parse(char const *name, char const *value) { // "=C:=C\\\x00=D:=D:\\\x00...", so let us skip them. if (name[0] == 0) { return; - }; // if + } if (value != NULL) { kmp_setting_t *setting = __kmp_stg_find(name); if (setting != NULL) { setting->parse(name, value, setting->data); setting->defined = 1; - }; // if - }; // if + } + } } // __kmp_stg_parse @@ -4864,13 +4864,13 @@ static int __kmp_stg_check_rivals( // 0 -- Ok, 1 -- errors found. if (rivals[i]->set) { KMP_WARNING(StgIgnored, name, rivals[i]->name); return 1; - }; // if - }; // while + } + } ++i; // Skip current setting. return 0; -}; // __kmp_stg_check_rivals +} // __kmp_stg_check_rivals static int __kmp_env_toPrint(char const *name, int flag) { int rc = 0; @@ -4879,8 +4879,8 @@ static int __kmp_env_toPrint(char const *name, int flag) { rc = setting->defined; if (flag >= 0) { setting->defined = flag; - }; // if - }; // if + } + } return rc; } @@ -4926,7 +4926,7 @@ void __kmp_env_initialize(char const *string) { // __kmp_max_nth = __kmp_sys_max_nth; __kmp_threads_capacity = __kmp_initial_threads_capacity(__kmp_dflt_team_nth_ub); - }; // if + } __kmp_env_blk_init(&block, string); // update the set flag on all entries that have an env var @@ -4941,7 +4941,7 @@ void __kmp_env_initialize(char const *string) { if (setting != NULL) { setting->set = 1; } - }; // for i + } // We need to know if blocktime was set when processing OMP_WAIT_POLICY blocktime_str = __kmp_env_blk_var(&block, "KMP_BLOCKTIME"); @@ -4952,7 +4952,7 @@ void __kmp_env_initialize(char const *string) { char const *name = "KMP_WARNINGS"; char const *value = __kmp_env_blk_var(&block, name); __kmp_stg_parse(name, value); - }; // if + } #if KMP_AFFINITY_SUPPORTED // Special case. KMP_AFFINITY is not a rival to other affinity env vars @@ -5035,7 +5035,7 @@ void __kmp_env_initialize(char const *string) { // Now process all of the settings. for (i = 0; i < block.count; ++i) { __kmp_stg_parse(block.vars[i].name, block.vars[i].value); - }; // for i + } // If user locks have been allocated yet, don't reset the lock vptr table. if (!__kmp_init_user_locks) { @@ -5296,7 +5296,7 @@ void __kmp_env_initialize(char const *string) { if (__kmp_version) { __kmp_print_version_1(); - }; // if + } // Post-initialization step: some env. vars need their value's further // processing @@ -5334,8 +5334,8 @@ void __kmp_env_print() { #endif // KMP_GOMP_COMPAT ) { __kmp_str_buf_print(&buffer, " %s=%s\n", name, value); - }; // if - }; // for + } + } __kmp_str_buf_print(&buffer, "\n"); // Print internal (effective) settings. @@ -5344,8 +5344,8 @@ void __kmp_env_print() { if (__kmp_stg_table[i].print != NULL) { __kmp_stg_table[i].print(&buffer, __kmp_stg_table[i].name, __kmp_stg_table[i].data); - }; // if - }; // for + } + } __kmp_printf("%s", buffer.str); @@ -5380,8 +5380,8 @@ void __kmp_env_print_2() { __kmp_display_env_verbose)) { __kmp_stg_table[i].print(&buffer, __kmp_stg_table[i].name, __kmp_stg_table[i].data); - }; // if - }; // for + } + } __kmp_str_buf_print(&buffer, "%s\n", KMP_I18N_STR(DisplayEnvEnd)); __kmp_str_buf_print(&buffer, "\n"); |