17 #include "kmp_wrapper_getpid.h" 18 #include "kmp_environment.h" 19 #include "kmp_atomic.h" 22 #include "kmp_settings.h" 26 static int __kmp_env_toPrint(
char const * name,
int flag );
28 bool __kmp_env_format = 0;
34 __kmp_convert_to_double(
char const * s )
38 if ( KMP_SSCANF( s,
"%lf", &result ) < 1 ) {
47 __kmp_readstr_with_sentinel(
char *dest,
char const * src,
size_t len,
char sentinel) {
49 for (i = 0; i < len; i++) {
50 if ((*src ==
'\0') || (*src == sentinel)) {
61 __kmp_match_with_sentinel(
char const * a,
char const * b,
size_t len,
char sentinel ) {
68 while(*a && *b && *b != sentinel) {
69 char ca = *a, cb = *b;
71 if(ca >=
'a' && ca <=
'z')
73 if(cb >=
'a' && cb <=
'z')
111 __kmp_match_str(
char const *token,
char const *buf,
const char **end) {
113 KMP_ASSERT(token != NULL);
114 KMP_ASSERT(buf != NULL);
115 KMP_ASSERT(end != NULL);
117 while (*token && *buf) {
118 char ct = *token, cb = *buf;
120 if(ct >=
'a' && ct <=
'z')
122 if(cb >=
'a' && cb <=
'z')
138 __kmp_round4k(
size_t size ) {
139 size_t _4k = 4 * 1024;
140 if ( size & ( _4k - 1 ) ) {
141 size &= ~ ( _4k - 1 );
142 if ( size <= KMP_SIZE_T_MAX - _4k ) {
157 __kmp_convert_to_milliseconds(
char const * data )
159 int ret, nvalues, factor;
163 if (data == NULL)
return (-1);
164 if ( __kmp_str_match(
"infinit", -1, data))
return (INT_MAX);
165 value = (double) 0.0;
167 nvalues = KMP_SSCANF (data,
"%lf%c%c", &value, &mult, &extra);
168 if (nvalues < 1)
return (-1);
169 if (nvalues == 1) mult =
'\0';
170 if (nvalues == 3)
return (-1);
172 if (value < 0)
return (-1);
186 factor = 1000 * 60 * 60;
189 factor = 1000 * 24 * 60 * 60;
195 if ( value >= ( (INT_MAX-1) / factor) )
198 ret = (int) (value * (
double) factor);
205 __kmp_strcasecmp_with_sentinel(
char const * a,
char const * b,
char sentinel ) {
210 while(*a && *b && *b != sentinel) {
211 char ca = *a, cb = *b;
213 if(ca >=
'a' && ca <=
'z')
215 if(cb >=
'a' && cb <=
'z')
218 return (
int)(
unsigned char)*a - (
int)(
unsigned char)*b;
223 (*b && *b != sentinel) ? (
int)(
unsigned char)*a - (
int)(
unsigned char)*b : 1 :
224 (*b && *b != sentinel) ? -1 : 0;
232 typedef struct __kmp_setting kmp_setting_t;
233 typedef struct __kmp_stg_ss_data kmp_stg_ss_data_t;
234 typedef struct __kmp_stg_wp_data kmp_stg_wp_data_t;
235 typedef struct __kmp_stg_fr_data kmp_stg_fr_data_t;
237 typedef void ( * kmp_stg_parse_func_t )(
char const * name,
char const * value,
void * data );
238 typedef void ( * kmp_stg_print_func_t )( kmp_str_buf_t * buffer,
char const * name,
void * data );
240 struct __kmp_setting {
242 kmp_stg_parse_func_t parse;
243 kmp_stg_print_func_t print;
250 struct __kmp_stg_ss_data {
252 kmp_setting_t * * rivals;
255 struct __kmp_stg_wp_data {
257 kmp_setting_t * * rivals;
260 struct __kmp_stg_fr_data {
262 kmp_setting_t * * rivals;
266 __kmp_stg_check_rivals(
269 kmp_setting_t * * rivals
278 __kmp_stg_parse_bool(
283 if ( __kmp_str_match_true( value ) ) {
285 }
else if (__kmp_str_match_false( value ) ) {
290 KMP_MSG( BadBoolValue, name, value ),
291 KMP_HNT( ValidBoolValues ),
298 __kmp_stg_parse_size(
307 char const * msg = NULL;
309 size_min = __kmp_round4k( size_min );
310 size_max = __kmp_round4k( size_max );
311 #endif // KMP_OS_DARWIN 313 if ( is_specified != NULL ) {
316 __kmp_str_to_size( value, out, factor, & msg );
318 if ( * out > size_max ) {
320 msg = KMP_I18N_STR( ValueTooLarge );
321 }
else if ( * out < size_min ) {
323 msg = KMP_I18N_STR( ValueTooSmall );
326 size_t round4k = __kmp_round4k( * out );
327 if ( * out != round4k ) {
329 msg = KMP_I18N_STR( NotMultiple4K );
335 if ( * out < size_min ) {
338 else if ( * out > size_max ) {
345 __kmp_str_buf_init( & buf );
346 __kmp_str_buf_print_size( & buf, * out );
347 KMP_WARNING( ParseSizeIntWarn, name, value, msg );
348 KMP_INFORM( Using_str_Value, name, buf.str );
349 __kmp_str_buf_free( & buf );
354 #if KMP_AFFINITY_SUPPORTED 361 KMP_INTERNAL_FREE( (
void *) * out );
362 * out = __kmp_str_format(
"%s", value );
374 char const * msg = NULL;
375 kmp_uint64 uint = * out;
376 __kmp_str_to_uint( value, & uint, & msg );
378 if ( uint < (
unsigned int)min ) {
379 msg = KMP_I18N_STR( ValueTooSmall );
381 }
else if ( uint > (
unsigned int)max ) {
382 msg = KMP_I18N_STR( ValueTooLarge );
388 if ( uint < (
unsigned int)min ) {
391 else if ( uint > (
unsigned int)max ) {
398 KMP_WARNING( ParseSizeIntWarn, name, value, msg );
399 __kmp_str_buf_init( & buf );
400 __kmp_str_buf_print( &buf,
"%" KMP_UINT64_SPEC
"", uint );
401 KMP_INFORM( Using_uint64_Value, name, buf.str );
402 __kmp_str_buf_free( &buf );
408 #if KMP_DEBUG_ADAPTIVE_LOCKS 410 __kmp_stg_parse_file(
419 KMP_INTERNAL_FREE( (
void *) * out );
420 t = (
char *) strrchr(value,
'.');
421 hasSuffix = t && __kmp_str_eqf( t, suffix );
422 t = __kmp_str_format(
"%s%s", value, hasSuffix ?
"" : suffix );
423 __kmp_expand_file_name( buffer,
sizeof(buffer), t);
424 KMP_INTERNAL_FREE(t);
425 * out = __kmp_str_format(
"%s", buffer );
430 static char * par_range_to_print = NULL;
433 __kmp_stg_parse_par_range(
442 size_t len = KMP_STRLEN( value + 1 );
443 par_range_to_print = (
char *) KMP_INTERNAL_MALLOC( len +1 );
444 KMP_STRNCPY_S( par_range_to_print, len + 1, value, len + 1);
445 __kmp_par_range = +1;
446 __kmp_par_range_lb = 0;
447 __kmp_par_range_ub = INT_MAX;
450 if (( value == NULL ) || ( *value ==
'\0' )) {
453 if ( ! __kmp_strcasecmp_with_sentinel(
"routine", value,
'=' )) {
454 value = strchr( value,
'=' ) + 1;
455 len = __kmp_readstr_with_sentinel( out_routine,
456 value, KMP_PAR_RANGE_ROUTINE_LEN - 1,
',' );
458 goto par_range_error;
460 value = strchr( value,
',' );
461 if ( value != NULL ) {
466 if ( ! __kmp_strcasecmp_with_sentinel(
"filename", value,
'=' )) {
467 value = strchr( value,
'=' ) + 1;
468 len = __kmp_readstr_with_sentinel( out_file,
469 value, KMP_PAR_RANGE_FILENAME_LEN - 1,
',' );
471 goto par_range_error;
473 value = strchr( value,
',' );
474 if ( value != NULL ) {
479 if (( ! __kmp_strcasecmp_with_sentinel(
"range", value,
'=' ))
480 || ( ! __kmp_strcasecmp_with_sentinel(
"incl_range", value,
'=' ))) {
481 value = strchr( value,
'=' ) + 1;
482 if ( KMP_SSCANF( value,
"%d:%d", out_lb, out_ub ) != 2 ) {
483 goto par_range_error;
486 value = strchr( value,
',' );
487 if ( value != NULL ) {
492 if ( ! __kmp_strcasecmp_with_sentinel(
"excl_range", value,
'=' )) {
493 value = strchr( value,
'=' ) + 1;
494 if ( KMP_SSCANF( value,
"%d:%d", out_lb, out_ub) != 2 ) {
495 goto par_range_error;
498 value = strchr( value,
',' );
499 if ( value != NULL ) {
505 KMP_WARNING( ParRangeSyntax, name );
513 __kmp_initial_threads_capacity(
int req_nproc )
518 if (nth < (4 * req_nproc))
519 nth = (4 * req_nproc);
520 if (nth < (4 * __kmp_xproc))
521 nth = (4 * __kmp_xproc);
523 if (nth > __kmp_max_nth)
531 __kmp_default_tp_capacity(
int req_nproc,
int max_nth,
int all_threads_specified) {
534 if(all_threads_specified)
537 if (nth < (4 * req_nproc))
538 nth = (4 * req_nproc);
539 if (nth < (4 * __kmp_xproc))
540 nth = (4 * __kmp_xproc);
542 if (nth > __kmp_max_nth)
554 __kmp_stg_print_bool( kmp_str_buf_t * buffer,
char const * name,
int value ) {
555 if( __kmp_env_format ) {
556 KMP_STR_BUF_PRINT_BOOL;
558 __kmp_str_buf_print( buffer,
" %s=%s\n", name, value ?
"true" :
"false" );
563 __kmp_stg_print_int( kmp_str_buf_t * buffer,
char const * name,
int value ) {
564 if( __kmp_env_format ) {
565 KMP_STR_BUF_PRINT_INT;
567 __kmp_str_buf_print( buffer,
" %s=%d\n", name, value );
572 __kmp_stg_print_uint64( kmp_str_buf_t * buffer,
char const * name, kmp_uint64 value ) {
573 if( __kmp_env_format ) {
574 KMP_STR_BUF_PRINT_UINT64;
576 __kmp_str_buf_print( buffer,
" %s=%" KMP_UINT64_SPEC
"\n", name, value );
581 __kmp_stg_print_str( kmp_str_buf_t * buffer,
char const * name,
char const * value ) {
582 if( __kmp_env_format ) {
583 KMP_STR_BUF_PRINT_STR;
585 __kmp_str_buf_print( buffer,
" %s=%s\n", name, value );
590 __kmp_stg_print_size( kmp_str_buf_t * buffer,
char const * name,
size_t value ) {
591 if( __kmp_env_format ) {
592 KMP_STR_BUF_PRINT_NAME_EX(name);
593 __kmp_str_buf_print_size( buffer, value );
594 __kmp_str_buf_print( buffer,
"'\n" );
596 __kmp_str_buf_print( buffer,
" %s=", name );
597 __kmp_str_buf_print_size( buffer, value );
598 __kmp_str_buf_print( buffer,
"\n" );
613 __kmp_stg_parse_all_threads(
char const * name,
char const * value,
void * data ) {
615 kmp_setting_t * * rivals = (kmp_setting_t * *) data;
617 rc = __kmp_stg_check_rivals( name, value, rivals );
621 if ( ! __kmp_strcasecmp_with_sentinel(
"all", value, 0 ) ) {
622 __kmp_max_nth = __kmp_xproc;
623 __kmp_allThreadsSpecified = 1;
625 __kmp_stg_parse_int( name, value, 1, __kmp_sys_max_nth, & __kmp_max_nth );
626 __kmp_allThreadsSpecified = 0;
628 K_DIAG( 1, (
"__kmp_max_nth == %d\n", __kmp_max_nth ) );
633 __kmp_stg_print_all_threads( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
634 __kmp_stg_print_int( buffer, name, __kmp_max_nth );
642 __kmp_stg_parse_blocktime(
char const * name,
char const * value,
void * data ) {
643 __kmp_dflt_blocktime = __kmp_convert_to_milliseconds( value );
644 if ( __kmp_dflt_blocktime < 0 ) {
645 __kmp_dflt_blocktime = KMP_DEFAULT_BLOCKTIME;
646 __kmp_msg( kmp_ms_warning, KMP_MSG( InvalidValue, name, value ), __kmp_msg_null );
647 KMP_INFORM( Using_int_Value, name, __kmp_dflt_blocktime );
648 __kmp_env_blocktime = FALSE;
650 if ( __kmp_dflt_blocktime < KMP_MIN_BLOCKTIME ) {
651 __kmp_dflt_blocktime = KMP_MIN_BLOCKTIME;
652 __kmp_msg( kmp_ms_warning, KMP_MSG( SmallValue, name, value ), __kmp_msg_null );
653 KMP_INFORM( MinValueUsing, name, __kmp_dflt_blocktime );
654 }
else if ( __kmp_dflt_blocktime > KMP_MAX_BLOCKTIME ) {
655 __kmp_dflt_blocktime = KMP_MAX_BLOCKTIME;
656 __kmp_msg( kmp_ms_warning, KMP_MSG( LargeValue, name, value ), __kmp_msg_null );
657 KMP_INFORM( MaxValueUsing, name, __kmp_dflt_blocktime );
659 __kmp_env_blocktime = TRUE;
662 __kmp_monitor_wakeups = KMP_WAKEUPS_FROM_BLOCKTIME( __kmp_dflt_blocktime, __kmp_monitor_wakeups );
663 __kmp_bt_intervals = KMP_INTERVALS_FROM_BLOCKTIME( __kmp_dflt_blocktime, __kmp_monitor_wakeups );
664 K_DIAG( 1, (
"__kmp_env_blocktime == %d\n", __kmp_env_blocktime ) );
665 if ( __kmp_env_blocktime ) {
666 K_DIAG( 1, (
"__kmp_dflt_blocktime == %d\n", __kmp_dflt_blocktime ) );
671 __kmp_stg_print_blocktime( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
672 __kmp_stg_print_int( buffer, name, __kmp_dflt_blocktime );
680 __kmp_stg_parse_duplicate_lib_ok(
char const * name,
char const * value,
void * data ) {
683 __kmp_stg_parse_bool( name, value, & __kmp_duplicate_library_ok );
687 __kmp_stg_print_duplicate_lib_ok( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
688 __kmp_stg_print_bool( buffer, name, __kmp_duplicate_library_ok );
695 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 698 __kmp_stg_parse_inherit_fp_control(
char const * name,
char const * value,
void * data ) {
699 __kmp_stg_parse_bool( name, value, & __kmp_inherit_fp_control );
703 __kmp_stg_print_inherit_fp_control( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
705 __kmp_stg_print_bool( buffer, name, __kmp_inherit_fp_control );
716 __kmp_stg_parse_wait_policy(
char const * name,
char const * value,
void * data ) {
718 kmp_stg_wp_data_t * wait = (kmp_stg_wp_data_t *) data;
721 rc = __kmp_stg_check_rivals( name, value, wait->rivals );
727 if ( __kmp_str_match(
"ACTIVE", 1, value ) ) {
728 __kmp_library = library_turnaround;
729 }
else if ( __kmp_str_match(
"PASSIVE", 1, value ) ) {
730 __kmp_library = library_throughput;
732 KMP_WARNING( StgInvalidValue, name, value );
735 if ( __kmp_str_match(
"serial", 1, value ) ) {
736 __kmp_library = library_serial;
737 }
else if ( __kmp_str_match(
"throughput", 2, value ) ) {
738 __kmp_library = library_throughput;
739 }
else if ( __kmp_str_match(
"turnaround", 2, value ) ) {
740 __kmp_library = library_turnaround;
741 }
else if ( __kmp_str_match(
"dedicated", 1, value ) ) {
742 __kmp_library = library_turnaround;
743 }
else if ( __kmp_str_match(
"multiuser", 1, value ) ) {
744 __kmp_library = library_throughput;
746 KMP_WARNING( StgInvalidValue, name, value );
749 __kmp_aux_set_library( __kmp_library );
754 __kmp_stg_print_wait_policy( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
756 kmp_stg_wp_data_t * wait = (kmp_stg_wp_data_t *) data;
757 char const * value = NULL;
760 switch ( __kmp_library ) {
761 case library_turnaround : {
764 case library_throughput : {
769 switch ( __kmp_library ) {
770 case library_serial : {
773 case library_turnaround : {
774 value =
"turnaround";
776 case library_throughput : {
777 value =
"throughput";
781 if ( value != NULL ) {
782 __kmp_stg_print_str( buffer, name, value );
792 __kmp_stg_parse_monitor_stacksize(
char const * name,
char const * value,
void * data ) {
793 __kmp_stg_parse_size(
796 __kmp_sys_min_stksize,
799 & __kmp_monitor_stksize,
805 __kmp_stg_print_monitor_stacksize( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
806 if( __kmp_env_format ) {
807 if ( __kmp_monitor_stksize > 0 )
808 KMP_STR_BUF_PRINT_NAME_EX(name);
810 KMP_STR_BUF_PRINT_NAME;
812 __kmp_str_buf_print( buffer,
" %s", name );
814 if ( __kmp_monitor_stksize > 0 ) {
815 __kmp_str_buf_print_size( buffer, __kmp_monitor_stksize );
817 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
819 if( __kmp_env_format && __kmp_monitor_stksize ) {
820 __kmp_str_buf_print( buffer,
"'\n");
830 __kmp_stg_parse_settings(
char const * name,
char const * value,
void * data ) {
831 __kmp_stg_parse_bool( name, value, & __kmp_settings );
835 __kmp_stg_print_settings( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
836 __kmp_stg_print_bool( buffer, name, __kmp_settings );
844 __kmp_stg_parse_stackpad(
char const * name,
char const * value,
void * data ) {
855 __kmp_stg_print_stackpad( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
856 __kmp_stg_print_int( buffer, name, __kmp_stkpadding );
864 __kmp_stg_parse_stackoffset(
char const * name,
char const * value,
void * data ) {
865 __kmp_stg_parse_size(
877 __kmp_stg_print_stackoffset( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
878 __kmp_stg_print_size( buffer, name, __kmp_stkoffset );
886 __kmp_stg_parse_stacksize(
char const * name,
char const * value,
void * data ) {
888 kmp_stg_ss_data_t * stacksize = (kmp_stg_ss_data_t *) data;
891 rc = __kmp_stg_check_rivals( name, value, stacksize->rivals );
895 __kmp_stg_parse_size(
898 __kmp_sys_min_stksize,
911 __kmp_stg_print_stacksize( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
912 kmp_stg_ss_data_t * stacksize = (kmp_stg_ss_data_t *) data;
913 if( __kmp_env_format ) {
914 KMP_STR_BUF_PRINT_NAME_EX(name);
915 __kmp_str_buf_print_size( buffer, (__kmp_stksize % 1024) ? __kmp_stksize / stacksize->factor : __kmp_stksize );
916 __kmp_str_buf_print( buffer,
"'\n" );
918 __kmp_str_buf_print( buffer,
" %s=", name );
919 __kmp_str_buf_print_size( buffer, (__kmp_stksize % 1024) ? __kmp_stksize / stacksize->factor : __kmp_stksize );
920 __kmp_str_buf_print( buffer,
"\n" );
929 __kmp_stg_parse_version(
char const * name,
char const * value,
void * data ) {
930 __kmp_stg_parse_bool( name, value, & __kmp_version );
934 __kmp_stg_print_version( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
935 __kmp_stg_print_bool( buffer, name, __kmp_version );
943 __kmp_stg_parse_warnings(
char const * name,
char const * value,
void * data ) {
944 __kmp_stg_parse_bool( name, value, & __kmp_generate_warnings );
945 if (__kmp_generate_warnings != kmp_warnings_off) {
946 __kmp_generate_warnings = kmp_warnings_explicit;
951 __kmp_stg_print_warnings( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
952 __kmp_stg_print_bool( buffer, name, __kmp_generate_warnings );
960 __kmp_stg_parse_nested(
char const * name,
char const * value,
void * data ) {
961 __kmp_stg_parse_bool( name, value, & __kmp_dflt_nested );
965 __kmp_stg_print_nested( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
966 __kmp_stg_print_bool( buffer, name, __kmp_dflt_nested );
970 __kmp_parse_nested_num_threads(
const char *var,
const char *env, kmp_nested_nthreads_t *nth_array )
972 const char *next = env;
973 const char *scan = next;
976 int prev_comma = FALSE;
982 if ( *next ==
'\0' ) {
986 if ( ( ( *next <
'0' ) || ( *next >
'9' ) ) && ( *next !=
',') ) {
987 KMP_WARNING( NthSyntaxError, var, env );
991 if ( *next ==
',' ) {
993 if ( total == 0 || prev_comma ) {
1001 if ( *next >=
'0' && *next <=
'9' ) {
1003 SKIP_DIGITS( next );
1005 const char *tmp = next;
1007 if ( ( *next ==
' ' || *next ==
'\t' ) && ( *tmp >=
'0' && *tmp <=
'9' ) ) {
1008 KMP_WARNING( NthSpacesNotAllowed, var, env );
1013 KMP_DEBUG_ASSERT( total > 0 );
1015 KMP_WARNING( NthSyntaxError, var, env );
1020 if ( ! nth_array->nth ) {
1022 nth_array->nth = (
int * )KMP_INTERNAL_MALLOC(
sizeof(
int ) * total * 2 );
1023 if ( nth_array->nth == NULL ) {
1024 KMP_FATAL( MemoryAllocFailed );
1026 nth_array->size = total * 2;
1028 if ( nth_array->size < total ) {
1031 nth_array->size *= 2;
1032 }
while ( nth_array->size < total );
1034 nth_array->nth = (
int *) KMP_INTERNAL_REALLOC(
1035 nth_array->nth,
sizeof(
int ) * nth_array->size );
1036 if ( nth_array->nth == NULL ) {
1037 KMP_FATAL( MemoryAllocFailed );
1041 nth_array->used = total;
1049 if ( *scan ==
'\0' ) {
1053 if ( *scan ==
',' ) {
1058 nth_array->nth[i++] = 0;
1060 }
else if ( prev_comma ) {
1062 nth_array->nth[i] = nth_array->nth[i - 1];
1071 if ( *scan >=
'0' && *scan <=
'9' ) {
1073 const char *buf = scan;
1074 char const * msg = NULL;
1076 SKIP_DIGITS( scan );
1079 num = __kmp_str_to_int( buf, *scan );
1080 if ( num < KMP_MIN_NTH ) {
1081 msg = KMP_I18N_STR( ValueTooSmall );
1083 }
else if ( num > __kmp_sys_max_nth ) {
1084 msg = KMP_I18N_STR( ValueTooLarge );
1085 num = __kmp_sys_max_nth;
1087 if ( msg != NULL ) {
1089 KMP_WARNING( ParseSizeIntWarn, var, env, msg );
1090 KMP_INFORM( Using_int_Value, var, num );
1092 nth_array->nth[i++] = num;
1098 __kmp_stg_parse_num_threads(
char const * name,
char const * value,
void * data ) {
1100 if ( ! __kmp_strcasecmp_with_sentinel(
"all", value, 0 ) ) {
1102 __kmp_nested_nth.nth = (
int* )KMP_INTERNAL_MALLOC(
sizeof(
int ) );
1103 __kmp_nested_nth.size = __kmp_nested_nth.used = 1;
1104 __kmp_nested_nth.nth[0] = __kmp_dflt_team_nth = __kmp_dflt_team_nth_ub = __kmp_xproc;
1106 __kmp_parse_nested_num_threads( name, value, & __kmp_nested_nth );
1107 if ( __kmp_nested_nth.nth ) {
1108 __kmp_dflt_team_nth = __kmp_nested_nth.nth[0];
1109 if ( __kmp_dflt_team_nth_ub < __kmp_dflt_team_nth ) {
1110 __kmp_dflt_team_nth_ub = __kmp_dflt_team_nth;
1114 K_DIAG( 1, (
"__kmp_dflt_team_nth == %d\n", __kmp_dflt_team_nth ) );
1118 __kmp_stg_print_num_threads( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1119 if( __kmp_env_format ) {
1120 KMP_STR_BUF_PRINT_NAME;
1122 __kmp_str_buf_print( buffer,
" %s", name );
1124 if ( __kmp_nested_nth.used ) {
1126 __kmp_str_buf_init( &buf );
1127 for (
int i = 0; i < __kmp_nested_nth.used; i++) {
1128 __kmp_str_buf_print( &buf,
"%d", __kmp_nested_nth.nth[i] );
1129 if ( i < __kmp_nested_nth.used - 1 ) {
1130 __kmp_str_buf_print( &buf,
"," );
1133 __kmp_str_buf_print( buffer,
"='%s'\n", buf.str );
1134 __kmp_str_buf_free(&buf);
1136 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
1145 __kmp_stg_parse_tasking(
char const * name,
char const * value,
void * data ) {
1146 __kmp_stg_parse_int( name, value, 0, (
int)tskm_max, (
int *)&__kmp_tasking_mode );
1150 __kmp_stg_print_tasking( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1151 __kmp_stg_print_int( buffer, name, __kmp_tasking_mode );
1155 __kmp_stg_parse_task_stealing(
char const * name,
char const * value,
void * data ) {
1156 __kmp_stg_parse_int( name, value, 0, 1, (
int *)&__kmp_task_stealing_constraint );
1160 __kmp_stg_print_task_stealing( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1161 __kmp_stg_print_int( buffer, name, __kmp_task_stealing_constraint );
1165 __kmp_stg_parse_max_active_levels(
char const * name,
char const * value,
void * data ) {
1166 __kmp_stg_parse_int( name, value, 0, KMP_MAX_ACTIVE_LEVELS_LIMIT, & __kmp_dflt_max_active_levels );
1170 __kmp_stg_print_max_active_levels( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1171 __kmp_stg_print_int( buffer, name, __kmp_dflt_max_active_levels );
1174 #if KMP_NESTED_HOT_TEAMS 1180 __kmp_stg_parse_hot_teams_level(
char const * name,
char const * value,
void * data ) {
1181 if ( TCR_4(__kmp_init_parallel) ) {
1182 KMP_WARNING( EnvParallelWarn, name );
1185 __kmp_stg_parse_int( name, value, 0, KMP_MAX_ACTIVE_LEVELS_LIMIT, & __kmp_hot_teams_max_level );
1189 __kmp_stg_print_hot_teams_level( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1190 __kmp_stg_print_int( buffer, name, __kmp_hot_teams_max_level );
1194 __kmp_stg_parse_hot_teams_mode(
char const * name,
char const * value,
void * data ) {
1195 if ( TCR_4(__kmp_init_parallel) ) {
1196 KMP_WARNING( EnvParallelWarn, name );
1199 __kmp_stg_parse_int( name, value, 0, KMP_MAX_ACTIVE_LEVELS_LIMIT, & __kmp_hot_teams_mode );
1203 __kmp_stg_print_hot_teams_mode( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1204 __kmp_stg_print_int( buffer, name, __kmp_hot_teams_mode );
1207 #endif // KMP_NESTED_HOT_TEAMS 1213 #if KMP_HANDLE_SIGNALS 1216 __kmp_stg_parse_handle_signals(
char const * name,
char const * value,
void * data ) {
1217 __kmp_stg_parse_bool( name, value, & __kmp_handle_signals );
1221 __kmp_stg_print_handle_signals( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1222 __kmp_stg_print_bool( buffer, name, __kmp_handle_signals );
1225 #endif // KMP_HANDLE_SIGNALS 1233 #define KMP_STG_X_DEBUG( x ) \ 1234 static void __kmp_stg_parse_##x##_debug( char const * name, char const * value, void * data ) { \ 1235 __kmp_stg_parse_int( name, value, 0, INT_MAX, & kmp_##x##_debug ); \ 1237 static void __kmp_stg_print_##x##_debug( kmp_str_buf_t * buffer, char const * name, void * data ) { \ 1238 __kmp_stg_print_int( buffer, name, kmp_##x##_debug ); \ 1241 KMP_STG_X_DEBUG( a )
1242 KMP_STG_X_DEBUG( b )
1243 KMP_STG_X_DEBUG( c )
1244 KMP_STG_X_DEBUG( d )
1245 KMP_STG_X_DEBUG( e )
1246 KMP_STG_X_DEBUG( f )
1248 #undef KMP_STG_X_DEBUG 1251 __kmp_stg_parse_debug(
char const * name,
char const * value,
void * data ) {
1253 __kmp_stg_parse_int( name, value, 0, INT_MAX, & debug );
1254 if ( kmp_a_debug < debug ) {
1255 kmp_a_debug = debug;
1257 if ( kmp_b_debug < debug ) {
1258 kmp_b_debug = debug;
1260 if ( kmp_c_debug < debug ) {
1261 kmp_c_debug = debug;
1263 if ( kmp_d_debug < debug ) {
1264 kmp_d_debug = debug;
1266 if ( kmp_e_debug < debug ) {
1267 kmp_e_debug = debug;
1269 if ( kmp_f_debug < debug ) {
1270 kmp_f_debug = debug;
1275 __kmp_stg_parse_debug_buf(
char const * name,
char const * value,
void * data ) {
1276 __kmp_stg_parse_bool( name, value, & __kmp_debug_buf );
1279 if ( __kmp_debug_buf ) {
1281 int elements = __kmp_debug_buf_lines * __kmp_debug_buf_chars;
1284 __kmp_debug_buffer = (
char *) __kmp_page_allocate( elements *
sizeof(
char ) );
1285 for ( i = 0; i < elements; i += __kmp_debug_buf_chars )
1286 __kmp_debug_buffer[i] =
'\0';
1288 __kmp_debug_count = 0;
1290 K_DIAG( 1, (
"__kmp_debug_buf = %d\n", __kmp_debug_buf ) );
1294 __kmp_stg_print_debug_buf( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1295 __kmp_stg_print_bool( buffer, name, __kmp_debug_buf );
1299 __kmp_stg_parse_debug_buf_atomic(
char const * name,
char const * value,
void * data ) {
1300 __kmp_stg_parse_bool( name, value, & __kmp_debug_buf_atomic );
1304 __kmp_stg_print_debug_buf_atomic( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1305 __kmp_stg_print_bool( buffer, name, __kmp_debug_buf_atomic );
1309 __kmp_stg_parse_debug_buf_chars(
char const * name,
char const * value,
void * data ) {
1310 __kmp_stg_parse_int(
1313 KMP_DEBUG_BUF_CHARS_MIN,
1315 & __kmp_debug_buf_chars
1320 __kmp_stg_print_debug_buf_chars( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1321 __kmp_stg_print_int( buffer, name, __kmp_debug_buf_chars );
1325 __kmp_stg_parse_debug_buf_lines(
char const * name,
char const * value,
void * data ) {
1326 __kmp_stg_parse_int(
1329 KMP_DEBUG_BUF_LINES_MIN,
1331 & __kmp_debug_buf_lines
1336 __kmp_stg_print_debug_buf_lines( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1337 __kmp_stg_print_int( buffer, name, __kmp_debug_buf_lines );
1341 __kmp_stg_parse_diag(
char const * name,
char const * value,
void * data ) {
1342 __kmp_stg_parse_int( name, value, 0, INT_MAX, & kmp_diag );
1346 __kmp_stg_print_diag( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1347 __kmp_stg_print_int( buffer, name, kmp_diag );
1357 __kmp_stg_parse_align_alloc(
char const * name,
char const * value,
void * data ) {
1358 __kmp_stg_parse_size(
1364 & __kmp_align_alloc,
1370 __kmp_stg_print_align_alloc( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1371 __kmp_stg_print_size( buffer, name, __kmp_align_alloc );
1382 __kmp_stg_parse_barrier_branch_bit(
char const * name,
char const * value,
void * data ) {
1386 for (
int i=bs_plain_barrier; i<bs_last_barrier; i++ ) {
1387 var = __kmp_barrier_branch_bit_env_name[ i ];
1388 if ( ( strcmp( var, name) == 0 ) && ( value != 0 ) ) {
1391 comma = (
char *) strchr( value,
',' );
1392 __kmp_barrier_gather_branch_bits[ i ] = ( kmp_uint32 ) __kmp_str_to_int( value,
',' );
1394 if ( comma == NULL ) {
1395 __kmp_barrier_release_branch_bits[ i ] = __kmp_barrier_release_bb_dflt;
1397 __kmp_barrier_release_branch_bits[ i ] = (kmp_uint32) __kmp_str_to_int( comma + 1, 0 );
1399 if ( __kmp_barrier_release_branch_bits[ i ] > KMP_MAX_BRANCH_BITS ) {
1400 __kmp_msg( kmp_ms_warning, KMP_MSG( BarrReleaseValueInvalid, name, comma + 1 ), __kmp_msg_null );
1401 __kmp_barrier_release_branch_bits[ i ] = __kmp_barrier_release_bb_dflt;
1404 if ( __kmp_barrier_gather_branch_bits[ i ] > KMP_MAX_BRANCH_BITS ) {
1405 KMP_WARNING( BarrGatherValueInvalid, name, value );
1406 KMP_INFORM( Using_uint_Value, name, __kmp_barrier_gather_bb_dflt );
1407 __kmp_barrier_gather_branch_bits[ i ] = __kmp_barrier_gather_bb_dflt;
1410 K_DIAG(1, (
"%s == %d,%d\n", __kmp_barrier_branch_bit_env_name[ i ], \
1411 __kmp_barrier_gather_branch_bits [ i ], \
1412 __kmp_barrier_release_branch_bits [ i ]))
1417 __kmp_stg_print_barrier_branch_bit( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1419 for (
int i=bs_plain_barrier; i<bs_last_barrier; i++ ) {
1420 var = __kmp_barrier_branch_bit_env_name[ i ];
1421 if ( strcmp( var, name) == 0 ) {
1422 if( __kmp_env_format ) {
1423 KMP_STR_BUF_PRINT_NAME_EX(__kmp_barrier_branch_bit_env_name[ i ]);
1425 __kmp_str_buf_print( buffer,
" %s='", __kmp_barrier_branch_bit_env_name[ i ] );
1427 __kmp_str_buf_print( buffer,
"%d,%d'\n", __kmp_barrier_gather_branch_bits [ i ], __kmp_barrier_release_branch_bits [ i ]);
1441 __kmp_stg_parse_barrier_pattern(
char const * name,
char const * value,
void * data ) {
1445 for (
int i=bs_plain_barrier; i<bs_last_barrier; i++ ) {
1446 var = __kmp_barrier_pattern_env_name[ i ];
1448 if ( ( strcmp ( var, name ) == 0 ) && ( value != 0 ) ) {
1450 char *comma = (
char *) strchr( value,
',' );
1453 for ( j = bp_linear_bar; j<bp_last_bar; j++ ) {
1454 if (__kmp_match_with_sentinel( __kmp_barrier_pattern_name[j], value, 1,
',' )) {
1455 __kmp_barrier_gather_pattern[ i ] = (kmp_bar_pat_e) j;
1459 if ( j == bp_last_bar ) {
1460 KMP_WARNING( BarrGatherValueInvalid, name, value );
1461 KMP_INFORM( Using_str_Value, name, __kmp_barrier_pattern_name[ bp_linear_bar ] );
1465 if ( comma != NULL ) {
1466 for ( j = bp_linear_bar; j < bp_last_bar; j++ ) {
1467 if ( __kmp_str_match( __kmp_barrier_pattern_name[j], 1, comma + 1 ) ) {
1468 __kmp_barrier_release_pattern[ i ] = (kmp_bar_pat_e) j;
1472 if (j == bp_last_bar) {
1473 __kmp_msg( kmp_ms_warning, KMP_MSG( BarrReleaseValueInvalid, name, comma + 1 ), __kmp_msg_null );
1474 KMP_INFORM( Using_str_Value, name, __kmp_barrier_pattern_name[ bp_linear_bar ] );
1482 __kmp_stg_print_barrier_pattern( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1484 for (
int i=bs_plain_barrier; i<bs_last_barrier; i++ ) {
1485 var = __kmp_barrier_pattern_env_name[ i ];
1486 if ( strcmp ( var, name ) == 0 ) {
1487 int j = __kmp_barrier_gather_pattern [ i ];
1488 int k = __kmp_barrier_release_pattern [ i ];
1489 if( __kmp_env_format ) {
1490 KMP_STR_BUF_PRINT_NAME_EX(__kmp_barrier_pattern_env_name[ i ]);
1492 __kmp_str_buf_print( buffer,
" %s='", __kmp_barrier_pattern_env_name[ i ] );
1494 __kmp_str_buf_print( buffer,
"%s,%s'\n", __kmp_barrier_pattern_name [ j ], __kmp_barrier_pattern_name [ k ]);
1504 __kmp_stg_parse_abort_delay(
char const * name,
char const * value,
void * data ) {
1506 int delay = __kmp_abort_delay / 1000;
1507 __kmp_stg_parse_int( name, value, 0, INT_MAX / 1000, & delay );
1508 __kmp_abort_delay = delay * 1000;
1512 __kmp_stg_print_abort_delay( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1513 __kmp_stg_print_int( buffer, name, __kmp_abort_delay );
1521 __kmp_stg_parse_cpuinfo_file(
char const * name,
char const * value,
void * data ) {
1522 #if KMP_AFFINITY_SUPPORTED 1523 __kmp_stg_parse_str( name, value, & __kmp_cpuinfo_file );
1524 K_DIAG( 1, (
"__kmp_cpuinfo_file == %s\n", __kmp_cpuinfo_file ) );
1529 __kmp_stg_print_cpuinfo_file( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1530 #if KMP_AFFINITY_SUPPORTED 1531 if( __kmp_env_format ) {
1532 KMP_STR_BUF_PRINT_NAME;
1534 __kmp_str_buf_print( buffer,
" %s", name );
1536 if ( __kmp_cpuinfo_file ) {
1537 __kmp_str_buf_print( buffer,
"='%s'\n", __kmp_cpuinfo_file );
1539 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
1549 __kmp_stg_parse_force_reduction(
char const * name,
char const * value,
void * data )
1551 kmp_stg_fr_data_t * reduction = (kmp_stg_fr_data_t *) data;
1554 rc = __kmp_stg_check_rivals( name, value, reduction->rivals );
1558 if ( reduction->force ) {
1560 if( __kmp_str_match(
"critical", 0, value ) )
1561 __kmp_force_reduction_method = critical_reduce_block;
1562 else if( __kmp_str_match(
"atomic", 0, value ) )
1563 __kmp_force_reduction_method = atomic_reduce_block;
1564 else if( __kmp_str_match(
"tree", 0, value ) )
1565 __kmp_force_reduction_method = tree_reduce_block;
1567 KMP_FATAL( UnknownForceReduction, name, value );
1571 __kmp_stg_parse_bool( name, value, & __kmp_determ_red );
1572 if( __kmp_determ_red ) {
1573 __kmp_force_reduction_method = tree_reduce_block;
1575 __kmp_force_reduction_method = reduction_method_not_defined;
1578 K_DIAG( 1, (
"__kmp_force_reduction_method == %d\n", __kmp_force_reduction_method ) );
1582 __kmp_stg_print_force_reduction( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1584 kmp_stg_fr_data_t * reduction = (kmp_stg_fr_data_t *) data;
1585 if ( reduction->force ) {
1586 if( __kmp_force_reduction_method == critical_reduce_block) {
1587 __kmp_stg_print_str( buffer, name,
"critical");
1588 }
else if ( __kmp_force_reduction_method == atomic_reduce_block ) {
1589 __kmp_stg_print_str( buffer, name,
"atomic");
1590 }
else if ( __kmp_force_reduction_method == tree_reduce_block ) {
1591 __kmp_stg_print_str( buffer, name,
"tree");
1593 if( __kmp_env_format ) {
1594 KMP_STR_BUF_PRINT_NAME;
1596 __kmp_str_buf_print( buffer,
" %s", name );
1598 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
1601 __kmp_stg_print_bool( buffer, name, __kmp_determ_red );
1612 __kmp_stg_parse_storage_map(
char const * name,
char const * value,
void * data ) {
1613 if ( __kmp_str_match(
"verbose", 1, value ) ) {
1614 __kmp_storage_map = TRUE;
1615 __kmp_storage_map_verbose = TRUE;
1616 __kmp_storage_map_verbose_specified = TRUE;
1619 __kmp_storage_map_verbose = FALSE;
1620 __kmp_stg_parse_bool( name, value, & __kmp_storage_map );
1625 __kmp_stg_print_storage_map( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1626 if ( __kmp_storage_map_verbose || __kmp_storage_map_verbose_specified ) {
1627 __kmp_stg_print_str( buffer, name,
"verbose" );
1629 __kmp_stg_print_bool( buffer, name, __kmp_storage_map );
1638 __kmp_stg_parse_all_threadprivate(
char const * name,
char const * value,
void * data ) {
1639 __kmp_stg_parse_int( name, value, __kmp_allThreadsSpecified ? __kmp_max_nth : 1, __kmp_max_nth,
1640 & __kmp_tp_capacity );
1644 __kmp_stg_print_all_threadprivate( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1645 __kmp_stg_print_int( buffer, name, __kmp_tp_capacity );
1654 __kmp_stg_parse_foreign_threads_threadprivate(
char const * name,
char const * value,
void * data ) {
1655 __kmp_stg_parse_bool( name, value, & __kmp_foreign_tp );
1659 __kmp_stg_print_foreign_threads_threadprivate( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
1660 __kmp_stg_print_bool( buffer, name, __kmp_foreign_tp );
1668 #if KMP_AFFINITY_SUPPORTED 1673 __kmp_parse_affinity_proc_id_list(
const char *var,
const char *env,
1674 const char **nextEnv,
char **proclist )
1676 const char *scan = env;
1677 const char *next = scan;
1683 int start, end, stride;
1687 if (*next ==
'\0') {
1700 if ((*next <
'0') || (*next >
'9')) {
1701 KMP_WARNING( AffSyntaxError, var );
1705 num = __kmp_str_to_int(scan, *next);
1706 KMP_ASSERT(num >= 0);
1730 if ((*next <
'0') || (*next >
'9')) {
1731 KMP_WARNING( AffSyntaxError, var );
1736 num = __kmp_str_to_int(scan, *next);
1737 KMP_ASSERT(num >= 0);
1752 if ((*next <
'0') || (*next >
'9')) {
1754 KMP_WARNING( AffSyntaxError, var );
1764 start = __kmp_str_to_int(scan, *next);
1765 KMP_ASSERT(start >= 0);
1790 if ((*next <
'0') || (*next >
'9')) {
1791 KMP_WARNING( AffSyntaxError, var );
1795 end = __kmp_str_to_int(scan, *next);
1796 KMP_ASSERT(end >= 0);
1817 if ((*next <
'0') || (*next >
'9')) {
1818 KMP_WARNING( AffSyntaxError, var );
1822 stride = __kmp_str_to_int(scan, *next);
1823 KMP_ASSERT(stride >= 0);
1831 KMP_WARNING( AffZeroStride, var );
1836 KMP_WARNING( AffStartGreaterEnd, var, start, end );
1842 KMP_WARNING( AffStrideLessZero, var, start, end );
1846 if ((end - start) / stride > 65536 ) {
1847 KMP_WARNING( AffRangeTooBig, var, end, start, stride );
1866 int len = next - env;
1867 char *retlist = (
char *)__kmp_allocate((len + 1) *
sizeof(char));
1868 KMP_MEMCPY_S(retlist, (len+1)*
sizeof(
char), env, len *
sizeof(
char));
1869 retlist[len] =
'\0';
1870 *proclist = retlist;
1880 static kmp_setting_t *__kmp_affinity_notype = NULL;
1883 __kmp_parse_affinity_env(
char const * name,
char const * value,
1884 enum affinity_type * out_type,
1885 char ** out_proclist,
1889 enum affinity_gran * out_gran,
1890 int * out_gran_levels,
1896 char * buffer = NULL;
1906 int max_proclist = 0;
1913 KMP_ASSERT( value != NULL );
1915 if ( TCR_4(__kmp_init_middle) ) {
1916 KMP_WARNING( EnvMiddleWarn, name );
1917 __kmp_env_toPrint( name, 0 );
1920 __kmp_env_toPrint( name, 1 );
1922 buffer = __kmp_str_format(
"%s", value );
1934 #define EMIT_WARN(skip,errlist) \ 1938 SKIP_TO(next, ','); \ 1942 KMP_WARNING errlist; \ 1945 if (ch == ',') next++; \ 1950 #define _set_param(_guard,_var,_val) \ 1952 if ( _guard == 0 ) { \ 1955 EMIT_WARN( FALSE, ( AffParamDefined, name, start ) ); \ 1960 #define set_type(val) _set_param( type, *out_type, val ) 1961 #define set_verbose(val) _set_param( verbose, *out_verbose, val ) 1962 #define set_warnings(val) _set_param( warnings, *out_warn, val ) 1963 #define set_respect(val) _set_param( respect, *out_respect, val ) 1964 #define set_dups(val) _set_param( dups, *out_dups, val ) 1965 #define set_proclist(val) _set_param( proclist, *out_proclist, val ) 1967 #define set_gran(val,levels) \ 1969 if ( gran == 0 ) { \ 1971 *out_gran_levels = levels; \ 1973 EMIT_WARN( FALSE, ( AffParamDefined, name, start ) ); \ 1979 KMP_DEBUG_ASSERT( ( __kmp_nested_proc_bind.bind_types != NULL )
1980 && ( __kmp_nested_proc_bind.used > 0 ) );
1983 while ( *buf !=
'\0' ) {
1986 if (__kmp_match_str(
"none", buf, (
const char **)&next)) {
1987 set_type( affinity_none );
1989 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
1992 }
else if (__kmp_match_str(
"scatter", buf, (
const char **)&next)) {
1993 set_type( affinity_scatter );
1995 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
1998 }
else if (__kmp_match_str(
"compact", buf, (
const char **)&next)) {
1999 set_type( affinity_compact );
2001 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
2004 }
else if (__kmp_match_str(
"logical", buf, (
const char **)&next)) {
2005 set_type( affinity_logical );
2007 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
2010 }
else if (__kmp_match_str(
"physical", buf, (
const char **)&next)) {
2011 set_type( affinity_physical );
2013 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
2016 }
else if (__kmp_match_str(
"explicit", buf, (
const char **)&next)) {
2017 set_type( affinity_explicit );
2019 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
2022 }
else if (__kmp_match_str(
"balanced", buf, (
const char **)&next)) {
2023 set_type( affinity_balanced );
2025 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
2028 }
else if (__kmp_match_str(
"disabled", buf, (
const char **)&next)) {
2029 set_type( affinity_disabled );
2031 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
2034 }
else if (__kmp_match_str(
"verbose", buf, (
const char **)&next)) {
2035 set_verbose( TRUE );
2037 }
else if (__kmp_match_str(
"noverbose", buf, (
const char **)&next)) {
2038 set_verbose( FALSE );
2040 }
else if (__kmp_match_str(
"warnings", buf, (
const char **)&next)) {
2041 set_warnings( TRUE );
2043 }
else if (__kmp_match_str(
"nowarnings", buf, (
const char **)&next)) {
2044 set_warnings( FALSE );
2046 }
else if (__kmp_match_str(
"respect", buf, (
const char **)&next)) {
2047 set_respect( TRUE );
2049 }
else if (__kmp_match_str(
"norespect", buf, (
const char **)&next)) {
2050 set_respect( FALSE );
2052 }
else if (__kmp_match_str(
"duplicates", buf, (
const char **)&next)
2053 || __kmp_match_str(
"dups", buf, (
const char **)&next)) {
2056 }
else if (__kmp_match_str(
"noduplicates", buf, (
const char **)&next)
2057 || __kmp_match_str(
"nodups", buf, (
const char **)&next)) {
2060 }
else if (__kmp_match_str(
"granularity", buf, (
const char **)&next)
2061 || __kmp_match_str(
"gran", buf, (
const char **)&next)) {
2064 EMIT_WARN( TRUE, ( AffInvalidParam, name, start ) );
2071 if (__kmp_match_str(
"fine", buf, (
const char **)&next)) {
2072 set_gran( affinity_gran_fine, -1 );
2074 }
else if (__kmp_match_str(
"thread", buf, (
const char **)&next)) {
2075 set_gran( affinity_gran_thread, -1 );
2077 }
else if (__kmp_match_str(
"core", buf, (
const char **)&next)) {
2078 set_gran( affinity_gran_core, -1 );
2080 }
else if (__kmp_match_str(
"package", buf, (
const char **)&next)) {
2081 set_gran( affinity_gran_package, -1 );
2083 }
else if (__kmp_match_str(
"node", buf, (
const char **)&next)) {
2084 set_gran( affinity_gran_node, -1 );
2086 # if KMP_GROUP_AFFINITY 2087 }
else if (__kmp_match_str(
"group", buf, (
const char **)&next)) {
2088 set_gran( affinity_gran_group, -1 );
2091 }
else if ((*buf >=
'0') && (*buf <=
'9')) {
2095 n = __kmp_str_to_int( buf, *next );
2098 set_gran( affinity_gran_default, n );
2100 EMIT_WARN( TRUE, ( AffInvalidParam, name, start ) );
2103 }
else if (__kmp_match_str(
"proclist", buf, (
const char **)&next)) {
2104 char *temp_proclist;
2108 EMIT_WARN( TRUE, ( AffInvalidParam, name, start ) );
2114 EMIT_WARN( TRUE, ( AffInvalidParam, name, start ) );
2119 if (! __kmp_parse_affinity_proc_id_list(name, buf,
2120 (
const char **)&next, &temp_proclist)) {
2125 if (*next ==
']') next++;
2127 if (*next ==
',') next++;
2132 EMIT_WARN( TRUE, ( AffInvalidParam, name, start ) );
2136 set_proclist( temp_proclist );
2137 }
else if ((*buf >=
'0') && (*buf <=
'9')) {
2142 n = __kmp_str_to_int( buf, *next );
2146 number[ count ] = n;
2148 KMP_WARNING( AffManyParams, name, start );
2152 EMIT_WARN( TRUE, ( AffInvalidParam, name, start ) );
2161 else if (*next !=
'\0') {
2162 const char *temp = next;
2163 EMIT_WARN( TRUE, ( ParseExtraCharsWarn, name, temp ) );
2175 #undef set_granularity 2177 KMP_INTERNAL_FREE( buffer );
2181 KMP_WARNING( AffProcListNoType, name );
2182 __kmp_affinity_type = affinity_explicit;
2184 else if ( __kmp_affinity_type != affinity_explicit ) {
2185 KMP_WARNING( AffProcListNotExplicit, name );
2186 KMP_ASSERT( *out_proclist != NULL );
2187 KMP_INTERNAL_FREE( *out_proclist );
2188 *out_proclist = NULL;
2191 switch ( *out_type ) {
2192 case affinity_logical:
2193 case affinity_physical: {
2195 *out_offset = number[ 0 ];
2198 KMP_WARNING( AffManyParamsForLogic, name, number[ 1 ] );
2201 case affinity_balanced: {
2203 *out_compact = number[ 0 ];
2206 *out_offset = number[ 1 ];
2209 if ( __kmp_affinity_gran == affinity_gran_default ) {
2210 #if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS) 2211 if( __kmp_mic_type != non_mic ) {
2212 if( __kmp_affinity_verbose || __kmp_affinity_warnings ) {
2213 KMP_WARNING( AffGranUsing,
"KMP_AFFINITY",
"fine" );
2215 __kmp_affinity_gran = affinity_gran_fine;
2219 if( __kmp_affinity_verbose || __kmp_affinity_warnings ) {
2220 KMP_WARNING( AffGranUsing,
"KMP_AFFINITY",
"core" );
2222 __kmp_affinity_gran = affinity_gran_core;
2226 case affinity_scatter:
2227 case affinity_compact: {
2229 *out_compact = number[ 0 ];
2232 *out_offset = number[ 1 ];
2235 case affinity_explicit: {
2236 if ( *out_proclist == NULL ) {
2237 KMP_WARNING( AffNoProcList, name );
2238 __kmp_affinity_type = affinity_none;
2241 KMP_WARNING( AffNoParam, name,
"explicit" );
2244 case affinity_none: {
2246 KMP_WARNING( AffNoParam, name,
"none" );
2249 case affinity_disabled: {
2251 KMP_WARNING( AffNoParam, name,
"disabled" );
2254 case affinity_default: {
2256 KMP_WARNING( AffNoParam, name,
"default" );
2266 __kmp_stg_parse_affinity(
char const * name,
char const * value,
void * data )
2268 kmp_setting_t **rivals = (kmp_setting_t **) data;
2271 rc = __kmp_stg_check_rivals( name, value, rivals );
2276 __kmp_parse_affinity_env( name, value, & __kmp_affinity_type,
2277 & __kmp_affinity_proclist, & __kmp_affinity_verbose,
2278 & __kmp_affinity_warnings, & __kmp_affinity_respect_mask,
2279 & __kmp_affinity_gran, & __kmp_affinity_gran_levels,
2280 & __kmp_affinity_dups, & __kmp_affinity_compact,
2281 & __kmp_affinity_offset );
2286 __kmp_stg_print_affinity( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
2287 if( __kmp_env_format ) {
2288 KMP_STR_BUF_PRINT_NAME_EX(name);
2290 __kmp_str_buf_print( buffer,
" %s='", name );
2292 if ( __kmp_affinity_verbose ) {
2293 __kmp_str_buf_print( buffer,
"%s,",
"verbose");
2295 __kmp_str_buf_print( buffer,
"%s,",
"noverbose");
2297 if ( __kmp_affinity_warnings ) {
2298 __kmp_str_buf_print( buffer,
"%s,",
"warnings");
2300 __kmp_str_buf_print( buffer,
"%s,",
"nowarnings");
2302 if ( KMP_AFFINITY_CAPABLE() ) {
2303 if ( __kmp_affinity_respect_mask ) {
2304 __kmp_str_buf_print( buffer,
"%s,",
"respect");
2306 __kmp_str_buf_print( buffer,
"%s,",
"norespect");
2308 switch ( __kmp_affinity_gran ) {
2309 case affinity_gran_default:
2310 __kmp_str_buf_print( buffer,
"%s",
"granularity=default,");
2312 case affinity_gran_fine:
2313 __kmp_str_buf_print( buffer,
"%s",
"granularity=fine,");
2315 case affinity_gran_thread:
2316 __kmp_str_buf_print( buffer,
"%s",
"granularity=thread,");
2318 case affinity_gran_core:
2319 __kmp_str_buf_print( buffer,
"%s",
"granularity=core,");
2321 case affinity_gran_package:
2322 __kmp_str_buf_print( buffer,
"%s",
"granularity=package,");
2324 case affinity_gran_node:
2325 __kmp_str_buf_print( buffer,
"%s",
"granularity=node,");
2327 # if KMP_GROUP_AFFINITY 2328 case affinity_gran_group:
2329 __kmp_str_buf_print( buffer,
"%s",
"granularity=group,");
2333 if ( __kmp_affinity_dups ) {
2334 __kmp_str_buf_print( buffer,
"%s,",
"duplicates");
2336 __kmp_str_buf_print( buffer,
"%s,",
"noduplicates");
2339 if ( ! KMP_AFFINITY_CAPABLE() ) {
2340 __kmp_str_buf_print( buffer,
"%s",
"disabled" );
2342 else switch ( __kmp_affinity_type ){
2344 __kmp_str_buf_print( buffer,
"%s",
"none");
2346 case affinity_physical:
2347 __kmp_str_buf_print( buffer,
"%s,%d",
"physical",
2348 __kmp_affinity_offset );
2350 case affinity_logical:
2351 __kmp_str_buf_print( buffer,
"%s,%d",
"logical",
2352 __kmp_affinity_offset );
2354 case affinity_compact:
2355 __kmp_str_buf_print( buffer,
"%s,%d,%d",
"compact",
2356 __kmp_affinity_compact, __kmp_affinity_offset );
2358 case affinity_scatter:
2359 __kmp_str_buf_print( buffer,
"%s,%d,%d",
"scatter",
2360 __kmp_affinity_compact, __kmp_affinity_offset );
2362 case affinity_explicit:
2363 __kmp_str_buf_print( buffer,
"%s=[%s],%s",
"proclist",
2364 __kmp_affinity_proclist,
"explicit" );
2366 case affinity_balanced:
2367 __kmp_str_buf_print( buffer,
"%s,%d,%d",
"balanced",
2368 __kmp_affinity_compact, __kmp_affinity_offset );
2370 case affinity_disabled:
2371 __kmp_str_buf_print( buffer,
"%s",
"disabled");
2373 case affinity_default:
2374 __kmp_str_buf_print( buffer,
"%s",
"default");
2377 __kmp_str_buf_print( buffer,
"%s",
"<unknown>");
2380 __kmp_str_buf_print( buffer,
"'\n" );
2383 # ifdef KMP_GOMP_COMPAT 2386 __kmp_stg_parse_gomp_cpu_affinity(
char const * name,
char const * value,
void * data )
2388 const char * next = NULL;
2389 char * temp_proclist;
2390 kmp_setting_t **rivals = (kmp_setting_t **) data;
2393 rc = __kmp_stg_check_rivals( name, value, rivals );
2398 if ( TCR_4(__kmp_init_middle) ) {
2399 KMP_WARNING( EnvMiddleWarn, name );
2400 __kmp_env_toPrint( name, 0 );
2404 __kmp_env_toPrint( name, 1 );
2406 if ( __kmp_parse_affinity_proc_id_list( name, value, &next,
2409 if (*next ==
'\0') {
2413 __kmp_affinity_proclist = temp_proclist;
2414 __kmp_affinity_type = affinity_explicit;
2415 __kmp_affinity_gran = affinity_gran_fine;
2417 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
2421 KMP_WARNING( AffSyntaxError, name );
2422 if (temp_proclist != NULL) {
2423 KMP_INTERNAL_FREE((
void *)temp_proclist);
2431 __kmp_affinity_type = affinity_none;
2433 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
2466 __kmp_parse_subplace_list(
const char *var,
const char **scan )
2471 int start, count, stride;
2477 if ((**scan <
'0') || (**scan >
'9')) {
2478 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2483 start = __kmp_str_to_int(*scan, *next);
2484 KMP_ASSERT(start >= 0);
2491 if (**scan ==
'}') {
2494 if (**scan ==
',') {
2498 if (**scan !=
':') {
2499 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2508 if ((**scan <
'0') || (**scan >
'9')) {
2509 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2514 count = __kmp_str_to_int(*scan, *next);
2515 KMP_ASSERT(count >= 0);
2522 if (**scan ==
'}') {
2525 if (**scan ==
',') {
2529 if (**scan !=
':') {
2530 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2541 if (**scan ==
'+') {
2545 if (**scan ==
'-') {
2553 if ((**scan <
'0') || (**scan >
'9')) {
2554 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2559 stride = __kmp_str_to_int(*scan, *next);
2560 KMP_ASSERT(stride >= 0);
2568 if (**scan ==
'}') {
2571 if (**scan ==
',') {
2576 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2583 __kmp_parse_place(
const char *var,
const char ** scan )
2591 if (**scan ==
'{') {
2593 if (! __kmp_parse_subplace_list(var, scan)) {
2596 if (**scan !=
'}') {
2597 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2602 else if (**scan ==
'!') {
2604 return __kmp_parse_place(var, scan);
2606 else if ((**scan >=
'0') && (**scan <=
'9')) {
2609 int proc = __kmp_str_to_int(*scan, *next);
2610 KMP_ASSERT(proc >= 0);
2614 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2621 __kmp_parse_place_list(
const char *var,
const char *env,
char **place_list )
2623 const char *scan = env;
2624 const char *next = scan;
2627 int start, count, stride;
2629 if (! __kmp_parse_place(var, &scan)) {
2637 if (*scan ==
'\0') {
2645 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2654 if ((*scan <
'0') || (*scan >
'9')) {
2655 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2660 count = __kmp_str_to_int(scan, *next);
2661 KMP_ASSERT(count >= 0);
2668 if (*scan ==
'\0') {
2676 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2699 if ((*scan <
'0') || (*scan >
'9')) {
2700 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2705 stride = __kmp_str_to_int(scan, *next);
2706 KMP_ASSERT(stride >= 0);
2714 if (*scan ==
'\0') {
2722 KMP_WARNING( SyntaxErrorUsing, var,
"\"threads\"" );
2727 int len = scan - env;
2728 char *retlist = (
char *)__kmp_allocate((len + 1) *
sizeof(char));
2729 KMP_MEMCPY_S(retlist, (len+1)*
sizeof(
char), env, len *
sizeof(
char));
2730 retlist[len] =
'\0';
2731 *place_list = retlist;
2737 __kmp_stg_parse_places(
char const * name,
char const * value,
void * data )
2740 const char *scan = value;
2741 const char *next = scan;
2742 const char *kind =
"\"threads\"";
2743 kmp_setting_t **rivals = (kmp_setting_t **) data;
2746 rc = __kmp_stg_check_rivals( name, value, rivals );
2755 if ( __kmp_nested_proc_bind.bind_types[0] == proc_bind_default ) {
2756 __kmp_nested_proc_bind.bind_types[0] = proc_bind_true;
2761 if ( __kmp_match_str(
"threads", scan, &next ) ) {
2763 __kmp_affinity_type = affinity_compact;
2764 __kmp_affinity_gran = affinity_gran_thread;
2765 __kmp_affinity_dups = FALSE;
2766 kind =
"\"threads\"";
2768 else if ( __kmp_match_str(
"cores", scan, &next ) ) {
2770 __kmp_affinity_type = affinity_compact;
2771 __kmp_affinity_gran = affinity_gran_core;
2772 __kmp_affinity_dups = FALSE;
2775 else if ( __kmp_match_str(
"sockets", scan, &next ) ) {
2777 __kmp_affinity_type = affinity_compact;
2778 __kmp_affinity_gran = affinity_gran_package;
2779 __kmp_affinity_dups = FALSE;
2780 kind =
"\"sockets\"";
2783 if ( __kmp_affinity_proclist != NULL ) {
2784 KMP_INTERNAL_FREE( (
void *)__kmp_affinity_proclist );
2785 __kmp_affinity_proclist = NULL;
2787 if ( __kmp_parse_place_list( name, value, &__kmp_affinity_proclist ) ) {
2788 __kmp_affinity_type = affinity_explicit;
2789 __kmp_affinity_gran = affinity_gran_fine;
2790 __kmp_affinity_dups = FALSE;
2791 if ( __kmp_nested_proc_bind.bind_types[0] == proc_bind_default ) {
2792 __kmp_nested_proc_bind.bind_types[0] = proc_bind_true;
2798 if ( __kmp_nested_proc_bind.bind_types[0] == proc_bind_default ) {
2799 __kmp_nested_proc_bind.bind_types[0] = proc_bind_true;
2803 if ( *scan ==
'\0' ) {
2810 if ( *scan !=
'(' ) {
2811 KMP_WARNING( SyntaxErrorUsing, name, kind );
2819 count = __kmp_str_to_int(scan, *next);
2820 KMP_ASSERT(count >= 0);
2824 if ( *scan !=
')' ) {
2825 KMP_WARNING( SyntaxErrorUsing, name, kind );
2831 if ( *scan !=
'\0' ) {
2832 KMP_WARNING( ParseExtraCharsWarn, name, scan );
2834 __kmp_affinity_num_places = count;
2838 __kmp_stg_print_places( kmp_str_buf_t * buffer,
char const * name,
2841 if( __kmp_env_format ) {
2842 KMP_STR_BUF_PRINT_NAME;
2844 __kmp_str_buf_print( buffer,
" %s", name );
2846 if ( ( __kmp_nested_proc_bind.used == 0 )
2847 || ( __kmp_nested_proc_bind.bind_types == NULL )
2848 || ( __kmp_nested_proc_bind.bind_types[0] == proc_bind_false ) ) {
2849 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
2851 else if ( __kmp_affinity_type == affinity_explicit ) {
2852 if ( __kmp_affinity_proclist != NULL ) {
2853 __kmp_str_buf_print( buffer,
"='%s'\n", __kmp_affinity_proclist );
2856 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
2859 else if ( __kmp_affinity_type == affinity_compact ) {
2861 if ( __kmp_affinity_num_masks > 0 ) {
2862 num = __kmp_affinity_num_masks;
2864 else if ( __kmp_affinity_num_places > 0 ) {
2865 num = __kmp_affinity_num_places;
2870 if ( __kmp_affinity_gran == affinity_gran_thread ) {
2872 __kmp_str_buf_print( buffer,
"='threads(%d)'\n", num );
2875 __kmp_str_buf_print( buffer,
"='threads'\n" );
2878 else if ( __kmp_affinity_gran == affinity_gran_core ) {
2880 __kmp_str_buf_print( buffer,
"='cores(%d)' \n", num );
2883 __kmp_str_buf_print( buffer,
"='cores'\n" );
2886 else if ( __kmp_affinity_gran == affinity_gran_package ) {
2888 __kmp_str_buf_print( buffer,
"='sockets(%d)'\n", num );
2891 __kmp_str_buf_print( buffer,
"='sockets'\n" );
2895 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
2899 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
2905 # if (! OMP_40_ENABLED) 2908 __kmp_stg_parse_proc_bind(
char const * name,
char const * value,
void * data )
2911 kmp_setting_t **rivals = (kmp_setting_t **) data;
2914 rc = __kmp_stg_check_rivals( name, value, rivals );
2922 __kmp_stg_parse_bool( name, value, & enabled );
2928 __kmp_affinity_type = affinity_scatter;
2929 if( __kmp_mic_type != non_mic ) {
2930 __kmp_affinity_gran = affinity_gran_fine;
2932 __kmp_affinity_gran = affinity_gran_core;
2936 __kmp_affinity_type = affinity_none;
2944 __kmp_stg_parse_topology_method(
char const * name,
char const * value,
2946 if ( __kmp_str_match(
"all", 1, value ) ) {
2947 __kmp_affinity_top_method = affinity_top_method_all;
2949 # if KMP_ARCH_X86 || KMP_ARCH_X86_64 2950 else if ( __kmp_str_match(
"x2apic id", 9, value )
2951 || __kmp_str_match(
"x2apic_id", 9, value )
2952 || __kmp_str_match(
"x2apic-id", 9, value )
2953 || __kmp_str_match(
"x2apicid", 8, value )
2954 || __kmp_str_match(
"cpuid leaf 11", 13, value )
2955 || __kmp_str_match(
"cpuid_leaf_11", 13, value )
2956 || __kmp_str_match(
"cpuid-leaf-11", 13, value )
2957 || __kmp_str_match(
"cpuid leaf11", 12, value )
2958 || __kmp_str_match(
"cpuid_leaf11", 12, value )
2959 || __kmp_str_match(
"cpuid-leaf11", 12, value )
2960 || __kmp_str_match(
"cpuidleaf 11", 12, value )
2961 || __kmp_str_match(
"cpuidleaf_11", 12, value )
2962 || __kmp_str_match(
"cpuidleaf-11", 12, value )
2963 || __kmp_str_match(
"cpuidleaf11", 11, value )
2964 || __kmp_str_match(
"cpuid 11", 8, value )
2965 || __kmp_str_match(
"cpuid_11", 8, value )
2966 || __kmp_str_match(
"cpuid-11", 8, value )
2967 || __kmp_str_match(
"cpuid11", 7, value )
2968 || __kmp_str_match(
"leaf 11", 7, value )
2969 || __kmp_str_match(
"leaf_11", 7, value )
2970 || __kmp_str_match(
"leaf-11", 7, value )
2971 || __kmp_str_match(
"leaf11", 6, value ) ) {
2972 __kmp_affinity_top_method = affinity_top_method_x2apicid;
2974 else if ( __kmp_str_match(
"apic id", 7, value )
2975 || __kmp_str_match(
"apic_id", 7, value )
2976 || __kmp_str_match(
"apic-id", 7, value )
2977 || __kmp_str_match(
"apicid", 6, value )
2978 || __kmp_str_match(
"cpuid leaf 4", 12, value )
2979 || __kmp_str_match(
"cpuid_leaf_4", 12, value )
2980 || __kmp_str_match(
"cpuid-leaf-4", 12, value )
2981 || __kmp_str_match(
"cpuid leaf4", 11, value )
2982 || __kmp_str_match(
"cpuid_leaf4", 11, value )
2983 || __kmp_str_match(
"cpuid-leaf4", 11, value )
2984 || __kmp_str_match(
"cpuidleaf 4", 11, value )
2985 || __kmp_str_match(
"cpuidleaf_4", 11, value )
2986 || __kmp_str_match(
"cpuidleaf-4", 11, value )
2987 || __kmp_str_match(
"cpuidleaf4", 10, value )
2988 || __kmp_str_match(
"cpuid 4", 7, value )
2989 || __kmp_str_match(
"cpuid_4", 7, value )
2990 || __kmp_str_match(
"cpuid-4", 7, value )
2991 || __kmp_str_match(
"cpuid4", 6, value )
2992 || __kmp_str_match(
"leaf 4", 6, value )
2993 || __kmp_str_match(
"leaf_4", 6, value )
2994 || __kmp_str_match(
"leaf-4", 6, value )
2995 || __kmp_str_match(
"leaf4", 5, value ) ) {
2996 __kmp_affinity_top_method = affinity_top_method_apicid;
2999 else if ( __kmp_str_match(
"/proc/cpuinfo", 2, value )
3000 || __kmp_str_match(
"cpuinfo", 5, value )) {
3001 __kmp_affinity_top_method = affinity_top_method_cpuinfo;
3003 # if KMP_GROUP_AFFINITY 3004 else if ( __kmp_str_match(
"group", 1, value ) ) {
3005 __kmp_affinity_top_method = affinity_top_method_group;
3008 else if ( __kmp_str_match(
"flat", 1, value ) ) {
3009 __kmp_affinity_top_method = affinity_top_method_flat;
3012 KMP_WARNING( StgInvalidValue, name, value );
3017 __kmp_stg_print_topology_method( kmp_str_buf_t * buffer,
char const * name,
3020 char const * value = NULL;
3022 switch ( __kmp_affinity_top_method ) {
3023 case affinity_top_method_default:
3027 case affinity_top_method_all:
3031 # if KMP_ARCH_X86 || KMP_ARCH_X86_64 3032 case affinity_top_method_x2apicid:
3033 value =
"x2APIC id";
3036 case affinity_top_method_apicid:
3041 case affinity_top_method_cpuinfo:
3045 # if KMP_GROUP_AFFINITY 3046 case affinity_top_method_group:
3051 case affinity_top_method_flat:
3056 if ( value != NULL ) {
3057 __kmp_stg_print_str( buffer, name, value );
3072 __kmp_stg_parse_proc_bind(
char const * name,
char const * value,
void * data )
3074 kmp_setting_t **rivals = (kmp_setting_t **) data;
3077 rc = __kmp_stg_check_rivals( name, value, rivals );
3085 KMP_DEBUG_ASSERT( (__kmp_nested_proc_bind.bind_types != NULL)
3086 && ( __kmp_nested_proc_bind.used > 0 ) );
3088 const char *buf = value;
3092 if ( (*buf >=
'0') && (*buf <=
'9') ) {
3094 SKIP_DIGITS( next );
3095 num = __kmp_str_to_int( buf, *next );
3096 KMP_ASSERT( num >= 0 );
3105 if ( __kmp_match_str(
"disabled", buf, &next ) ) {
3108 # if KMP_AFFINITY_SUPPORTED 3109 __kmp_affinity_type = affinity_disabled;
3111 __kmp_nested_proc_bind.used = 1;
3112 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
3114 else if ( ( num == (
int)proc_bind_false )
3115 || __kmp_match_str(
"false", buf, &next ) ) {
3118 # if KMP_AFFINITY_SUPPORTED 3119 __kmp_affinity_type = affinity_none;
3121 __kmp_nested_proc_bind.used = 1;
3122 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
3124 else if ( ( num == (
int)proc_bind_true )
3125 || __kmp_match_str(
"true", buf, &next ) ) {
3128 __kmp_nested_proc_bind.used = 1;
3129 __kmp_nested_proc_bind.bind_types[0] = proc_bind_true;
3137 for ( scan = buf; *scan !=
'\0'; scan++ ) {
3138 if ( *scan ==
',' ) {
3146 if ( __kmp_nested_proc_bind.size < nelem ) {
3147 __kmp_nested_proc_bind.bind_types = (kmp_proc_bind_t *)
3148 KMP_INTERNAL_REALLOC( __kmp_nested_proc_bind.bind_types,
3149 sizeof(kmp_proc_bind_t) * nelem );
3150 if ( __kmp_nested_proc_bind.bind_types == NULL ) {
3151 KMP_FATAL( MemoryAllocFailed );
3153 __kmp_nested_proc_bind.size = nelem;
3155 __kmp_nested_proc_bind.used = nelem;
3162 enum kmp_proc_bind_t bind;
3164 if ( ( num == (
int)proc_bind_master )
3165 || __kmp_match_str(
"master", buf, &next ) ) {
3168 bind = proc_bind_master;
3170 else if ( ( num == (
int)proc_bind_close )
3171 || __kmp_match_str(
"close", buf, &next ) ) {
3174 bind = proc_bind_close;
3176 else if ( ( num == (
int)proc_bind_spread )
3177 || __kmp_match_str(
"spread", buf, &next ) ) {
3180 bind = proc_bind_spread;
3183 KMP_WARNING( StgInvalidValue, name, value );
3184 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
3185 __kmp_nested_proc_bind.used = 1;
3189 __kmp_nested_proc_bind.bind_types[i++] = bind;
3193 KMP_DEBUG_ASSERT( *buf ==
',' );
3200 if ( (*buf >=
'0') && (*buf <=
'9') ) {
3202 SKIP_DIGITS( next );
3203 num = __kmp_str_to_int( buf, *next );
3204 KMP_ASSERT( num >= 0 );
3214 if ( *buf !=
'\0' ) {
3215 KMP_WARNING( ParseExtraCharsWarn, name, buf );
3221 __kmp_stg_print_proc_bind( kmp_str_buf_t * buffer,
char const * name,
3224 int nelem = __kmp_nested_proc_bind.used;
3225 if( __kmp_env_format ) {
3226 KMP_STR_BUF_PRINT_NAME;
3228 __kmp_str_buf_print( buffer,
" %s", name );
3231 __kmp_str_buf_print( buffer,
": %s\n", KMP_I18N_STR( NotDefined ) );
3235 __kmp_str_buf_print( buffer,
"='", name );
3236 for ( i = 0; i < nelem; i++ ) {
3237 switch ( __kmp_nested_proc_bind.bind_types[i] ) {
3238 case proc_bind_false:
3239 __kmp_str_buf_print( buffer,
"false" );
3242 case proc_bind_true:
3243 __kmp_str_buf_print( buffer,
"true" );
3246 case proc_bind_master:
3247 __kmp_str_buf_print( buffer,
"master" );
3250 case proc_bind_close:
3251 __kmp_str_buf_print( buffer,
"close" );
3254 case proc_bind_spread:
3255 __kmp_str_buf_print( buffer,
"spread" );
3258 case proc_bind_intel:
3259 __kmp_str_buf_print( buffer,
"intel" );
3262 case proc_bind_default:
3263 __kmp_str_buf_print( buffer,
"default" );
3266 if ( i < nelem - 1 ) {
3267 __kmp_str_buf_print( buffer,
"," );
3270 __kmp_str_buf_print( buffer,
"'\n" );
3282 __kmp_stg_parse_omp_dynamic(
char const * name,
char const * value,
void * data )
3284 __kmp_stg_parse_bool( name, value, & (__kmp_global.g.g_dynamic) );
3288 __kmp_stg_print_omp_dynamic( kmp_str_buf_t * buffer,
char const * name,
void * data )
3290 __kmp_stg_print_bool( buffer, name, __kmp_global.g.g_dynamic );
3294 __kmp_stg_parse_kmp_dynamic_mode(
char const * name,
char const * value,
void * data )
3296 if ( TCR_4(__kmp_init_parallel) ) {
3297 KMP_WARNING( EnvParallelWarn, name );
3298 __kmp_env_toPrint( name, 0 );
3301 #ifdef USE_LOAD_BALANCE 3302 else if ( __kmp_str_match(
"load balance", 2, value )
3303 || __kmp_str_match(
"load_balance", 2, value )
3304 || __kmp_str_match(
"load-balance", 2, value )
3305 || __kmp_str_match(
"loadbalance", 2, value )
3306 || __kmp_str_match(
"balance", 1, value ) ) {
3307 __kmp_global.g.g_dynamic_mode = dynamic_load_balance;
3310 else if ( __kmp_str_match(
"thread limit", 1, value )
3311 || __kmp_str_match(
"thread_limit", 1, value )
3312 || __kmp_str_match(
"thread-limit", 1, value )
3313 || __kmp_str_match(
"threadlimit", 1, value )
3314 || __kmp_str_match(
"limit", 2, value ) ) {
3315 __kmp_global.g.g_dynamic_mode = dynamic_thread_limit;
3317 else if ( __kmp_str_match(
"random", 1, value ) ) {
3318 __kmp_global.g.g_dynamic_mode = dynamic_random;
3321 KMP_WARNING( StgInvalidValue, name, value );
3326 __kmp_stg_print_kmp_dynamic_mode( kmp_str_buf_t * buffer,
char const * name,
void * data )
3329 if ( __kmp_global.g.g_dynamic_mode == dynamic_default ) {
3330 __kmp_str_buf_print( buffer,
" %s: %s \n", name, KMP_I18N_STR( NotDefined ) );
3332 # ifdef USE_LOAD_BALANCE 3333 else if ( __kmp_global.g.g_dynamic_mode == dynamic_load_balance ) {
3334 __kmp_stg_print_str( buffer, name,
"load balance" );
3337 else if ( __kmp_global.g.g_dynamic_mode == dynamic_thread_limit ) {
3338 __kmp_stg_print_str( buffer, name,
"thread limit" );
3340 else if ( __kmp_global.g.g_dynamic_mode == dynamic_random ) {
3341 __kmp_stg_print_str( buffer, name,
"random" );
3350 #ifdef USE_LOAD_BALANCE 3357 __kmp_stg_parse_ld_balance_interval(
char const * name,
char const * value,
void * data )
3359 double interval = __kmp_convert_to_double( value );
3360 if ( interval >= 0 ) {
3361 __kmp_load_balance_interval = interval;
3363 KMP_WARNING( StgInvalidValue, name, value );
3368 __kmp_stg_print_ld_balance_interval( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3370 __kmp_str_buf_print( buffer,
" %s=%8.6f\n", name, __kmp_load_balance_interval );
3383 __kmp_stg_parse_init_at_fork(
char const * name,
char const * value,
void * data ) {
3384 __kmp_stg_parse_bool( name, value, & __kmp_need_register_atfork );
3385 if ( __kmp_need_register_atfork ) {
3386 __kmp_need_register_atfork_specified = TRUE;
3391 __kmp_stg_print_init_at_fork( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3392 __kmp_stg_print_bool( buffer, name, __kmp_need_register_atfork_specified );
3400 __kmp_stg_parse_schedule(
char const * name,
char const * value,
void * data ) {
3402 if ( value != NULL ) {
3403 size_t length = KMP_STRLEN( value );
3404 if ( length > INT_MAX ) {
3405 KMP_WARNING( LongValue, name );
3408 if( value[ length - 1 ] ==
'"' || value[ length -1 ] ==
'\'' )
3409 KMP_WARNING( UnbalancedQuotes, name );
3413 semicolon = (
char *) strchr( value,
';' );
3414 if( *value && semicolon != value ) {
3415 char *comma = (
char *) strchr( value,
',' );
3422 if ( !__kmp_strcasecmp_with_sentinel(
"static", value, sentinel ) ) {
3423 if( !__kmp_strcasecmp_with_sentinel(
"greedy", comma,
';' ) ) {
3424 __kmp_static = kmp_sch_static_greedy;
3426 }
else if( !__kmp_strcasecmp_with_sentinel(
"balanced", comma,
';' ) ) {
3427 __kmp_static = kmp_sch_static_balanced;
3430 }
else if ( !__kmp_strcasecmp_with_sentinel(
"guided", value, sentinel ) ) {
3431 if ( !__kmp_strcasecmp_with_sentinel(
"iterative", comma,
';' ) ) {
3432 __kmp_guided = kmp_sch_guided_iterative_chunked;
3434 }
else if ( !__kmp_strcasecmp_with_sentinel(
"analytical", comma,
';' ) ) {
3436 __kmp_guided = kmp_sch_guided_analytical_chunked;
3440 KMP_WARNING( InvalidClause, name, value );
3442 KMP_WARNING( EmptyClause, name );
3443 }
while ( (value = semicolon ? semicolon + 1 : NULL) );
3450 __kmp_stg_print_schedule( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3451 if( __kmp_env_format ) {
3452 KMP_STR_BUF_PRINT_NAME_EX(name);
3454 __kmp_str_buf_print( buffer,
" %s='", name );
3456 if ( __kmp_static == kmp_sch_static_greedy ) {
3457 __kmp_str_buf_print( buffer,
"%s",
"static,greedy");
3458 }
else if ( __kmp_static == kmp_sch_static_balanced ) {
3459 __kmp_str_buf_print ( buffer,
"%s",
"static,balanced");
3461 if ( __kmp_guided == kmp_sch_guided_iterative_chunked ) {
3462 __kmp_str_buf_print( buffer,
";%s'\n",
"guided,iterative");
3463 }
else if ( __kmp_guided == kmp_sch_guided_analytical_chunked ) {
3464 __kmp_str_buf_print( buffer,
";%s'\n",
"guided,analytical");
3473 __kmp_stg_parse_omp_schedule(
char const * name,
char const * value,
void * data )
3477 length = KMP_STRLEN( value );
3479 char *comma = (
char *) strchr( value,
',' );
3480 if( value[ length - 1 ] ==
'"' || value[ length -1 ] ==
'\'')
3481 KMP_WARNING( UnbalancedQuotes, name );
3483 if (!__kmp_strcasecmp_with_sentinel(
"dynamic", value,
','))
3484 __kmp_sched = kmp_sch_dynamic_chunked;
3485 else if (!__kmp_strcasecmp_with_sentinel(
"guided", value,
','))
3488 else if (!__kmp_strcasecmp_with_sentinel(
"auto", value,
',')) {
3491 __kmp_msg( kmp_ms_warning, KMP_MSG( IgnoreChunk, name, comma ), __kmp_msg_null );
3495 else if (!__kmp_strcasecmp_with_sentinel(
"trapezoidal", value,
','))
3496 __kmp_sched = kmp_sch_trapezoidal;
3497 else if (!__kmp_strcasecmp_with_sentinel(
"static", value,
','))
3499 #ifdef KMP_STATIC_STEAL_ENABLED 3500 else if (KMP_ARCH_X86_64 &&
3501 !__kmp_strcasecmp_with_sentinel(
"static_steal", value,
','))
3505 KMP_WARNING( StgInvalidValue, name, value );
3508 if( value && comma ) {
3509 __kmp_env_chunk = TRUE;
3512 __kmp_sched = kmp_sch_static_chunked;
3514 __kmp_chunk = __kmp_str_to_int( comma, 0 );
3515 if ( __kmp_chunk < 1 ) {
3516 __kmp_chunk = KMP_DEFAULT_CHUNK;
3517 __kmp_msg( kmp_ms_warning, KMP_MSG( InvalidChunk, name, comma ), __kmp_msg_null );
3518 KMP_INFORM( Using_int_Value, name, __kmp_chunk );
3524 }
else if ( __kmp_chunk > KMP_MAX_CHUNK ) {
3525 __kmp_chunk = KMP_MAX_CHUNK;
3526 __kmp_msg( kmp_ms_warning, KMP_MSG( LargeChunk, name, comma ), __kmp_msg_null );
3527 KMP_INFORM( Using_int_Value, name, __kmp_chunk );
3530 __kmp_env_chunk = FALSE;
3532 KMP_WARNING( EmptyString, name );
3534 K_DIAG(1, (
"__kmp_static == %d\n", __kmp_static))
3535 K_DIAG(1, ("__kmp_guided == %d\n", __kmp_guided))
3536 K_DIAG(1, ("__kmp_sched == %d\n", __kmp_sched))
3537 K_DIAG(1, ("__kmp_chunk == %d\n", __kmp_chunk))
3541 __kmp_stg_print_omp_schedule( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3542 if( __kmp_env_format ) {
3543 KMP_STR_BUF_PRINT_NAME_EX(name);
3545 __kmp_str_buf_print( buffer,
" %s='", name );
3547 if ( __kmp_chunk ) {
3548 switch ( __kmp_sched ) {
3549 case kmp_sch_dynamic_chunked:
3550 __kmp_str_buf_print( buffer,
"%s,%d'\n",
"dynamic", __kmp_chunk);
3552 case kmp_sch_guided_iterative_chunked:
3553 case kmp_sch_guided_analytical_chunked:
3554 __kmp_str_buf_print( buffer,
"%s,%d'\n",
"guided", __kmp_chunk);
3556 case kmp_sch_trapezoidal:
3557 __kmp_str_buf_print( buffer,
"%s,%d'\n",
"trapezoidal", __kmp_chunk);
3560 case kmp_sch_static_chunked:
3561 case kmp_sch_static_balanced:
3562 case kmp_sch_static_greedy:
3563 __kmp_str_buf_print( buffer,
"%s,%d'\n",
"static", __kmp_chunk);
3566 __kmp_str_buf_print( buffer,
"%s,%d'\n",
"static_steal", __kmp_chunk);
3569 __kmp_str_buf_print( buffer,
"%s,%d'\n",
"auto", __kmp_chunk);
3573 switch ( __kmp_sched ) {
3574 case kmp_sch_dynamic_chunked:
3575 __kmp_str_buf_print( buffer,
"%s'\n",
"dynamic");
3577 case kmp_sch_guided_iterative_chunked:
3578 case kmp_sch_guided_analytical_chunked:
3579 __kmp_str_buf_print( buffer,
"%s'\n",
"guided");
3581 case kmp_sch_trapezoidal:
3582 __kmp_str_buf_print( buffer,
"%s'\n",
"trapezoidal");
3585 case kmp_sch_static_chunked:
3586 case kmp_sch_static_balanced:
3587 case kmp_sch_static_greedy:
3588 __kmp_str_buf_print( buffer,
"%s'\n",
"static");
3591 __kmp_str_buf_print( buffer,
"%s'\n",
"static_steal");
3594 __kmp_str_buf_print( buffer,
"%s'\n",
"auto");
3605 __kmp_stg_parse_atomic_mode(
char const * name,
char const * value,
void * data ) {
3609 #ifdef KMP_GOMP_COMPAT 3612 __kmp_stg_parse_int( name, value, 0, max, & mode );
3616 __kmp_atomic_mode = mode;
3621 __kmp_stg_print_atomic_mode( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3622 __kmp_stg_print_int( buffer, name, __kmp_atomic_mode );
3631 __kmp_stg_parse_consistency_check(
char const * name,
char const * value,
void * data ) {
3632 if ( ! __kmp_strcasecmp_with_sentinel(
"all", value, 0 ) ) {
3636 __kmp_env_consistency_check = TRUE;
3637 }
else if ( ! __kmp_strcasecmp_with_sentinel(
"none", value, 0 ) ) {
3638 __kmp_env_consistency_check = FALSE;
3640 KMP_WARNING( StgInvalidValue, name, value );
3645 __kmp_stg_print_consistency_check( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3647 const char *value = NULL;
3649 if ( __kmp_env_consistency_check ) {
3655 if ( value != NULL ) {
3656 __kmp_stg_print_str( buffer, name, value );
3670 __kmp_stg_parse_itt_prepare_delay(
char const * name,
char const * value,
void * data )
3674 __kmp_stg_parse_int( name, value, 0, INT_MAX, & delay );
3675 __kmp_itt_prepare_delay = delay;
3679 __kmp_stg_print_itt_prepare_delay( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3680 __kmp_stg_print_uint64( buffer, name, __kmp_itt_prepare_delay );
3684 #endif // USE_ITT_NOTIFY 3692 __kmp_stg_parse_malloc_pool_incr(
char const * name,
char const * value,
void * data ) {
3693 __kmp_stg_parse_size(
3696 KMP_MIN_MALLOC_POOL_INCR,
3697 KMP_MAX_MALLOC_POOL_INCR,
3699 & __kmp_malloc_pool_incr,
3705 __kmp_stg_print_malloc_pool_incr( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3706 __kmp_stg_print_size( buffer, name, __kmp_malloc_pool_incr );
3718 __kmp_stg_parse_par_range_env(
char const * name,
char const * value,
void * data ) {
3719 __kmp_stg_parse_par_range(
3723 __kmp_par_range_routine,
3724 __kmp_par_range_filename,
3725 & __kmp_par_range_lb,
3726 & __kmp_par_range_ub
3731 __kmp_stg_print_par_range_env( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3732 if (__kmp_par_range != 0) {
3733 __kmp_stg_print_str( buffer, name, par_range_to_print );
3742 __kmp_stg_parse_yield_cycle(
char const * name,
char const * value,
void * data ) {
3743 int flag = __kmp_yield_cycle;
3744 __kmp_stg_parse_bool( name, value, & flag );
3745 __kmp_yield_cycle = flag;
3749 __kmp_stg_print_yield_cycle( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3750 __kmp_stg_print_bool( buffer, name, __kmp_yield_cycle );
3754 __kmp_stg_parse_yield_on(
char const * name,
char const * value,
void * data ) {
3755 __kmp_stg_parse_int( name, value, 2, INT_MAX, & __kmp_yield_on_count );
3759 __kmp_stg_print_yield_on( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3760 __kmp_stg_print_int( buffer, name, __kmp_yield_on_count );
3764 __kmp_stg_parse_yield_off(
char const * name,
char const * value,
void * data ) {
3765 __kmp_stg_parse_int( name, value, 2, INT_MAX, & __kmp_yield_off_count );
3769 __kmp_stg_print_yield_off( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3770 __kmp_stg_print_int( buffer, name, __kmp_yield_off_count );
3780 __kmp_stg_parse_init_wait(
char const * name,
char const * value,
void * data ) {
3782 KMP_ASSERT( ( __kmp_init_wait & 1 ) == 0 );
3783 wait = __kmp_init_wait / 2;
3784 __kmp_stg_parse_int( name, value, KMP_MIN_INIT_WAIT, KMP_MAX_INIT_WAIT, & wait );
3785 __kmp_init_wait = wait * 2;
3786 KMP_ASSERT( ( __kmp_init_wait & 1 ) == 0 );
3787 __kmp_yield_init = __kmp_init_wait;
3791 __kmp_stg_print_init_wait( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3792 __kmp_stg_print_int( buffer, name, __kmp_init_wait );
3796 __kmp_stg_parse_next_wait(
char const * name,
char const * value,
void * data ) {
3798 KMP_ASSERT( ( __kmp_next_wait & 1 ) == 0 );
3799 wait = __kmp_next_wait / 2;
3800 __kmp_stg_parse_int( name, value, KMP_MIN_NEXT_WAIT, KMP_MAX_NEXT_WAIT, & wait );
3801 __kmp_next_wait = wait * 2;
3802 KMP_ASSERT( ( __kmp_next_wait & 1 ) == 0 );
3803 __kmp_yield_next = __kmp_next_wait;
3807 __kmp_stg_print_next_wait( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3808 __kmp_stg_print_int( buffer, name, __kmp_next_wait );
3817 __kmp_stg_parse_gtid_mode(
char const * name,
char const * value,
void * data ) {
3828 #ifdef KMP_TDATA_GTID 3831 __kmp_stg_parse_int( name, value, 0, max, & mode );
3835 __kmp_adjust_gtid_mode = TRUE;
3838 __kmp_gtid_mode = mode;
3839 __kmp_adjust_gtid_mode = FALSE;
3844 __kmp_stg_print_gtid_mode( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3845 if ( __kmp_adjust_gtid_mode ) {
3846 __kmp_stg_print_int( buffer, name, 0 );
3849 __kmp_stg_print_int( buffer, name, __kmp_gtid_mode );
3859 __kmp_stg_parse_lock_block(
char const * name,
char const * value,
void * data ) {
3860 __kmp_stg_parse_int( name, value, 0, KMP_INT_MAX, & __kmp_num_locks_in_block );
3864 __kmp_stg_print_lock_block( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3865 __kmp_stg_print_int( buffer, name, __kmp_num_locks_in_block );
3873 __kmp_stg_parse_lock_kind(
char const * name,
char const * value,
void * data ) {
3874 if ( __kmp_init_user_locks ) {
3875 KMP_WARNING( EnvLockWarn, name );
3879 if ( __kmp_str_match(
"tas", 2, value )
3880 || __kmp_str_match(
"test and set", 2, value )
3881 || __kmp_str_match(
"test_and_set", 2, value )
3882 || __kmp_str_match(
"test-and-set", 2, value )
3883 || __kmp_str_match(
"test andset", 2, value )
3884 || __kmp_str_match(
"test_andset", 2, value )
3885 || __kmp_str_match(
"test-andset", 2, value )
3886 || __kmp_str_match(
"testand set", 2, value )
3887 || __kmp_str_match(
"testand_set", 2, value )
3888 || __kmp_str_match(
"testand-set", 2, value )
3889 || __kmp_str_match(
"testandset", 2, value ) ) {
3890 __kmp_user_lock_kind = lk_tas;
3891 DYNA_STORE_LOCK_SEQ(tas);
3893 #if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM) 3894 else if ( __kmp_str_match(
"futex", 1, value ) ) {
3895 if ( __kmp_futex_determine_capable() ) {
3896 __kmp_user_lock_kind = lk_futex;
3897 DYNA_STORE_LOCK_SEQ(futex);
3900 KMP_WARNING( FutexNotSupported, name, value );
3904 else if ( __kmp_str_match(
"ticket", 2, value ) ) {
3905 __kmp_user_lock_kind = lk_ticket;
3906 DYNA_STORE_LOCK_SEQ(ticket);
3908 else if ( __kmp_str_match(
"queuing", 1, value )
3909 || __kmp_str_match(
"queue", 1, value ) ) {
3910 __kmp_user_lock_kind = lk_queuing;
3911 DYNA_STORE_LOCK_SEQ(queuing);
3913 else if ( __kmp_str_match(
"drdpa ticket", 1, value )
3914 || __kmp_str_match(
"drdpa_ticket", 1, value )
3915 || __kmp_str_match(
"drdpa-ticket", 1, value )
3916 || __kmp_str_match(
"drdpaticket", 1, value )
3917 || __kmp_str_match(
"drdpa", 1, value ) ) {
3918 __kmp_user_lock_kind = lk_drdpa;
3919 DYNA_STORE_LOCK_SEQ(drdpa);
3921 #if KMP_USE_ADAPTIVE_LOCKS 3922 else if ( __kmp_str_match(
"adaptive", 1, value ) ) {
3923 if( __kmp_cpuinfo.rtm ) {
3924 __kmp_user_lock_kind = lk_adaptive;
3925 DYNA_STORE_LOCK_SEQ(adaptive);
3927 KMP_WARNING( AdaptiveNotSupported, name, value );
3928 __kmp_user_lock_kind = lk_queuing;
3929 DYNA_STORE_LOCK_SEQ(queuing);
3932 #endif // KMP_USE_ADAPTIVE_LOCKS 3933 #if KMP_USE_DYNAMIC_LOCK 3934 else if ( __kmp_str_match(
"hle", 1, value) ) {
3935 DYNA_STORE_LOCK_SEQ(hle);
3939 KMP_WARNING( StgInvalidValue, name, value );
3944 __kmp_stg_print_lock_kind( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
3945 const char *value = NULL;
3947 switch ( __kmp_user_lock_kind ) {
3956 #if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64) 3973 #if KMP_USE_ADAPTIVE_LOCKS 3980 if ( value != NULL ) {
3981 __kmp_stg_print_str( buffer, name, value );
3985 #if KMP_USE_ADAPTIVE_LOCKS 3994 __kmp_stg_parse_adaptive_lock_props(
const char *name,
const char *value,
void *data )
3996 int max_retries = 0;
3997 int max_badness = 0;
3999 const char *next = value;
4002 int prev_comma = FALSE;
4007 for ( i = 0; i < 3 ; i++) {
4010 if ( *next ==
'\0' ) {
4014 if ( ( ( *next < '0' || *next >
'9' ) && *next !=
',' ) || total > 2 ) {
4015 KMP_WARNING( EnvSyntaxError, name, value );
4019 if ( *next ==
',' ) {
4021 if ( total == 0 || prev_comma ) {
4029 if ( *next >=
'0' && *next <=
'9' ) {
4031 const char *buf = next;
4032 char const * msg = NULL;
4034 SKIP_DIGITS( next );
4037 const char *tmp = next;
4039 if ( ( *next ==
' ' || *next ==
'\t' ) && ( *tmp >=
'0' && *tmp <=
'9' ) ) {
4040 KMP_WARNING( EnvSpacesNotAllowed, name, value );
4044 num = __kmp_str_to_int( buf, *next );
4046 msg = KMP_I18N_STR( ValueTooSmall );
4048 }
else if ( num > KMP_INT_MAX ) {
4049 msg = KMP_I18N_STR( ValueTooLarge );
4052 if ( msg != NULL ) {
4054 KMP_WARNING( ParseSizeIntWarn, name, value, msg );
4055 KMP_INFORM( Using_int_Value, name, num );
4059 }
else if( total == 2 ) {
4064 KMP_DEBUG_ASSERT( total > 0 );
4066 KMP_WARNING( EnvSyntaxError, name, value );
4069 if( max_retries != 0 ) {
4070 __kmp_adaptive_backoff_params.max_soft_retries = max_retries;
4072 if( max_badness != 0 ) {
4073 __kmp_adaptive_backoff_params.max_badness = max_badness;
4079 __kmp_stg_print_adaptive_lock_props(kmp_str_buf_t * buffer,
char const * name,
void * data )
4081 if( __kmp_env_format ) {
4082 KMP_STR_BUF_PRINT_NAME_EX(name);
4084 __kmp_str_buf_print( buffer,
" %s='", name );
4086 __kmp_str_buf_print( buffer,
"%d,%d'\n", __kmp_adaptive_backoff_params.max_soft_retries,
4087 __kmp_adaptive_backoff_params.max_badness );
4090 #if KMP_DEBUG_ADAPTIVE_LOCKS 4093 __kmp_stg_parse_speculative_statsfile(
char const * name,
char const * value,
void * data ) {
4094 __kmp_stg_parse_file( name, value,
"", & __kmp_speculative_statsfile );
4098 __kmp_stg_print_speculative_statsfile( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
4099 if ( __kmp_str_match(
"-", 0, __kmp_speculative_statsfile ) ) {
4100 __kmp_stg_print_str( buffer, name,
"stdout" );
4102 __kmp_stg_print_str( buffer, name, __kmp_speculative_statsfile );
4107 #endif // KMP_DEBUG_ADAPTIVE_LOCKS 4109 #endif // KMP_USE_ADAPTIVE_LOCKS 4116 __kmp_stg_parse_place_threads(
char const * name,
char const * value,
void * data ) {
4122 const char *next = value;
4126 if ( *next ==
'\0' ) {
4131 if ( *next >=
'0' && *next <=
'9' ) {
4133 SKIP_DIGITS( next );
4134 num = __kmp_str_to_int( prev, *next );
4136 if ( *next ==
'C' || *next ==
'c' ) {
4137 __kmp_place_num_cores = num;
4139 }
else if ( *next ==
',' || *next ==
'x' ) {
4140 __kmp_place_num_cores = num;
4143 }
else if ( *next ==
'T' || *next ==
't' ) {
4144 __kmp_place_num_threads_per_core = num;
4146 }
else if ( *next ==
'\0' ) {
4147 __kmp_place_num_cores = num;
4150 KMP_WARNING( AffThrPlaceInvalid, name, value );
4153 }
else if ( *next ==
',' || *next ==
'x' ) {
4158 KMP_WARNING( AffThrPlaceInvalid, name, value );
4162 if ( *next ==
'\0' ) {
4165 if ( ( *next ==
',' || *next ==
'x' ) && !prev_delim ) {
4172 if ( *next >=
'0' && *next <=
'9' ) {
4175 SKIP_DIGITS( next );
4176 num = __kmp_str_to_int( prev, *next );
4178 if ( *next ==
'T' || *next ==
't' ) {
4179 __kmp_place_num_threads_per_core = num;
4181 }
else if ( *next ==
',' || *next ==
'x' ) {
4182 __kmp_place_num_threads_per_core = num;
4185 }
else if ( *next ==
'O' || *next ==
'o' ) {
4186 __kmp_place_core_offset = num;
4188 }
else if ( *next ==
'\0' ) {
4189 __kmp_place_num_threads_per_core = num;
4192 KMP_WARNING( AffThrPlaceInvalid, name, value );
4195 }
else if ( *next ==
',' || *next ==
'x' ) {
4196 if ( prev_delim == 2 ) {
4199 KMP_DEBUG_ASSERT( prev_delim == 1 );
4202 KMP_WARNING( AffThrPlaceInvalid, name, value );
4206 if ( *next ==
'\0' ) {
4209 if ( ( *next ==
',' || *next ==
'x' ) && !prev_delim ) {
4217 if ( *next >=
'0' && *next <=
'9' ) {
4219 SKIP_DIGITS( next );
4220 num = __kmp_str_to_int( prev, *next );
4221 __kmp_place_core_offset = num;
4226 __kmp_stg_print_place_threads( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
4227 if ( __kmp_place_num_cores + __kmp_place_num_threads_per_core ) {
4229 __kmp_str_buf_init( &buf );
4230 if( __kmp_env_format ) {
4231 KMP_STR_BUF_PRINT_NAME_EX(name);
4233 __kmp_str_buf_print( buffer,
" %s='", name );
4235 __kmp_str_buf_print( &buf,
"%dC", __kmp_place_num_cores );
4236 __kmp_str_buf_print( &buf,
"x%dT", __kmp_place_num_threads_per_core );
4237 if ( __kmp_place_core_offset ) {
4238 __kmp_str_buf_print( &buf,
",%dO", __kmp_place_core_offset );
4240 __kmp_str_buf_print(buffer,
"%s'\n", buf.str );
4241 __kmp_str_buf_free(&buf);
4255 __kmp_stg_parse_forkjoin_frames(
char const * name,
char const * value,
void * data ) {
4256 __kmp_stg_parse_bool( name, value, & __kmp_forkjoin_frames );
4260 __kmp_stg_print_forkjoin_frames( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
4261 __kmp_stg_print_bool( buffer, name, __kmp_forkjoin_frames );
4269 __kmp_stg_parse_forkjoin_frames_mode(
char const * name,
char const * value,
void * data ) {
4270 __kmp_stg_parse_int( name, value, 0, 3, & __kmp_forkjoin_frames_mode );
4274 __kmp_stg_print_forkjoin_frames_mode( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
4275 __kmp_stg_print_int( buffer, name, __kmp_forkjoin_frames_mode );
4286 __kmp_stg_parse_omp_display_env(
char const * name,
char const * value,
void * data )
4288 if ( __kmp_str_match(
"VERBOSE", 1, value ) )
4290 __kmp_display_env_verbose = TRUE;
4292 __kmp_stg_parse_bool( name, value, & __kmp_display_env );
4298 __kmp_stg_print_omp_display_env( kmp_str_buf_t * buffer,
char const * name,
void * data )
4300 if ( __kmp_display_env_verbose )
4302 __kmp_stg_print_str( buffer, name,
"VERBOSE" );
4304 __kmp_stg_print_bool( buffer, name, __kmp_display_env );
4309 __kmp_stg_parse_omp_cancellation(
char const * name,
char const * value,
void * data ) {
4310 if ( TCR_4(__kmp_init_parallel) ) {
4311 KMP_WARNING( EnvParallelWarn, name );
4314 __kmp_stg_parse_bool( name, value, & __kmp_omp_cancellation );
4318 __kmp_stg_print_omp_cancellation( kmp_str_buf_t * buffer,
char const * name,
void * data ) {
4319 __kmp_stg_print_bool( buffer, name, __kmp_omp_cancellation );
4329 static kmp_setting_t __kmp_stg_table[] = {
4331 {
"KMP_ALL_THREADS", __kmp_stg_parse_all_threads, __kmp_stg_print_all_threads, NULL, 0, 0 },
4332 {
"KMP_BLOCKTIME", __kmp_stg_parse_blocktime, __kmp_stg_print_blocktime, NULL, 0, 0 },
4333 {
"KMP_DUPLICATE_LIB_OK", __kmp_stg_parse_duplicate_lib_ok, __kmp_stg_print_duplicate_lib_ok, NULL, 0, 0 },
4334 {
"KMP_LIBRARY", __kmp_stg_parse_wait_policy, __kmp_stg_print_wait_policy, NULL, 0, 0 },
4335 {
"KMP_MAX_THREADS", __kmp_stg_parse_all_threads, NULL, NULL, 0, 0 },
4336 {
"KMP_MONITOR_STACKSIZE", __kmp_stg_parse_monitor_stacksize, __kmp_stg_print_monitor_stacksize, NULL, 0, 0 },
4337 {
"KMP_SETTINGS", __kmp_stg_parse_settings, __kmp_stg_print_settings, NULL, 0, 0 },
4338 {
"KMP_STACKOFFSET", __kmp_stg_parse_stackoffset, __kmp_stg_print_stackoffset, NULL, 0, 0 },
4339 {
"KMP_STACKSIZE", __kmp_stg_parse_stacksize, __kmp_stg_print_stacksize, NULL, 0, 0 },
4340 {
"KMP_STACKPAD", __kmp_stg_parse_stackpad, __kmp_stg_print_stackpad, NULL, 0, 0 },
4341 {
"KMP_VERSION", __kmp_stg_parse_version, __kmp_stg_print_version, NULL, 0, 0 },
4342 {
"KMP_WARNINGS", __kmp_stg_parse_warnings, __kmp_stg_print_warnings, NULL, 0, 0 },
4344 {
"OMP_NESTED", __kmp_stg_parse_nested, __kmp_stg_print_nested, NULL, 0, 0 },
4345 {
"OMP_NUM_THREADS", __kmp_stg_parse_num_threads, __kmp_stg_print_num_threads, NULL, 0, 0 },
4346 {
"OMP_STACKSIZE", __kmp_stg_parse_stacksize, __kmp_stg_print_stacksize, NULL, 0, 0 },
4348 {
"KMP_TASKING", __kmp_stg_parse_tasking, __kmp_stg_print_tasking, NULL, 0, 0 },
4349 {
"KMP_TASK_STEALING_CONSTRAINT", __kmp_stg_parse_task_stealing, __kmp_stg_print_task_stealing, NULL, 0, 0 },
4350 {
"OMP_MAX_ACTIVE_LEVELS", __kmp_stg_parse_max_active_levels, __kmp_stg_print_max_active_levels, NULL, 0, 0 },
4351 {
"OMP_THREAD_LIMIT", __kmp_stg_parse_all_threads, __kmp_stg_print_all_threads, NULL, 0, 0 },
4352 {
"OMP_WAIT_POLICY", __kmp_stg_parse_wait_policy, __kmp_stg_print_wait_policy, NULL, 0, 0 },
4353 #if KMP_NESTED_HOT_TEAMS 4354 {
"KMP_HOT_TEAMS_MAX_LEVEL", __kmp_stg_parse_hot_teams_level, __kmp_stg_print_hot_teams_level, NULL, 0, 0 },
4355 {
"KMP_HOT_TEAMS_MODE", __kmp_stg_parse_hot_teams_mode, __kmp_stg_print_hot_teams_mode, NULL, 0, 0 },
4356 #endif // KMP_NESTED_HOT_TEAMS 4358 #if KMP_HANDLE_SIGNALS 4359 {
"KMP_HANDLE_SIGNALS", __kmp_stg_parse_handle_signals, __kmp_stg_print_handle_signals, NULL, 0, 0 },
4362 #if KMP_ARCH_X86 || KMP_ARCH_X86_64 4363 {
"KMP_INHERIT_FP_CONTROL", __kmp_stg_parse_inherit_fp_control, __kmp_stg_print_inherit_fp_control, NULL, 0, 0 },
4366 #ifdef KMP_GOMP_COMPAT 4367 {
"GOMP_STACKSIZE", __kmp_stg_parse_stacksize, NULL, NULL, 0, 0 },
4371 {
"KMP_A_DEBUG", __kmp_stg_parse_a_debug, __kmp_stg_print_a_debug, NULL, 0, 0 },
4372 {
"KMP_B_DEBUG", __kmp_stg_parse_b_debug, __kmp_stg_print_b_debug, NULL, 0, 0 },
4373 {
"KMP_C_DEBUG", __kmp_stg_parse_c_debug, __kmp_stg_print_c_debug, NULL, 0, 0 },
4374 {
"KMP_D_DEBUG", __kmp_stg_parse_d_debug, __kmp_stg_print_d_debug, NULL, 0, 0 },
4375 {
"KMP_E_DEBUG", __kmp_stg_parse_e_debug, __kmp_stg_print_e_debug, NULL, 0, 0 },
4376 {
"KMP_F_DEBUG", __kmp_stg_parse_f_debug, __kmp_stg_print_f_debug, NULL, 0, 0 },
4377 {
"KMP_DEBUG", __kmp_stg_parse_debug, NULL, NULL, 0, 0 },
4378 {
"KMP_DEBUG_BUF", __kmp_stg_parse_debug_buf, __kmp_stg_print_debug_buf, NULL, 0, 0 },
4379 {
"KMP_DEBUG_BUF_ATOMIC", __kmp_stg_parse_debug_buf_atomic, __kmp_stg_print_debug_buf_atomic, NULL, 0, 0 },
4380 {
"KMP_DEBUG_BUF_CHARS", __kmp_stg_parse_debug_buf_chars, __kmp_stg_print_debug_buf_chars, NULL, 0, 0 },
4381 {
"KMP_DEBUG_BUF_LINES", __kmp_stg_parse_debug_buf_lines, __kmp_stg_print_debug_buf_lines, NULL, 0, 0 },
4382 {
"KMP_DIAG", __kmp_stg_parse_diag, __kmp_stg_print_diag, NULL, 0, 0 },
4384 {
"KMP_PAR_RANGE", __kmp_stg_parse_par_range_env, __kmp_stg_print_par_range_env, NULL, 0, 0 },
4385 {
"KMP_YIELD_CYCLE", __kmp_stg_parse_yield_cycle, __kmp_stg_print_yield_cycle, NULL, 0, 0 },
4386 {
"KMP_YIELD_ON", __kmp_stg_parse_yield_on, __kmp_stg_print_yield_on, NULL, 0, 0 },
4387 {
"KMP_YIELD_OFF", __kmp_stg_parse_yield_off, __kmp_stg_print_yield_off, NULL, 0, 0 },
4390 {
"KMP_ALIGN_ALLOC", __kmp_stg_parse_align_alloc, __kmp_stg_print_align_alloc, NULL, 0, 0 },
4392 {
"KMP_PLAIN_BARRIER", __kmp_stg_parse_barrier_branch_bit, __kmp_stg_print_barrier_branch_bit, NULL, 0, 0 },
4393 {
"KMP_PLAIN_BARRIER_PATTERN", __kmp_stg_parse_barrier_pattern, __kmp_stg_print_barrier_pattern, NULL, 0, 0 },
4394 {
"KMP_FORKJOIN_BARRIER", __kmp_stg_parse_barrier_branch_bit, __kmp_stg_print_barrier_branch_bit, NULL, 0, 0 },
4395 {
"KMP_FORKJOIN_BARRIER_PATTERN", __kmp_stg_parse_barrier_pattern, __kmp_stg_print_barrier_pattern, NULL, 0, 0 },
4396 #if KMP_FAST_REDUCTION_BARRIER 4397 {
"KMP_REDUCTION_BARRIER", __kmp_stg_parse_barrier_branch_bit, __kmp_stg_print_barrier_branch_bit, NULL, 0, 0 },
4398 {
"KMP_REDUCTION_BARRIER_PATTERN", __kmp_stg_parse_barrier_pattern, __kmp_stg_print_barrier_pattern, NULL, 0, 0 },
4401 {
"KMP_ABORT_DELAY", __kmp_stg_parse_abort_delay, __kmp_stg_print_abort_delay, NULL, 0, 0 },
4402 {
"KMP_CPUINFO_FILE", __kmp_stg_parse_cpuinfo_file, __kmp_stg_print_cpuinfo_file, NULL, 0, 0 },
4403 {
"KMP_FORCE_REDUCTION", __kmp_stg_parse_force_reduction, __kmp_stg_print_force_reduction, NULL, 0, 0 },
4404 {
"KMP_DETERMINISTIC_REDUCTION", __kmp_stg_parse_force_reduction, __kmp_stg_print_force_reduction, NULL, 0, 0 },
4405 {
"KMP_STORAGE_MAP", __kmp_stg_parse_storage_map, __kmp_stg_print_storage_map, NULL, 0, 0 },
4406 {
"KMP_ALL_THREADPRIVATE", __kmp_stg_parse_all_threadprivate, __kmp_stg_print_all_threadprivate, NULL, 0, 0 },
4407 {
"KMP_FOREIGN_THREADS_THREADPRIVATE", __kmp_stg_parse_foreign_threads_threadprivate, __kmp_stg_print_foreign_threads_threadprivate, NULL, 0, 0 },
4409 #if KMP_AFFINITY_SUPPORTED 4410 {
"KMP_AFFINITY", __kmp_stg_parse_affinity, __kmp_stg_print_affinity, NULL, 0, 0 },
4411 # ifdef KMP_GOMP_COMPAT 4412 {
"GOMP_CPU_AFFINITY", __kmp_stg_parse_gomp_cpu_affinity, NULL, NULL, 0, 0 },
4415 {
"OMP_PROC_BIND", __kmp_stg_parse_proc_bind, __kmp_stg_print_proc_bind, NULL, 0, 0 },
4416 {
"OMP_PLACES", __kmp_stg_parse_places, __kmp_stg_print_places, NULL, 0, 0 },
4418 {
"OMP_PROC_BIND", __kmp_stg_parse_proc_bind, NULL, NULL, 0, 0 },
4421 {
"KMP_TOPOLOGY_METHOD", __kmp_stg_parse_topology_method, __kmp_stg_print_topology_method, NULL, 0, 0 },
4430 {
"OMP_PROC_BIND", __kmp_stg_parse_proc_bind, __kmp_stg_print_proc_bind, NULL, 0, 0 },
4433 #endif // KMP_AFFINITY_SUPPORTED 4435 {
"KMP_INIT_AT_FORK", __kmp_stg_parse_init_at_fork, __kmp_stg_print_init_at_fork, NULL, 0, 0 },
4436 {
"KMP_SCHEDULE", __kmp_stg_parse_schedule, __kmp_stg_print_schedule, NULL, 0, 0 },
4437 {
"OMP_SCHEDULE", __kmp_stg_parse_omp_schedule, __kmp_stg_print_omp_schedule, NULL, 0, 0 },
4438 {
"KMP_ATOMIC_MODE", __kmp_stg_parse_atomic_mode, __kmp_stg_print_atomic_mode, NULL, 0, 0 },
4439 {
"KMP_CONSISTENCY_CHECK", __kmp_stg_parse_consistency_check, __kmp_stg_print_consistency_check, NULL, 0, 0 },
4441 #if USE_ITT_BUILD && USE_ITT_NOTIFY 4442 {
"KMP_ITT_PREPARE_DELAY", __kmp_stg_parse_itt_prepare_delay, __kmp_stg_print_itt_prepare_delay, NULL, 0, 0 },
4444 {
"KMP_MALLOC_POOL_INCR", __kmp_stg_parse_malloc_pool_incr, __kmp_stg_print_malloc_pool_incr, NULL, 0, 0 },
4445 {
"KMP_INIT_WAIT", __kmp_stg_parse_init_wait, __kmp_stg_print_init_wait, NULL, 0, 0 },
4446 {
"KMP_NEXT_WAIT", __kmp_stg_parse_next_wait, __kmp_stg_print_next_wait, NULL, 0, 0 },
4447 {
"KMP_GTID_MODE", __kmp_stg_parse_gtid_mode, __kmp_stg_print_gtid_mode, NULL, 0, 0 },
4448 {
"OMP_DYNAMIC", __kmp_stg_parse_omp_dynamic, __kmp_stg_print_omp_dynamic, NULL, 0, 0 },
4449 {
"KMP_DYNAMIC_MODE", __kmp_stg_parse_kmp_dynamic_mode, __kmp_stg_print_kmp_dynamic_mode, NULL, 0, 0 },
4451 #ifdef USE_LOAD_BALANCE 4452 {
"KMP_LOAD_BALANCE_INTERVAL", __kmp_stg_parse_ld_balance_interval,__kmp_stg_print_ld_balance_interval,NULL, 0, 0 },
4457 {
"KMP_NUM_LOCKS_IN_BLOCK", __kmp_stg_parse_lock_block, __kmp_stg_print_lock_block, NULL, 0, 0 },
4458 {
"KMP_LOCK_KIND", __kmp_stg_parse_lock_kind, __kmp_stg_print_lock_kind, NULL, 0, 0 },
4459 #if KMP_USE_ADAPTIVE_LOCKS 4460 {
"KMP_ADAPTIVE_LOCK_PROPS", __kmp_stg_parse_adaptive_lock_props,__kmp_stg_print_adaptive_lock_props, NULL, 0, 0 },
4461 #if KMP_DEBUG_ADAPTIVE_LOCKS 4462 {
"KMP_SPECULATIVE_STATSFILE", __kmp_stg_parse_speculative_statsfile,__kmp_stg_print_speculative_statsfile, NULL, 0, 0 },
4464 #endif // KMP_USE_ADAPTIVE_LOCKS 4465 {
"KMP_PLACE_THREADS", __kmp_stg_parse_place_threads, __kmp_stg_print_place_threads, NULL, 0, 0 },
4467 {
"KMP_FORKJOIN_FRAMES", __kmp_stg_parse_forkjoin_frames, __kmp_stg_print_forkjoin_frames, NULL, 0, 0 },
4468 {
"KMP_FORKJOIN_FRAMES_MODE", __kmp_stg_parse_forkjoin_frames_mode,__kmp_stg_print_forkjoin_frames_mode, NULL, 0, 0 },
4472 {
"OMP_DISPLAY_ENV", __kmp_stg_parse_omp_display_env, __kmp_stg_print_omp_display_env, NULL, 0, 0 },
4473 {
"OMP_CANCELLATION", __kmp_stg_parse_omp_cancellation, __kmp_stg_print_omp_cancellation, NULL, 0, 0 },
4475 {
"", NULL, NULL, NULL, 0, 0 }
4478 static int const __kmp_stg_count =
sizeof( __kmp_stg_table ) /
sizeof( kmp_setting_t );
4482 __kmp_stg_find(
char const * name ) {
4485 if ( name != NULL ) {
4486 for ( i = 0; i < __kmp_stg_count; ++ i ) {
4487 if ( strcmp( __kmp_stg_table[ i ].name, name ) == 0 ) {
4488 return & __kmp_stg_table[ i ];
4498 __kmp_stg_cmp(
void const * _a,
void const * _b ) {
4499 kmp_setting_t * a = (kmp_setting_t *) _a;
4500 kmp_setting_t * b = (kmp_setting_t *) _b;
4506 if ( strcmp( a->name,
"KMP_AFFINITY" ) == 0 ) {
4507 if ( strcmp( b->name,
"KMP_AFFINITY" ) == 0 ) {
4512 else if ( strcmp( b->name,
"KMP_AFFINITY" ) == 0 ) {
4515 return strcmp( a->name, b->name );
4520 __kmp_stg_init(
void 4523 static int initialized = 0;
4525 if ( ! initialized ) {
4528 qsort( __kmp_stg_table, __kmp_stg_count - 1,
sizeof( kmp_setting_t ), __kmp_stg_cmp );
4532 kmp_setting_t * kmp_stacksize = __kmp_stg_find(
"KMP_STACKSIZE" );
4533 #ifdef KMP_GOMP_COMPAT 4534 kmp_setting_t * gomp_stacksize = __kmp_stg_find(
"GOMP_STACKSIZE" );
4536 kmp_setting_t * omp_stacksize = __kmp_stg_find(
"OMP_STACKSIZE" );
4541 static kmp_setting_t *
volatile rivals[ 4 ];
4542 static kmp_stg_ss_data_t kmp_data = { 1, (kmp_setting_t **)rivals };
4543 #ifdef KMP_GOMP_COMPAT 4544 static kmp_stg_ss_data_t gomp_data = { 1024, (kmp_setting_t **)rivals };
4546 static kmp_stg_ss_data_t omp_data = { 1024, (kmp_setting_t **)rivals };
4549 rivals[ i ++ ] = kmp_stacksize;
4550 #ifdef KMP_GOMP_COMPAT 4551 if ( gomp_stacksize != NULL ) {
4552 rivals[ i ++ ] = gomp_stacksize;
4555 rivals[ i ++ ] = omp_stacksize;
4556 rivals[ i ++ ] = NULL;
4558 kmp_stacksize->data = & kmp_data;
4559 #ifdef KMP_GOMP_COMPAT 4560 if ( gomp_stacksize != NULL ) {
4561 gomp_stacksize->data = & gomp_data;
4564 omp_stacksize->data = & omp_data;
4570 kmp_setting_t * kmp_library = __kmp_stg_find(
"KMP_LIBRARY" );
4571 kmp_setting_t * omp_wait_policy = __kmp_stg_find(
"OMP_WAIT_POLICY" );
4574 static kmp_setting_t *
volatile rivals[ 3 ];
4575 static kmp_stg_wp_data_t kmp_data = { 0, (kmp_setting_t **)rivals };
4576 static kmp_stg_wp_data_t omp_data = { 1, (kmp_setting_t **)rivals };
4579 rivals[ i ++ ] = kmp_library;
4580 if ( omp_wait_policy != NULL ) {
4581 rivals[ i ++ ] = omp_wait_policy;
4583 rivals[ i ++ ] = NULL;
4585 kmp_library->data = & kmp_data;
4586 if ( omp_wait_policy != NULL ) {
4587 omp_wait_policy->data = & omp_data;
4594 kmp_setting_t * kmp_all_threads = __kmp_stg_find(
"KMP_ALL_THREADS" );
4595 kmp_setting_t * kmp_max_threads = __kmp_stg_find(
"KMP_MAX_THREADS" );
4596 kmp_setting_t * omp_thread_limit = __kmp_stg_find(
"OMP_THREAD_LIMIT" );
4599 static kmp_setting_t *
volatile rivals[ 4 ];
4602 rivals[ i ++ ] = kmp_all_threads;
4603 rivals[ i ++ ] = kmp_max_threads;
4604 if ( omp_thread_limit != NULL ) {
4605 rivals[ i ++ ] = omp_thread_limit;
4607 rivals[ i ++ ] = NULL;
4609 kmp_all_threads->data = (
void*)& rivals;
4610 kmp_max_threads->data = (
void*)& rivals;
4611 if ( omp_thread_limit != NULL ) {
4612 omp_thread_limit->data = (
void*)& rivals;
4617 #if KMP_AFFINITY_SUPPORTED 4620 kmp_setting_t * kmp_affinity = __kmp_stg_find(
"KMP_AFFINITY" );
4621 KMP_DEBUG_ASSERT( kmp_affinity != NULL );
4623 # ifdef KMP_GOMP_COMPAT 4624 kmp_setting_t * gomp_cpu_affinity = __kmp_stg_find(
"GOMP_CPU_AFFINITY" );
4625 KMP_DEBUG_ASSERT( gomp_cpu_affinity != NULL );
4628 kmp_setting_t * omp_proc_bind = __kmp_stg_find(
"OMP_PROC_BIND" );
4629 KMP_DEBUG_ASSERT( omp_proc_bind != NULL );
4632 static kmp_setting_t *
volatile rivals[ 4 ];
4635 rivals[ i ++ ] = kmp_affinity;
4637 # ifdef KMP_GOMP_COMPAT 4638 rivals[ i ++ ] = gomp_cpu_affinity;
4639 gomp_cpu_affinity->data = (
void*)& rivals;
4642 rivals[ i ++ ] = omp_proc_bind;
4643 omp_proc_bind->data = (
void*)& rivals;
4644 rivals[ i ++ ] = NULL;
4647 static kmp_setting_t *
volatile places_rivals[ 4 ];
4650 kmp_setting_t * omp_places = __kmp_stg_find(
"OMP_PLACES" );
4651 KMP_DEBUG_ASSERT( omp_places != NULL );
4653 places_rivals[ i ++ ] = kmp_affinity;
4654 # ifdef KMP_GOMP_COMPAT 4655 places_rivals[ i ++ ] = gomp_cpu_affinity;
4657 places_rivals[ i ++ ] = omp_places;
4658 omp_places->data = (
void*)& places_rivals;
4659 places_rivals[ i ++ ] = NULL;
4665 #endif // KMP_AFFINITY_SUPPORTED 4669 kmp_setting_t * kmp_force_red = __kmp_stg_find(
"KMP_FORCE_REDUCTION" );
4670 kmp_setting_t * kmp_determ_red = __kmp_stg_find(
"KMP_DETERMINISTIC_REDUCTION" );
4673 static kmp_setting_t *
volatile rivals[ 3 ];
4674 static kmp_stg_fr_data_t force_data = { 1, (kmp_setting_t **)rivals };
4675 static kmp_stg_fr_data_t determ_data = { 0, (kmp_setting_t **)rivals };
4678 rivals[ i ++ ] = kmp_force_red;
4679 if ( kmp_determ_red != NULL ) {
4680 rivals[ i ++ ] = kmp_determ_red;
4682 rivals[ i ++ ] = NULL;
4684 kmp_force_red->data = & force_data;
4685 if ( kmp_determ_red != NULL ) {
4686 kmp_determ_red->data = & determ_data;
4696 for ( i = 0; i < __kmp_stg_count; ++ i ) {
4697 __kmp_stg_table[ i ].set = 0;
4711 if ( name[ 0 ] == 0 ) {
4715 if ( value != NULL ) {
4716 kmp_setting_t * setting = __kmp_stg_find( name );
4717 if ( setting != NULL ) {
4718 setting->parse( name, value, setting->data );
4719 setting->defined = 1;
4727 __kmp_stg_check_rivals(
4730 kmp_setting_t * * rivals
4733 if ( rivals == NULL ) {
4739 for ( ; strcmp( rivals[ i ]->name, name ) != 0; i++ ) {
4740 KMP_DEBUG_ASSERT( rivals[ i ] != NULL );
4742 #if KMP_AFFINITY_SUPPORTED 4743 if ( rivals[ i ] == __kmp_affinity_notype ) {
4752 if ( rivals[ i ]->
set ) {
4753 KMP_WARNING( StgIgnored, name, rivals[ i ]->name );
4765 __kmp_env_toPrint(
char const * name,
int flag ) {
4767 kmp_setting_t * setting = __kmp_stg_find( name );
4768 if ( setting != NULL ) {
4769 rc = setting->defined;
4771 setting->defined = flag;
4779 __kmp_aux_env_initialize( kmp_env_blk_t* block ) {
4784 value = __kmp_env_blk_var( block,
"OMP_NUM_THREADS" );
4786 ompc_set_num_threads( __kmp_dflt_team_nth );
4790 value = __kmp_env_blk_var( block,
"KMP_BLOCKTIME" );
4792 kmpc_set_blocktime( __kmp_dflt_blocktime );
4796 value = __kmp_env_blk_var( block,
"OMP_NESTED" );
4798 ompc_set_nested( __kmp_dflt_nested );
4802 value = __kmp_env_blk_var( block,
"OMP_DYNAMIC" );
4804 ompc_set_dynamic( __kmp_global.g.g_dynamic );
4810 __kmp_env_initialize(
char const *
string ) {
4812 kmp_env_blk_t block;
4818 if (
string == NULL ) {
4820 __kmp_threads_capacity = __kmp_initial_threads_capacity( __kmp_dflt_team_nth_ub );
4822 __kmp_env_blk_init( & block,
string );
4827 for ( i = 0; i < block.count; ++ i ) {
4828 if (( block.vars[ i ].name == NULL )
4829 || ( *block.vars[ i ].name ==
'\0')) {
4832 if ( block.vars[ i ].value == NULL ) {
4835 kmp_setting_t * setting = __kmp_stg_find( block.vars[ i ].name );
4836 if ( setting != NULL ) {
4842 if (
string == NULL ) {
4843 char const * name =
"KMP_WARNINGS";
4844 char const * value = __kmp_env_blk_var( & block, name );
4845 __kmp_stg_parse( name, value );
4848 #if KMP_AFFINITY_SUPPORTED 4856 __kmp_affinity_notype = NULL;
4857 char const *aff_str = __kmp_env_blk_var( & block,
"KMP_AFFINITY" );
4858 if ( aff_str != NULL ) {
4872 # define FIND strstr 4874 # define FIND strcasestr 4877 if ( ( FIND( aff_str,
"none" ) == NULL )
4878 && ( FIND( aff_str,
"physical" ) == NULL )
4879 && ( FIND( aff_str,
"logical" ) == NULL )
4880 && ( FIND( aff_str,
"compact" ) == NULL )
4881 && ( FIND( aff_str,
"scatter" ) == NULL )
4882 && ( FIND( aff_str,
"explicit" ) == NULL )
4883 && ( FIND( aff_str,
"balanced" ) == NULL )
4884 && ( FIND( aff_str,
"disabled" ) == NULL ) ) {
4885 __kmp_affinity_notype = __kmp_stg_find(
"KMP_AFFINITY" );
4893 __kmp_affinity_type = affinity_default;
4894 __kmp_affinity_gran = affinity_gran_default;
4895 __kmp_affinity_top_method = affinity_top_method_default;
4896 __kmp_affinity_respect_mask = affinity_respect_mask_default;
4904 aff_str = __kmp_env_blk_var( & block,
"OMP_PROC_BIND" );
4905 if ( aff_str != NULL ) {
4906 __kmp_affinity_type = affinity_default;
4907 __kmp_affinity_gran = affinity_gran_default;
4908 __kmp_affinity_top_method = affinity_top_method_default;
4909 __kmp_affinity_respect_mask = affinity_respect_mask_default;
4920 if ( __kmp_nested_proc_bind.bind_types == NULL ) {
4921 __kmp_nested_proc_bind.bind_types = (kmp_proc_bind_t *)
4922 KMP_INTERNAL_MALLOC(
sizeof(kmp_proc_bind_t) );
4923 if ( __kmp_nested_proc_bind.bind_types == NULL ) {
4924 KMP_FATAL( MemoryAllocFailed );
4926 __kmp_nested_proc_bind.size = 1;
4927 __kmp_nested_proc_bind.used = 1;
4928 # if KMP_AFFINITY_SUPPORTED 4929 __kmp_nested_proc_bind.bind_types[0] = proc_bind_default;
4932 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
4941 for ( i = 0; i < block.count; ++ i ) {
4942 __kmp_stg_parse( block.vars[ i ].name, block.vars[ i ].value );
4948 if ( ! __kmp_init_user_locks ) {
4949 if ( __kmp_user_lock_kind == lk_default ) {
4950 __kmp_user_lock_kind = lk_queuing;
4952 #if KMP_USE_DYNAMIC_LOCK 4953 __kmp_init_dynamic_user_locks();
4955 __kmp_set_user_lock_vptrs( __kmp_user_lock_kind );
4959 KMP_DEBUG_ASSERT(
string != NULL);
4960 KMP_DEBUG_ASSERT( __kmp_user_lock_kind != lk_default );
4965 #if KMP_USE_DYNAMIC_LOCK 4966 __kmp_init_dynamic_user_locks();
4968 __kmp_set_user_lock_vptrs( __kmp_user_lock_kind );
4972 #if KMP_AFFINITY_SUPPORTED 4974 if ( ! TCR_4(__kmp_init_middle) ) {
4979 const char *var =
"KMP_AFFINITY";
4980 if ( __kmp_affinity_type == affinity_disabled ) {
4981 KMP_AFFINITY_DISABLE();
4983 else if ( ! KMP_AFFINITY_CAPABLE() ) {
4984 __kmp_affinity_determine_capable( var );
4985 if ( ! KMP_AFFINITY_CAPABLE() ) {
4986 if ( __kmp_affinity_verbose || ( __kmp_affinity_warnings
4987 && ( __kmp_affinity_type != affinity_default )
4988 && ( __kmp_affinity_type != affinity_none )
4989 && ( __kmp_affinity_type != affinity_disabled ) ) ) {
4990 KMP_WARNING( AffNotSupported, var );
4992 __kmp_affinity_type = affinity_disabled;
4993 __kmp_affinity_respect_mask = 0;
4994 __kmp_affinity_gran = affinity_gran_fine;
4999 if ( __kmp_affinity_type == affinity_disabled ) {
5000 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
5002 else if ( __kmp_nested_proc_bind.bind_types[0] == proc_bind_true ) {
5006 __kmp_nested_proc_bind.bind_types[0] = proc_bind_spread;
5010 if ( KMP_AFFINITY_CAPABLE() ) {
5012 # if KMP_GROUP_AFFINITY 5019 if ( ( ( __kmp_num_proc_groups > 1 )
5020 && ( __kmp_affinity_type == affinity_default )
5022 && ( __kmp_nested_proc_bind.bind_types[0] == proc_bind_default ) )
5024 || ( __kmp_affinity_top_method == affinity_top_method_group ) ) {
5025 if ( __kmp_affinity_respect_mask == affinity_respect_mask_default ) {
5026 __kmp_affinity_respect_mask = FALSE;
5028 if ( __kmp_affinity_type == affinity_default ) {
5029 __kmp_affinity_type = affinity_compact;
5031 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
5034 if ( __kmp_affinity_top_method == affinity_top_method_default ) {
5035 if ( __kmp_affinity_gran == affinity_gran_default ) {
5036 __kmp_affinity_top_method = affinity_top_method_group;
5037 __kmp_affinity_gran = affinity_gran_group;
5039 else if ( __kmp_affinity_gran == affinity_gran_group ) {
5040 __kmp_affinity_top_method = affinity_top_method_group;
5043 __kmp_affinity_top_method = affinity_top_method_all;
5046 else if ( __kmp_affinity_top_method == affinity_top_method_group ) {
5047 if ( __kmp_affinity_gran == affinity_gran_default ) {
5048 __kmp_affinity_gran = affinity_gran_group;
5050 else if ( ( __kmp_affinity_gran != affinity_gran_group )
5051 && ( __kmp_affinity_gran != affinity_gran_fine )
5052 && ( __kmp_affinity_gran != affinity_gran_thread ) ) {
5054 switch ( __kmp_affinity_gran ) {
5055 case affinity_gran_core: str =
"core";
break;
5056 case affinity_gran_package: str =
"package";
break;
5057 case affinity_gran_node: str =
"node";
break;
5058 default: KMP_DEBUG_ASSERT( 0 );
5060 KMP_WARNING( AffGranTopGroup, var, str );
5061 __kmp_affinity_gran = affinity_gran_fine;
5065 if ( __kmp_affinity_gran == affinity_gran_default ) {
5066 __kmp_affinity_gran = affinity_gran_core;
5068 else if ( __kmp_affinity_gran == affinity_gran_group ) {
5070 switch ( __kmp_affinity_type ) {
5071 case affinity_physical: str =
"physical";
break;
5072 case affinity_logical: str =
"logical";
break;
5073 case affinity_compact: str =
"compact";
break;
5074 case affinity_scatter: str =
"scatter";
break;
5075 case affinity_explicit: str =
"explicit";
break;
5077 default: KMP_DEBUG_ASSERT( 0 );
5079 KMP_WARNING( AffGranGroupType, var, str );
5080 __kmp_affinity_gran = affinity_gran_core;
5089 if ( __kmp_affinity_respect_mask == affinity_respect_mask_default ) {
5090 # if KMP_GROUP_AFFINITY 5091 if ( __kmp_num_proc_groups > 1 ) {
5092 __kmp_affinity_respect_mask = FALSE;
5097 __kmp_affinity_respect_mask = TRUE;
5101 if ( ( __kmp_nested_proc_bind.bind_types[0] != proc_bind_intel )
5102 && ( __kmp_nested_proc_bind.bind_types[0] != proc_bind_default ) ) {
5103 if ( __kmp_affinity_type == affinity_default ) {
5104 __kmp_affinity_type = affinity_compact;
5105 __kmp_affinity_dups = FALSE;
5110 if ( __kmp_affinity_type == affinity_default ) {
5112 #if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS) 5113 if( __kmp_mic_type != non_mic ) {
5114 __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
5118 __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
5121 #if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS) 5122 if( __kmp_mic_type != non_mic ) {
5123 __kmp_affinity_type = affinity_scatter;
5127 __kmp_affinity_type = affinity_none;
5131 if ( ( __kmp_affinity_gran == affinity_gran_default )
5132 && ( __kmp_affinity_gran_levels < 0 ) ) {
5133 #if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS) 5134 if( __kmp_mic_type != non_mic ) {
5135 __kmp_affinity_gran = affinity_gran_fine;
5139 __kmp_affinity_gran = affinity_gran_core;
5142 if ( __kmp_affinity_top_method == affinity_top_method_default ) {
5143 __kmp_affinity_top_method = affinity_top_method_all;
5148 K_DIAG( 1, (
"__kmp_affinity_type == %d\n", __kmp_affinity_type ) );
5149 K_DIAG( 1, (
"__kmp_affinity_compact == %d\n", __kmp_affinity_compact ) );
5150 K_DIAG( 1, (
"__kmp_affinity_offset == %d\n", __kmp_affinity_offset ) );
5151 K_DIAG( 1, (
"__kmp_affinity_verbose == %d\n", __kmp_affinity_verbose ) );
5152 K_DIAG( 1, (
"__kmp_affinity_warnings == %d\n", __kmp_affinity_warnings ) );
5153 K_DIAG( 1, (
"__kmp_affinity_respect_mask == %d\n", __kmp_affinity_respect_mask ) );
5154 K_DIAG( 1, (
"__kmp_affinity_gran == %d\n", __kmp_affinity_gran ) );
5156 KMP_DEBUG_ASSERT( __kmp_affinity_type != affinity_default);
5158 KMP_DEBUG_ASSERT( __kmp_nested_proc_bind.bind_types[0] != proc_bind_default );
5164 if ( __kmp_version ) {
5165 __kmp_print_version_1();
5169 if (
string != NULL) {
5170 __kmp_aux_env_initialize( &block );
5173 __kmp_env_blk_free( & block );
5183 kmp_env_blk_t block;
5185 kmp_str_buf_t buffer;
5188 __kmp_str_buf_init( & buffer );
5190 __kmp_env_blk_init( & block, NULL );
5191 __kmp_env_blk_sort( & block );
5194 __kmp_str_buf_print( & buffer,
"\n%s\n\n", KMP_I18N_STR( UserSettings ) );
5195 for ( i = 0; i < block.count; ++ i ) {
5196 char const * name = block.vars[ i ].name;
5197 char const * value = block.vars[ i ].value;
5199 ( KMP_STRLEN( name ) > 4 && strncmp( name,
"KMP_", 4 ) == 0 )
5200 || strncmp( name,
"OMP_", 4 ) == 0
5201 #ifdef KMP_GOMP_COMPAT
5202 || strncmp( name,
"GOMP_", 5 ) == 0
5205 __kmp_str_buf_print( & buffer,
" %s=%s\n", name, value );
5208 __kmp_str_buf_print( & buffer,
"\n" );
5211 __kmp_str_buf_print( & buffer,
"%s\n\n", KMP_I18N_STR( EffectiveSettings ) );
5212 for (
int i = 0; i < __kmp_stg_count; ++ i ) {
5213 if ( __kmp_stg_table[ i ].print != NULL ) {
5214 __kmp_stg_table[ i ].print( & buffer, __kmp_stg_table[ i ].name, __kmp_stg_table[ i ].data );
5218 __kmp_printf(
"%s", buffer.str );
5220 __kmp_env_blk_free( & block );
5221 __kmp_str_buf_free( & buffer );
5230 __kmp_env_print_2() {
5232 kmp_env_blk_t block;
5233 kmp_str_buf_t buffer;
5235 __kmp_env_format = 1;
5238 __kmp_str_buf_init( & buffer );
5240 __kmp_env_blk_init( & block, NULL );
5241 __kmp_env_blk_sort( & block );
5243 __kmp_str_buf_print( & buffer,
"\n%s\n", KMP_I18N_STR( DisplayEnvBegin ) );
5244 __kmp_str_buf_print( & buffer,
" _OPENMP='%d'\n", __kmp_openmp_version );
5246 for (
int i = 0; i < __kmp_stg_count; ++ i ) {
5247 if ( __kmp_stg_table[ i ].print != NULL &&
5248 ( ( __kmp_display_env && strncmp( __kmp_stg_table[ i ].name,
"OMP_", 4 ) == 0 ) || __kmp_display_env_verbose ) ) {
5249 __kmp_stg_table[ i ].print( & buffer, __kmp_stg_table[ i ].name, __kmp_stg_table[ i ].data );
5253 __kmp_str_buf_print( & buffer,
"%s\n", KMP_I18N_STR( DisplayEnvEnd ) );
5254 __kmp_str_buf_print( & buffer,
"\n" );
5256 __kmp_printf(
"%s", buffer.str );
5258 __kmp_env_blk_free( & block );
5259 __kmp_str_buf_free( & buffer );
5264 #endif // OMP_40_ENABLED