Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions openmp/runtime/src/kmp_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ void __kmp_vprintf(enum kmp_io out_stream, char const *format, va_list ap) {
int chars = 0;

#ifdef KMP_DEBUG_PIDS
chars = KMP_SNPRINTF(db, __kmp_debug_buf_chars,
"pid=%d: ", (kmp_int32)getpid());
chars = KMP_SNPRINTF(db, __kmp_debug_buf_chars, "pid=%" KMP_INT32_SPEC ": ",
(kmp_int32)getpid());
#endif
chars += KMP_VSNPRINTF(db, __kmp_debug_buf_chars, format, ap);

Expand Down Expand Up @@ -167,15 +167,16 @@ void __kmp_vprintf(enum kmp_io out_stream, char const *format, va_list ap) {
#if KMP_OS_WINDOWS
DWORD count;
#ifdef KMP_DEBUG_PIDS
__kmp_str_buf_print(&__kmp_console_buf, "pid=%d: ", (kmp_int32)getpid());
__kmp_str_buf_print(&__kmp_console_buf, "pid=%" KMP_INT32_SPEC ": ",
(kmp_int32)getpid());
#endif
__kmp_str_buf_vprint(&__kmp_console_buf, format, ap);
WriteFile(stream, __kmp_console_buf.str, __kmp_console_buf.used, &count,
NULL);
__kmp_str_buf_clear(&__kmp_console_buf);
#else
#ifdef KMP_DEBUG_PIDS
fprintf(stream, "pid=%d: ", (kmp_int32)getpid());
fprintf(stream, "pid=%" KMP_INT32_SPEC ": ", (kmp_int32)getpid());
#endif
vfprintf(stream, format, ap);
fflush(stream);
Expand Down
2 changes: 1 addition & 1 deletion openmp/runtime/src/kmp_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3952,7 +3952,7 @@ void __kmp_cleanup_user_locks(void) {

#define IS_CRITICAL(lck) \
((__kmp_get_user_lock_flags_ != NULL) && \
((*__kmp_get_user_lock_flags_)(lck)&kmp_lf_critical_section))
((*__kmp_get_user_lock_flags_)(lck) & kmp_lf_critical_section))

// Loop through lock table, free all locks.
// Do not free item [0], it is reserved for lock tables list.
Expand Down
60 changes: 30 additions & 30 deletions openmp/runtime/src/kmp_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,7 @@ static void __kmp_fini_allocator() { __kmp_fini_memkind(); }
/* ------------------------------------------------------------------------ */

#if ENABLE_LIBOMPTARGET
static void __kmp_init_omptarget() {
__kmp_init_target_task();
}
static void __kmp_init_omptarget() { __kmp_init_target_task(); }
#endif

/* ------------------------------------------------------------------------ */
Expand Down Expand Up @@ -1539,7 +1537,7 @@ __kmp_fork_in_teams(ident_t *loc, int gtid, kmp_team_t *parent_team,
,
exit_frame_p
#endif
);
);
}

#if OMPT_SUPPORT
Expand Down Expand Up @@ -1735,7 +1733,7 @@ __kmp_serial_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context,
if (!ap) {
// revert change made in __kmpc_serialized_parallel()
master_th->th.th_serial_team->t.t_level--;
// Get args from parent team for teams construct
// Get args from parent team for teams construct

#if OMPT_SUPPORT
void *dummy;
Expand Down Expand Up @@ -1774,7 +1772,7 @@ __kmp_serial_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context,
,
exit_frame_p
#endif
);
);
}

#if OMPT_SUPPORT
Expand Down Expand Up @@ -1873,7 +1871,7 @@ __kmp_serial_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context,
,
exit_frame_p
#endif
);
);
}

