Synchronization

Functions

void __kmpc_barrier (ident_t *loc, kmp_int32 global_tid)
kmp_int32 __kmpc_barrier_master (ident_t *loc, kmp_int32 global_tid)
kmp_int32 __kmpc_barrier_master_nowait (ident_t *loc, kmp_int32 global_tid)
void __kmpc_end_barrier_master (ident_t *loc, kmp_int32 global_tid)
void __kmpc_end_reduce (ident_t *loc, kmp_int32 global_tid, kmp_critical_name *lck)
void __kmpc_end_reduce_nowait (ident_t *loc, kmp_int32 global_tid, kmp_critical_name *lck)
void __kmpc_flush (ident_t *loc,...)
kmp_int32 __kmpc_reduce (ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars, size_t reduce_size, void *reduce_data, void(*reduce_func)(void *lhs_data, void *rhs_data), kmp_critical_name *lck)
kmp_int32 __kmpc_reduce_nowait (ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars, size_t reduce_size, void *reduce_data, void(*reduce_func)(void *lhs_data, void *rhs_data), kmp_critical_name *lck)

Detailed Description

These functions are used for implementing barriers.


Function Documentation

void __kmpc_barrier ( ident_t loc,
kmp_int32  global_tid 
)
Parameters:
loc source location information
global_tid thread id.

Execute a barrier.

Definition at line 809 of file kmp_csupport.c.

References __kmp_barrier(), __kmp_check_barrier(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), __kmp_threads, bs_plain_barrier, ct_barrier, FALSE, KC_TRACE, KMP_WARNING, and TCR_4.

Referenced by GOMP_barrier().

kmp_int32 __kmpc_barrier_master ( ident_t loc,
kmp_int32  global_tid 
)
Parameters:
loc source location information
global_tid thread id.
Returns:
one if the thread should execute the master block, zero otherwise

Start execution of a combined barrier and master. The barrier is executed inside this function.

Definition at line 1169 of file kmp_csupport.c.

References __kmp_barrier(), __kmp_check_barrier(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), bs_plain_barrier, ct_barrier, KC_TRACE, status, TCR_4, and TRUE.

kmp_int32 __kmpc_barrier_master_nowait ( ident_t loc,
kmp_int32  global_tid 
)
Parameters:
loc source location information
global_tid thread id.
Returns:
one if the thread should execute the master block, zero otherwise

Start execution of a combined barrier and master(nowait) construct. The barrier is executed inside this function. There is no equivalent "end" function, since the

Definition at line 1214 of file kmp_csupport.c.

References __kmp_barrier(), __kmp_check_barrier(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), __kmp_pop_sync(), __kmpc_master(), bs_plain_barrier, ct_barrier, ct_master, FALSE, KC_TRACE, KMP_WARNING, and TCR_4.

void __kmpc_end_barrier_master ( ident_t loc,
kmp_int32  global_tid 
)
Parameters:
loc source location information
global_tid thread id.

Complete the execution of a combined barrier and master. This function should only be called at the completion of the master code. Other threads will still be waiting at the barrier and this call releases them.

Definition at line 1196 of file kmp_csupport.c.

References __kmp_end_split_barrier(), bs_plain_barrier, and KC_TRACE.

Referenced by __kmp_enqueue_task().

void __kmpc_end_reduce ( ident_t loc,
kmp_int32  global_tid,
kmp_critical_name lck 
)
Parameters:
loc source location information
global_tid global thread id.
lck pointer to the unique lock data structure

Finish the execution of a blocking reduce. The lck pointer must be the same as that used in the corresponding start function.

Definition at line 2251 of file kmp_csupport.c.

References __kmp_barrier(), __kmp_end_critical_section_reduce_block(), __kmp_end_split_barrier(), __kmp_env_consistency_check, __KMP_GET_REDUCTION_METHOD, __kmp_pop_sync(), atomic_reduce_block, bs_plain_barrier, critical_reduce_block, ct_reduce, empty_reduce_block, FALSE, KA_TRACE, KMP_ASSERT, TEST_REDUCTION_METHOD, tree_reduce_block, and UNPACK_REDUCTION_BARRIER.

