LLVM OpenMP 19.0.0git
Functions
Synchronization

These functions are used for implementing barriers. More...

Functions

void __kmpc_flush (ident_t *loc)
 
void __kmpc_barrier (ident_t *loc, kmp_int32 global_tid)
 
kmp_int32 __kmpc_barrier_master (ident_t *loc, kmp_int32 global_tid)
 
void __kmpc_end_barrier_master (ident_t *loc, kmp_int32 global_tid)
 
kmp_int32 __kmpc_barrier_master_nowait (ident_t *loc, kmp_int32 global_tid)
 
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)
 
void __kmpc_end_reduce_nowait (ident_t *loc, kmp_int32 global_tid, kmp_critical_name *lck)
 
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)
 
void __kmpc_end_reduce (ident_t *loc, kmp_int32 global_tid, kmp_critical_name *lck)
 

Detailed Description

These functions are used for implementing barriers.

Function Documentation

◆ __kmpc_barrier()

void __kmpc_barrier ( ident_t loc,
kmp_int32  global_tid 
)

◆ __kmpc_barrier_master()

kmp_int32 __kmpc_barrier_master ( ident_t loc,
kmp_int32  global_tid 
)
Parameters
locsource location information
global_tidthread 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 1745 of file kmp_csupport.cpp.

References __kmp_assert_valid_gtid(), __kmp_barrier(), __kmp_check_barrier(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), __kmp_resume_if_soft_paused(), __kmp_threads, __ompt_get_task_info_internal(), bs_plain_barrier, ct_barrier, ompt_callbacks_active_s::enabled, KC_TRACE, loc, ompt_enabled, OMPT_GET_FRAME_ADDRESS, status, TCR_4, and TRUE.

◆ __kmpc_barrier_master_nowait()

kmp_int32 __kmpc_barrier_master_nowait ( ident_t loc,
kmp_int32  global_tid 
)
Parameters
locsource location information
global_tidthread 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 1805 of file kmp_csupport.cpp.

References __kmp_assert_valid_gtid(), __kmp_barrier(), __kmp_check_barrier(), __kmp_env_consistency_check, __kmp_init_parallel, __kmp_parallel_initialize(), __kmp_pop_sync(), __kmp_resume_if_soft_paused(), __kmp_threads, __kmpc_master(), __ompt_get_task_info_internal(), bs_plain_barrier, ct_barrier, ct_master, ompt_callbacks_active_s::enabled, FALSE, KC_TRACE, KMP_WARNING, loc, ompt_enabled, OMPT_GET_FRAME_ADDRESS, ret, and TCR_4.

◆ __kmpc_end_barrier_master()

void __kmpc_end_barrier_master ( ident_t loc,
kmp_int32  global_tid 
)
Parameters
locsource location information
global_tidthread 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 1789 of file kmp_csupport.cpp.

References __kmp_assert_valid_gtid(), __kmp_end_split_barrier(), bs_plain_barrier, and KC_TRACE.

◆ __kmpc_end_reduce()

void __kmpc_end_reduce ( ident_t loc,
kmp_int32  global_tid,
kmp_critical_name lck 
)

◆ __kmpc_end_reduce_nowait()

void __kmpc_end_reduce_nowait ( ident_t loc,
kmp_int32  global_tid,
kmp_critical_name lck 
)
Parameters
locsource location information
global_tidglobal thread id.
lckpointer to the unique lock data structure

Finish the execution of a reduce nowait.

Definition at line 3735 of file kmp_csupport.cpp.

References __kmp_assert_valid_gtid(), __kmp_end_critical_section_reduce_block(), __kmp_env_consistency_check, __KMP_GET_REDUCTION_METHOD, __kmp_pop_sync(), __kmp_thread_from_gtid(), atomic_reduce_block, critical_reduce_block, ct_reduce, empty_reduce_block, KA_TRACE, KMP_ASSERT, lck, loc, OMPT_REDUCTION_DECL, OMPT_REDUCTION_END, TEST_REDUCTION_METHOD, and tree_reduce_block.

◆ __kmpc_flush()

void __kmpc_flush ( ident_t loc)
Parameters
locsource location information.

Execute flush. 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 735 of file kmp_csupport.cpp.

References __ompt_get_thread_data_internal(), KC_TRACE, KMP_MFENCE, ompt_callbacks, ompt_enabled, and OMPT_GET_RETURN_ADDRESS.

◆ __kmpc_reduce()

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
locsource location information
global_tidglobal thread number
num_varsnumber of items (variables) to be reduced
reduce_sizesize of data in bytes to be reduced
reduce_datapointer to data to be reduced
reduce_funccallback function providing reduction operation on two operands and returning result of reduction in lhs_data
lckpointer to the unique lock data structure
Returns
1 for the primary 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 3804 of file kmp_csupport.cpp.

References __kmp_assert_valid_gtid(), __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_restore_swapped_teams(), __kmp_resume_if_soft_paused(), __KMP_SET_REDUCTION_METHOD, __kmp_swap_teams_for_teams_reduction(), __kmp_thread_from_gtid(), __kmp_threads, __ompt_get_task_info_internal(), atomic_reduce_block, critical_reduce_block, ct_reduce, empty_reduce_block, ompt_callbacks_active_s::enabled, KA_TRACE, KMP_ASSERT, KMP_COUNT_BLOCK, lck, loc, ompt_enabled, OMPT_GET_FRAME_ADDRESS, OMPT_REDUCTION_BEGIN, OMPT_REDUCTION_DECL, TCR_4, TEST_REDUCTION_METHOD, tree_reduce_block, TRUE, and UNPACK_REDUCTION_BARRIER.

◆ __kmpc_reduce_nowait()

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
locsource location information
global_tidglobal thread number
num_varsnumber of items (variables) to be reduced
reduce_sizesize of data in bytes to be reduced
reduce_datapointer to data to be reduced
reduce_funccallback function providing reduction operation on two operands and returning result of reduction in lhs_data
lckpointer to the unique lock data structure
Returns
1 for the primary 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 3575 of file kmp_csupport.cpp.

References __kmp_assert_valid_gtid(), __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_restore_swapped_teams(), __kmp_resume_if_soft_paused(), __KMP_SET_REDUCTION_METHOD, __kmp_swap_teams_for_teams_reduction(), __kmp_thread_from_gtid(), __kmp_threads, __ompt_get_task_info_internal(), atomic_reduce_block, critical_reduce_block, ct_reduce, empty_reduce_block, ompt_callbacks_active_s::enabled, FALSE, KA_TRACE, KMP_ASSERT, KMP_COUNT_BLOCK, lck, loc, ompt_enabled, OMPT_GET_FRAME_ADDRESS, OMPT_REDUCTION_BEGIN, OMPT_REDUCTION_DECL, TCR_4, TEST_REDUCTION_METHOD, tree_reduce_block, and UNPACK_REDUCTION_BARRIER.