#if OMPT_SUPPORT
Expand Down Expand Up @@ -3302,29 +3300,29 @@ static kmp_internal_control_t __kmp_get_global_icvs(void) {
KMP_DEBUG_ASSERT(__kmp_nested_proc_bind.used > 0);

kmp_internal_control_t g_icvs = {
0, // int serial_nesting_level; //corresponds to value of th_team_serialized
(kmp_int8)__kmp_global.g.g_dynamic, // internal control for dynamic
// adjustment of threads (per thread)
(kmp_int8)__kmp_env_blocktime, // int bt_set; //internal control for
// whether blocktime is explicitly set
__kmp_dflt_blocktime, // int blocktime; //internal control for blocktime
0, // int serial_nesting_level; //corresponds to value of
// th_team_serialized
(kmp_int8)__kmp_global.g.g_dynamic, // internal control for dynamic
// adjustment of threads (per thread)
(kmp_int8)__kmp_env_blocktime, // int bt_set; //internal control for
// whether blocktime is explicitly set
__kmp_dflt_blocktime, // int blocktime; //internal control for blocktime
#if KMP_USE_MONITOR
__kmp_bt_intervals, // int bt_intervals; //internal control for blocktime
__kmp_bt_intervals, // int bt_intervals; //internal control for blocktime
// intervals
#endif
__kmp_dflt_team_nth, // int nproc; //internal control for # of threads for
// next parallel region (per thread)
// (use a max ub on value if __kmp_parallel_initialize not called yet)
__kmp_cg_max_nth, // int thread_limit;
__kmp_task_max_nth, // int task_thread_limit; // to set the thread_limit
// on task. This is used in the case of target thread_limit
__kmp_dflt_max_active_levels, // int max_active_levels; //internal control
// for max_active_levels
r_sched, // kmp_r_sched_t sched; //internal control for runtime schedule
// {sched,chunk} pair
__kmp_nested_proc_bind.bind_types[0],
__kmp_default_device,
NULL // struct kmp_internal_control *next;
__kmp_dflt_team_nth, // int nproc; //internal control for # of threads for
// next parallel region (per thread)
// (use a max ub on value if __kmp_parallel_initialize not called yet)
__kmp_cg_max_nth, // int thread_limit;
__kmp_task_max_nth, // int task_thread_limit; // to set the thread_limit
// on task. This is used in the case of target thread_limit
__kmp_dflt_max_active_levels, // int max_active_levels; //internal control
// for max_active_levels
r_sched, // kmp_r_sched_t sched; //internal control for runtime schedule
// {sched,chunk} pair
__kmp_nested_proc_bind.bind_types[0], __kmp_default_device,
NULL // struct kmp_internal_control *next;
};

return g_icvs;
Expand Down Expand Up @@ -6726,10 +6724,12 @@ static inline char *__kmp_reg_status_name() {
env var can not be found, because the name will contain different pid. */
// macOS* complains about name being too long with additional getuid()
#if KMP_OS_UNIX && !KMP_OS_DARWIN && KMP_DYNAMIC_LIB
return __kmp_str_format("__KMP_REGISTERED_LIB_%d_%d", (int)getpid(),
(int)getuid());
return __kmp_str_format("__KMP_REGISTERED_LIB_%" KMP_UINT32_SPEC
"_%" KMP_UINT32_SPEC,
(kmp_uint32)getpid(), (kmp_uint32)getuid());
#else
return __kmp_str_format("__KMP_REGISTERED_LIB_%d", (int)getpid());
return __kmp_str_format("__KMP_REGISTERED_LIB_%" KMP_UINT32_SPEC,
(kmp_uint32)getpid());
#endif
} // __kmp_reg_status_get

Expand Down
6 changes: 4 additions & 2 deletions openmp/runtime/src/kmp_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,11 @@ void __kmp_expand_file_name(char *result, size_t rlen, char *pattern) {
case 'i': {
pid_t id = getpid();
#if (KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && defined(__MINGW32__)
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*lld", width, id);
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*" KMP_UINT64_SPEC,
width, (kmp_uint64)id);
#else
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*d", width, id);
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*" KMP_UINT32_SPEC,
width, (kmp_uint32)id);
#endif
if (snp_result >= 0 && snp_result <= end - pos) {
while (*pos)
Expand Down
3 changes: 2 additions & 1 deletion openmp/runtime/src/z_Linux_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,8 @@ int __kmp_is_address_mapped(void *addr) {
return 0;
}

char *name = __kmp_str_format("/proc/%d/map", pid);
char *name =
__kmp_str_format("/proc/%" KMP_INT32_SPEC "/map", (kmp_int32)pid);
size_t sz = (1 << 20);
file = open(name, O_RDONLY);
if (file == -1) {
Expand Down
Loading