void __kmpc_end_reduce_nowait ( ident_t loc,
kmp_int32  global_tid,
kmp_critical_name lck 
)
Parameters:
loc source location information
global_tid global thread id.
lck pointer to the unique lock data structure

Finish the execution of a reduce nowait.

Definition at line 2113 of file kmp_csupport.c.

References __kmp_end_critical_section_reduce_block(), __kmp_env_consistency_check, __KMP_GET_REDUCTION_METHOD, __kmp_pop_sync(), atomic_reduce_block, critical_reduce_block, ct_reduce, empty_reduce_block, KA_TRACE, KMP_ASSERT, TEST_REDUCTION_METHOD, and tree_reduce_block.

void __kmpc_flush ( ident_t loc,
  ... 
)
Parameters:
loc source location information.
... pointers to the variables to be synchronized.

Execute flush. The pointers to the variables to be flushed need not actually be passed, (indeed unless this is a zero terminated list they can't be since there's no count here so we don't know how many there are!). This is implemented as a full memory fence. (Though depending on the memory ordering convention obeyed by the compiler even that may not be necessary).

Definition at line 753 of file kmp_csupport.c.

References __kmp_cpuinfo, kmp_cpuinfo::initialized, KC_TRACE, KMP_MB, and kmp_cpuinfo::sse2.

kmp_int32 __kmpc_reduce ( ident_t loc,
kmp_int32  global_tid,
kmp_int32  num_vars,
size_t  reduce_size,
void *  reduce_data,
void(*)(void *lhs_data, void *rhs_data)  reduce_func,
kmp_critical_name lck 
)
Parameters:
loc source location information
global_tid global thread number
num_vars number of items (variables) to be reduced
reduce_size size of data in bytes to be reduced
reduce_data pointer to data to be reduced
reduce_func callback function providing reduction operation on two operands and returning result of reduction in lhs_data
lck pointer to the unique lock data structure
Returns:
1 for the master thread, 0 for all other team threads, 2 for all team threads if atomic reduction needed

A blocking reduce that includes an implicit barrier.

Definition at line 2171 of file kmp_csupport.c.

References __kmp_barrier(), __kmp_determine_reduction_method(), __kmp_enter_critical_section_reduce_block(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), __kmp_pop_sync(), __kmp_push_sync(), __KMP_SET_REDUCTION_METHOD, atomic_reduce_block, critical_reduce_block, ct_reduce, empty_reduce_block, KA_TRACE, KMP_ASSERT, TCR_4, TEST_REDUCTION_METHOD, tree_reduce_block, TRUE, and UNPACK_REDUCTION_BARRIER.

kmp_int32 __kmpc_reduce_nowait ( ident_t loc,
kmp_int32  global_tid,
kmp_int32  num_vars,
size_t  reduce_size,
void *  reduce_data,
void(*)(void *lhs_data, void *rhs_data)  reduce_func,
kmp_critical_name lck 
)
Parameters:
loc source location information
global_tid global thread number
num_vars number of items (variables) to be reduced
reduce_size size of data in bytes to be reduced
reduce_data pointer to data to be reduced
reduce_func callback function providing reduction operation on two operands and returning result of reduction in lhs_data
lck pointer to the unique lock data structure
Returns:
1 for the master thread, 0 for all other team threads, 2 for all team threads if atomic reduction needed

The nowait version is used for a reduce clause with the nowait argument.

Definition at line 2013 of file kmp_csupport.c.

References __kmp_barrier(), __kmp_determine_reduction_method(), __kmp_enter_critical_section_reduce_block(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), __kmp_pop_sync(), __kmp_push_sync(), __KMP_SET_REDUCTION_METHOD, atomic_reduce_block, critical_reduce_block, ct_reduce, empty_reduce_block, FALSE, KA_TRACE, KMP_ASSERT, TCR_4, TEST_REDUCTION_METHOD, tree_reduce_block, and UNPACK_REDUCTION_BARRIER.


Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1