z_Windows_NT_util.c File Reference

#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.

Data Structures

struct  CLIENT_ID
struct  SYSTEM_PROCESS_INFORMATION
struct  SYSTEM_THREAD
struct  VM_COUNTERS

Defines

#define __kmp_static_delay(arg)
#define CHECK(cond)

Typedefs

typedef NTSTATUS(NTAPI * NtQuerySystemInformation_t )(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG)
typedef
SYSTEM_PROCESS_INFORMATION
PSYSTEM_PROCESS_INFORMATION

Enumerations

enum  SYSTEM_INFORMATION_CLASS { SystemProcessInformation = 5 }
enum  THREAD_STATE {
  StateInitialized, StateReady, StateRunning, StateStandby,
  StateTerminated, StateWait, StateTransition, StateUnknown
}

Functions

void __kmp_affinity_bind_thread (int proc)
void __kmp_affinity_determine_capable (const char *env_var)
void __kmp_change_thread_affinity_mask (int gtid, kmp_affin_mask_t *new_mask, kmp_affin_mask_t *old_mask)
void __kmp_clear_system_time (void)
void __kmp_create_monitor (kmp_info_t *th)
void __kmp_create_worker (int gtid, kmp_info_t *th, size_t stack_size)
void __kmp_disable (int *old_state)
void __kmp_elapsed (double *t)
void __kmp_elapsed_tick (double *t)
void __kmp_enable (int new_state)
void __kmp_exit_thread (int exit_status)
void __kmp_free_handle (kmp_thread_t tHandle)
int __kmp_get_load_balance (int max)
int __kmp_get_system_affinity (kmp_affin_mask_t *mask, int abort_on_error)
int __kmp_gtid_get_specific ()
void __kmp_gtid_set_specific (int gtid)
kmp_uint64 __kmp_hardware_timestamp (void)
void __kmp_initialize_system_tick (void)
int __kmp_is_address_mapped (void *addr)
int __kmp_is_thread_alive (kmp_info_t *th, DWORD *exit_val)
void *__stdcall __kmp_launch_monitor (void *arg)
void *__stdcall __kmp_launch_worker (void *arg)
double __kmp_read_cpu_time (void)
int __kmp_read_system_info (struct kmp_sys_info *info)
void __kmp_read_system_time (double *delta)
static void __kmp_reap_common (kmp_info_t *th)
void __kmp_reap_monitor (kmp_info_t *th)
void __kmp_reap_worker (kmp_info_t *th)
void __kmp_resume (int target_gtid, volatile kmp_uint *spin)
void __kmp_runtime_destroy (void)
void __kmp_runtime_initialize (void)
int __kmp_set_system_affinity (kmp_affin_mask_t const *mask, int abort_on_error)
static void __kmp_static_yield (int arg)
int __kmp_still_running (kmp_info_t *th)
void __kmp_suspend (int th_gtid, volatile kmp_uint *spinner, kmp_uint checker)
void __kmp_suspend_initialize (void)
static void __kmp_suspend_initialize_thread (kmp_info_t *th)
void __kmp_suspend_uninitialize_thread (kmp_info_t *th)
void __kmp_terminate_thread (int gtid)
void __kmp_thread_sleep (int millis)
void __kmp_win32_cond_broadcast (kmp_win32_cond_t *cv)
void __kmp_win32_cond_destroy (kmp_win32_cond_t *cv)
void __kmp_win32_cond_init (kmp_win32_cond_t *cv)
void __kmp_win32_cond_signal (kmp_win32_cond_t *cv)
void __kmp_win32_cond_wait (kmp_win32_cond_t *cv, kmp_win32_mutex_t *mx, kmp_info_t *th, int need_decrease_load)
void __kmp_win32_mutex_destroy (kmp_win32_mutex_t *mx)
void __kmp_win32_mutex_init (kmp_win32_mutex_t *mx)
void __kmp_win32_mutex_lock (kmp_win32_mutex_t *mx)
void __kmp_win32_mutex_unlock (kmp_win32_mutex_t *mx)
void __kmp_yield (int cond)
 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)

Variables

int __kmp_init_runtime = FALSE
static HANDLE __kmp_monitor_ev
CRITICAL_SECTION __kmp_win32_section
double __kmp_win32_tick
static kmp_int64 __kmp_win32_time
HMODULE ntdll = NULL
NtQuerySystemInformation_t NtQuerySystemInformation = NULL

Define Documentation

#define __kmp_static_delay ( arg   ) 

Definition at line 187 of file z_Windows_NT_util.c.

#define CHECK ( cond   ) 
Value:
{                                       \
            KMP_DEBUG_ASSERT( cond );           \
            if ( ! ( cond ) ) {                 \
                running_threads = -1;           \
                goto finish;                    \
            }                                   \
        }

Referenced by __kmp_get_load_balance().


Typedef Documentation

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.


Enumeration Type Documentation

Enumerator:
SystemProcessInformation 

Definition at line 63 of file z_Windows_NT_util.c.

Enumerator:
StateInitialized 
StateReady 
StateRunning 
StateStandby 
StateTerminated 
StateWait 
StateTransition 
StateUnknown 

Definition at line 72 of file z_Windows_NT_util.c.


Function Documentation

void __kmp_affinity_bind_thread ( int  proc  ) 
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 
)
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  ) 
void __kmp_create_worker ( int  gtid,
kmp_info_t th,
size_t  stack_size 
)
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  ) 
int __kmp_get_load_balance ( int  max  ) 
int __kmp_get_system_affinity ( kmp_affin_mask_t *  mask,
int  abort_on_error 
)
int __kmp_gtid_get_specific ( void   ) 
void __kmp_gtid_set_specific ( int  gtid  ) 
kmp_uint64 __kmp_hardware_timestamp ( void   ) 

Definition at line 1842 of file z_Windows_NT_util.c.

void __kmp_initialize_system_tick ( void   ) 
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  ) 
void* __stdcall __kmp_launch_worker ( void *  arg  ) 
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  ) 
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]
void __kmp_reap_monitor ( kmp_info_t th  ) 
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 
)
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   ) 
int __kmp_set_system_affinity ( kmp_affin_mask_t const *  mask,
int  abort_on_error 
)
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.

void __kmp_suspend ( int  th_gtid,
volatile kmp_uint spinner,
kmp_uint  checker 
)
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  ) 
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  ) 
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  ) 
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  ) 
void __kmp_win32_mutex_unlock ( kmp_win32_mutex_t *  mx  ) 
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  ) 

Variable Documentation

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.

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().


Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1