#include "kmp.h"
#include "kmp_i18n.h"
#include "kmp_io.h"
#include <ntstatus.h>
#include <ntsecapi.h>
Go to the source code of this file.
#define __kmp_static_delay | ( | arg | ) |
Definition at line 187 of file z_Windows_NT_util.c.
#define CHECK | ( | cond | ) |
{ \ KMP_DEBUG_ASSERT( cond ); \ if ( ! ( cond ) ) { \ running_threads = -1; \ goto finish; \ } \ }
Referenced by __kmp_get_load_balance().
typedef NTSTATUS(NTAPI * NtQuerySystemInformation_t)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG) |
Definition at line 157 of file z_Windows_NT_util.c.
Definition at line 138 of file z_Windows_NT_util.c.
Definition at line 63 of file z_Windows_NT_util.c.
enum THREAD_STATE |
StateInitialized | |
StateReady | |
StateRunning | |
StateStandby | |
StateTerminated | |
StateWait | |
StateTransition | |
StateUnknown |
Definition at line 72 of file z_Windows_NT_util.c.
void __kmp_affinity_bind_thread | ( | int | proc | ) |
Definition at line 765 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, __kmp_set_system_affinity(), KMP_DEBUG_ASSERT, KMP_ERR, kmp_ms_warning, KMP_MSG, and TRUE.
void __kmp_affinity_determine_capable | ( | const char * | env_var | ) |
Definition at line 808 of file z_Windows_NT_util.c.
References KA_TRACE.
Referenced by __kmp_env_initialize().
void __kmp_change_thread_affinity_mask | ( | int | gtid, | |
kmp_affin_mask_t * | new_mask, | |||
kmp_affin_mask_t * | old_mask | |||
) |
Definition at line 1198 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, __kmp_threads, KMP_DEBUG_ASSERT, KMP_ERR, KMP_INFORM, kmp_ms_fatal, and KMP_MSG.
void __kmp_clear_system_time | ( | void | ) |
Definition at line 1122 of file z_Windows_NT_util.c.
References status.
void __kmp_create_monitor | ( | kmp_info_t * | th | ) |
Definition at line 1490 of file z_Windows_NT_util.c.
References __kmp_get_gtid, __kmp_global, __kmp_launch_monitor(), __kmp_monitor_stksize, __kmp_msg(), __kmp_msg_null, __kmp_sys_min_stksize, FALSE, KA_TRACE, KMP_DEFAULT_MONITOR_STKSIZE, KMP_ERR, KMP_GTID_MONITOR, KMP_MB, kmp_ms_fatal, KMP_MSG, TCW_4, and TRUE.
Referenced by __kmp_allocate_thread().
void __kmp_create_worker | ( | int | gtid, | |
kmp_info_t * | th, | |||
size_t | stack_size | |||
) |
Definition at line 1390 of file z_Windows_NT_util.c.
References __kmp_check_stack_overlap(), __kmp_gtid_mode, __kmp_launch_worker(), __kmp_msg(), __kmp_msg_null, __kmp_stkoffset, FALSE, KA_TRACE, KMP_ASSERT, KMP_ERR, KMP_MB, kmp_ms_fatal, KMP_MSG, KMP_UBER_GTID, KMP_UINTPTR_SPEC, TCR_4, TCW_4, TCW_PTR, and TRUE.
Referenced by __kmp_allocate_thread(), and __kmp_register_root().
void __kmp_disable | ( | int * | old_state | ) |
Definition at line 354 of file z_Windows_NT_util.c.
void __kmp_elapsed | ( | double * | t | ) |
Definition at line 1157 of file z_Windows_NT_util.c.
References status.
Referenced by __kmp_get_load_balance(), and FTN_GET_WTIME().
void __kmp_elapsed_tick | ( | double * | t | ) |
Definition at line 1168 of file z_Windows_NT_util.c.
Referenced by FTN_GET_WTICK().
void __kmp_enable | ( | int | new_state | ) |
Definition at line 347 of file z_Windows_NT_util.c.
void __kmp_exit_thread | ( | int | exit_status | ) |
Definition at line 1578 of file z_Windows_NT_util.c.
void __kmp_free_handle | ( | kmp_thread_t | tHandle | ) |
Definition at line 1852 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, KMP_ERR, kmp_ms_fatal, and KMP_MSG.
Referenced by __kmp_reap_common(), __kmp_reap_monitor(), __kmp_reset_root(), __kmp_terminate_thread(), and __kmp_win32_cond_destroy().
int __kmp_get_load_balance | ( | int | max | ) |
Definition at line 1869 of file z_Windows_NT_util.c.
References __kmp_elapsed(), CHECK, KMP_INTERNAL_FREE, KMP_INTERNAL_REALLOC, SYSTEM_PROCESS_INFORMATION::NextEntryOffset, NtQuerySystemInformation, SYSTEM_PROCESS_INFORMATION::NumberOfThreads, SYSTEM_PROCESS_INFORMATION::ProcessId, SYSTEM_THREAD::State, StateRunning, status, SystemProcessInformation, and SYSTEM_PROCESS_INFORMATION::Threads.
int __kmp_get_system_affinity | ( | kmp_affin_mask_t * | mask, | |
int | abort_on_error | |||
) |
Definition at line 685 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, KMP_DEBUG_ASSERT, KMP_ERR, kmp_ms_fatal, and KMP_MSG.
int __kmp_gtid_get_specific | ( | void | ) |
Definition at line 574 of file z_Windows_NT_util.c.
References __kmp_gtid_threadprivate_key, KA_TRACE, KMP_GTID_DNE, and KMP_GTID_SHUTDOWN.
Referenced by __kmp_get_global_thread_id(), __kmp_get_global_thread_id_reg(), __kmp_initialize_root(), __kmp_internal_end_library(), __kmp_internal_end_thread(), __kmp_register_root(), __ompt_thread_assign_wait_id(), and ompt_get_thread().
void __kmp_gtid_set_specific | ( | int | gtid | ) |
Definition at line 564 of file z_Windows_NT_util.c.
References __kmp_gtid_threadprivate_key, KA_TRACE, KMP_ASSERT, and KMP_FATAL.
Referenced by __kmp_internal_end_dest(), __kmp_launch_monitor(), __kmp_launch_worker(), __kmp_register_root(), and __kmp_unregister_root_current_thread().
kmp_uint64 __kmp_hardware_timestamp | ( | void | ) |
Definition at line 1842 of file z_Windows_NT_util.c.
void __kmp_initialize_system_tick | ( | void | ) |
Definition at line 1131 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, KMP_ERR, kmp_ms_fatal, KMP_MSG, and status.
Referenced by __kmp_register_library_startup(), and __kmp_runtime_initialize().
int __kmp_is_address_mapped | ( | void * | addr | ) |
Definition at line 1827 of file z_Windows_NT_util.c.
References status.
Referenced by __kmp_register_library_startup().
int __kmp_is_thread_alive | ( | kmp_info_t * | th, | |
DWORD * | exit_val | |||
) |
Definition at line 1560 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, KMP_ERR, kmp_ms_fatal, and KMP_MSG.
Referenced by __kmp_reap_common().
void* __stdcall __kmp_launch_monitor | ( | void * | arg | ) |
Definition at line 1285 of file z_Windows_NT_util.c.
References __kmp_cleanup(), __kmp_global, __kmp_gtid_set_specific(), __kmp_init_monitor, __kmp_monitor_wakeups, __kmp_msg(), __kmp_msg_null, __kmp_terminate_thread(), __kmp_threads_capacity, FALSE, KA_TRACE, KMP_DEBUG_ASSERT, KMP_ERR, KMP_GTID_MONITOR, KMP_MB, kmp_ms_fatal, KMP_MSG, status, TCR_4, TCW_4, and TRUE.
Referenced by __kmp_create_monitor().
void* __stdcall __kmp_launch_worker | ( | void * | arg | ) |
Definition at line 1232 of file z_Windows_NT_util.c.
References __kmp_check_stack_overlap(), __kmp_gtid_mode, __kmp_gtid_set_specific(), __kmp_launch_thread(), __kmp_stkoffset, FALSE, KMP_ASSERT, KMP_MB, TCR_4, TCW_4, TCW_PTR, kmp_info::th, and TRUE.
Referenced by __kmp_create_worker().
double __kmp_read_cpu_time | ( | void | ) |
Definition at line 828 of file z_Windows_NT_util.c.
References NSEC_PER_SEC, and status.
int __kmp_read_system_info | ( | struct kmp_sys_info * | info | ) |
Definition at line 858 of file z_Windows_NT_util.c.
References kmp_sys_info::inblock, kmp_sys_info::majflt, kmp_sys_info::maxrss, kmp_sys_info::minflt, kmp_sys_info::nivcsw, kmp_sys_info::nswap, kmp_sys_info::nvcsw, and kmp_sys_info::oublock.
void __kmp_read_system_time | ( | double * | delta | ) |
Definition at line 1174 of file z_Windows_NT_util.c.
References status.
Referenced by __kmp_register_library_startup().
static void __kmp_reap_common | ( | kmp_info_t * | th | ) | [static] |
Definition at line 1588 of file z_Windows_NT_util.c.
References __kmp_avail_proc, __kmp_free_handle(), __kmp_is_thread_alive(), __kmp_nth, __kmp_static_delay, KA_TRACE, KMP_GTID_DNE, KMP_INIT_YIELD, KMP_MB, KMP_UINTPTR_SPEC, KMP_YIELD, KMP_YIELD_SPIN, TCR_4, and TRUE.
Referenced by __kmp_reap_monitor(), and __kmp_reap_worker().
void __kmp_reap_monitor | ( | kmp_info_t * | th | ) |
Definition at line 1654 of file z_Windows_NT_util.c.
References __kmp_free_handle(), __kmp_msg(), __kmp_msg_null, __kmp_reap_common(), FALSE, KA_TRACE, KMP_DEBUG_ASSERT, KMP_ERR, KMP_GTID_MONITOR, KMP_MB, kmp_ms_fatal, KMP_MSG, and status.
Referenced by __kmp_internal_end().
void __kmp_reap_worker | ( | kmp_info_t * | th | ) |
Definition at line 1690 of file z_Windows_NT_util.c.
References __kmp_reap_common(), and KA_TRACE.
Referenced by __kmp_reap_thread().
void __kmp_resume | ( | int | target_gtid, | |
volatile kmp_uint * | spin | |||
) |
Definition at line 497 of file z_Windows_NT_util.c.
References __kmp_get_gtid, __kmp_init_gtid, __kmp_suspend_initialize_thread(), __kmp_test_then_and32(), __kmp_threads, __kmp_win32_cond_signal(), __kmp_win32_mutex_lock(), __kmp_win32_mutex_unlock(), KF_TRACE, KMP_BARRIER_SLEEP_STATE, status, TCR_4, TCR_PTR, and TCW_PTR.
Referenced by __kmp_release().
void __kmp_runtime_destroy | ( | void | ) |
Definition at line 1069 of file z_Windows_NT_util.c.
References __kmp_gtid_threadprivate_key, FALSE, and KA_TRACE.
Referenced by __kmp_cleanup().
void __kmp_runtime_initialize | ( | void | ) |
Definition at line 877 of file z_Windows_NT_util.c.
References __kmp_cpu_frequency, __kmp_cpuinfo, __kmp_gtid_threadprivate_key, __kmp_initialize_system_tick(), __kmp_str_buf_free(), __kmp_str_buf_init, __kmp_str_buf_print(), __kmp_str_buf_reserve(), __kmp_tls_gtid_min, __kmp_xproc, kmp_cpuinfo::initialized, KA_TRACE, KMP_DEBUG_ASSERT, KMP_FATAL, KMP_TLS_GTID_MIN, kmp_str_buf::size, kmp_str_buf::str, TRUE, and kmp_str_buf::used.
Referenced by __kmp_do_serial_initialize().
int __kmp_set_system_affinity | ( | kmp_affin_mask_t const * | mask, | |
int | abort_on_error | |||
) |
Definition at line 623 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, KMP_DEBUG_ASSERT, KMP_ERR, KMP_FATAL, kmp_ms_fatal, and KMP_MSG.
Referenced by __kmp_affinity_bind_thread(), and __kmp_allocate_team().
static void __kmp_static_yield | ( | int | arg | ) | [static] |
Definition at line 192 of file z_Windows_NT_util.c.
References __kmp_yield().
int __kmp_still_running | ( | kmp_info_t * | th | ) |
Definition at line 1485 of file z_Windows_NT_util.c.
Definition at line 398 of file z_Windows_NT_util.c.
References __kmp_suspend_initialize_thread(), __kmp_test_then_and32(), __kmp_test_then_or32(), __kmp_thread_pool_active_nth, __kmp_threads, __kmp_win32_cond_wait(), __kmp_win32_mutex_lock(), __kmp_win32_mutex_unlock(), FALSE, KF_TRACE, KMP_BARRIER_SLEEP_STATE, KMP_DEBUG_ASSERT, KMP_TEST_THEN_DEC32, KMP_TEST_THEN_INC32, status, TCR_4, TCW_PTR, and TRUE.
Referenced by __kmp_wait_sleep().
void __kmp_suspend_initialize | ( | void | ) |
Definition at line 363 of file z_Windows_NT_util.c.
Referenced by __kmp_parallel_initialize().
static void __kmp_suspend_initialize_thread | ( | kmp_info_t * | th | ) | [static] |
Definition at line 369 of file z_Windows_NT_util.c.
References __kmp_win32_cond_init(), __kmp_win32_mutex_init(), TCR_4, TCW_4, and TRUE.
Referenced by __kmp_resume(), and __kmp_suspend().
void __kmp_suspend_uninitialize_thread | ( | kmp_info_t * | th | ) |
Definition at line 381 of file z_Windows_NT_util.c.
References __kmp_win32_cond_destroy(), __kmp_win32_mutex_destroy(), FALSE, TCR_4, and TCW_4.
Referenced by __kmp_reap_thread().
void __kmp_terminate_thread | ( | int | gtid | ) |
Definition at line 1104 of file z_Windows_NT_util.c.
References __kmp_free_handle(), __kmp_threads, FALSE, and KA_TRACE.
Referenced by __kmp_launch_monitor().
void __kmp_thread_sleep | ( | int | millis | ) |
Definition at line 1809 of file z_Windows_NT_util.c.
References __kmp_msg(), __kmp_msg_null, FALSE, KMP_ERR, kmp_ms_fatal, KMP_MSG, and status.
Referenced by __kmp_msg().
void __kmp_win32_cond_broadcast | ( | kmp_win32_cond_t * | cv | ) |
Definition at line 320 of file z_Windows_NT_util.c.
References __kmp_win32_mutex_lock(), and __kmp_win32_mutex_unlock().
Referenced by __kmp_win32_cond_signal().
void __kmp_win32_cond_destroy | ( | kmp_win32_cond_t * | cv | ) |
Definition at line 252 of file z_Windows_NT_util.c.
References __kmp_free_handle(), and __kmp_win32_mutex_destroy().
Referenced by __kmp_suspend_uninitialize_thread().
void __kmp_win32_cond_init | ( | kmp_win32_cond_t * | cv | ) |
Definition at line 235 of file z_Windows_NT_util.c.
References __kmp_win32_mutex_init(), FALSE, and TRUE.
Referenced by __kmp_suspend_initialize_thread().
void __kmp_win32_cond_signal | ( | kmp_win32_cond_t * | cv | ) |
Definition at line 338 of file z_Windows_NT_util.c.
References __kmp_win32_cond_broadcast().
Referenced by __kmp_resume().
void __kmp_win32_cond_wait | ( | kmp_win32_cond_t * | cv, | |
kmp_win32_mutex_t * | mx, | |||
kmp_info_t * | th, | |||
int | need_decrease_load | |||
) |
Definition at line 263 of file z_Windows_NT_util.c.
References __kmp_win32_mutex_lock(), and __kmp_win32_mutex_unlock().
Referenced by __kmp_suspend().
void __kmp_win32_mutex_destroy | ( | kmp_win32_mutex_t * | mx | ) |
Definition at line 217 of file z_Windows_NT_util.c.
Referenced by __kmp_suspend_uninitialize_thread(), and __kmp_win32_cond_destroy().
void __kmp_win32_mutex_init | ( | kmp_win32_mutex_t * | mx | ) |
Definition at line 211 of file z_Windows_NT_util.c.
Referenced by __kmp_suspend_initialize_thread(), and __kmp_win32_cond_init().
void __kmp_win32_mutex_lock | ( | kmp_win32_mutex_t * | mx | ) |
Definition at line 223 of file z_Windows_NT_util.c.
Referenced by __kmp_resume(), __kmp_suspend(), __kmp_win32_cond_broadcast(), and __kmp_win32_cond_wait().
void __kmp_win32_mutex_unlock | ( | kmp_win32_mutex_t * | mx | ) |
Definition at line 229 of file z_Windows_NT_util.c.
Referenced by __kmp_resume(), __kmp_suspend(), __kmp_win32_cond_broadcast(), and __kmp_win32_cond_wait().
void __kmp_yield | ( | int | cond | ) |
Definition at line 554 of file z_Windows_NT_util.c.
Referenced by __kmp_static_yield(), and __kmp_terminate_thread().
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, Threads) | = =256 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, IOCounters) | = =208 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, VMCounters) | = =112 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, HandleCount) | = =96 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, ProcessId) | = =80 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, ImageName) | = =56 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, CreateTime) | = =32 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_PROCESS_INFORMATION, NextEntryOffset) | = =0 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_THREAD, State) | = =68 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_THREAD, StartAddress) | = =32 |
) |
KMP_BUILD_ASSERT | ( | offsetof(SYSTEM_THREAD, KernelTime) | = =0 |
) |
int __kmp_init_runtime = FALSE |
Definition at line 207 of file z_Windows_NT_util.c.
HANDLE __kmp_monitor_ev [static] |
Definition at line 203 of file z_Windows_NT_util.c.
CRITICAL_SECTION __kmp_win32_section |
Definition at line 208 of file z_Windows_NT_util.c.
double __kmp_win32_tick |
Definition at line 205 of file z_Windows_NT_util.c.
kmp_int64 __kmp_win32_time [static] |
Definition at line 204 of file z_Windows_NT_util.c.
HMODULE ntdll = NULL |
Definition at line 160 of file z_Windows_NT_util.c.
Definition at line 158 of file z_Windows_NT_util.c.
Referenced by __kmp_get_load_balance().