24#define MAX_MESSAGE 512
40 if ((env = getenv(
"KMP_INITIAL_THREAD_BIND")) != NULL &&
44 KC_TRACE(10, (
"__kmpc_begin: middle initialization called\n"));
48 KC_TRACE(10, (
"__kmpc_begin: called\n"));
67 KC_TRACE(10, (
"__kmpc_end: called\n"));
72#if KMP_OS_WINDOWS && OMPT_SUPPORT
103 KC_TRACE(10, (
"__kmpc_global_thread_num: T#%d\n", gtid));
124 (
"__kmpc_global_num_threads: num_threads = %d\n",
__kmp_all_nth));
136 KC_TRACE(10, (
"__kmpc_bound_thread_num: called\n"));
146 KC_TRACE(10, (
"__kmpc_bound_num_threads: called\n"));
168 if (__kmp_par_range == 0) {
175 semi2 = strchr(semi2,
';');
179 semi2 = strchr(semi2 + 1,
';');
183 if (__kmp_par_range_filename[0]) {
184 const char *
name = semi2 - 1;
188 if ((*
name ==
'/') || (*
name ==
';')) {
191 if (strncmp(__kmp_par_range_filename,
name, semi2 -
name)) {
192 return __kmp_par_range < 0;
195 semi3 = strchr(semi2 + 1,
';');
196 if (__kmp_par_range_routine[0]) {
197 if ((semi3 != NULL) && (semi3 > semi2) &&
198 (strncmp(__kmp_par_range_routine, semi2 + 1, semi3 - semi2 - 1))) {
199 return __kmp_par_range < 0;
202 if (
KMP_SSCANF(semi3 + 1,
"%d", &line_no) == 1) {
203 if ((line_no >= __kmp_par_range_lb) && (line_no <= __kmp_par_range_ub)) {
204 return __kmp_par_range > 0;
206 return __kmp_par_range < 0;
234 KA_TRACE(20, (
"__kmpc_push_num_threads: enter T#%d num_threads=%d\n",
235 global_tid, num_threads));
242 const char *message) {
263 KA_TRACE(20, (
"__kmpc_push_num_threads_list: enter T#%d num_threads_list=",
265 KA_TRACE(20, (
"%d", num_threads_list[0]));
268 KA_TRACE(20, (
", %d", num_threads_list[
i]));
279 int severity,
const char *message) {
285 KA_TRACE(20, (
"__kmpc_pop_num_threads: enter\n"));
291 KA_TRACE(20, (
"__kmpc_push_proc_bind: enter T#%d proc_bind=%d\n", global_tid,
310#if (KMP_STATS_ENABLED)
314 if (previous_state == stats_state_e::SERIAL_REGION) {
315 KMP_EXCHANGE_PARTITIONED_TIMER(OMP_parallel_overhead);
333 ompt_frame_t *ompt_frame;
336 ompt_frame = &master_th->th.th_current_task->ompt_task_info.frame;
339 OMPT_STORE_RETURN_ADDRESS(gtid);
363 ompt_frame->enter_frame = ompt_data_none;
369 if (previous_state == stats_state_e::SERIAL_REGION) {
370 KMP_EXCHANGE_PARTITIONED_TIMER(OMP_serial);
400 void *exit_frame_ptr;
441 (
"__kmpc_push_num_teams: enter T#%d num_teams=%d num_threads=%d\n",
442 global_tid, num_teams, num_threads));
461 if (thread_limit > 0)
462 thread->th.th_current_task->td_icvs.task_thread_limit = thread_limit;
484 KA_TRACE(20, (
"__kmpc_push_num_teams_51: enter T#%d num_teams_lb=%d"
485 " num_teams_ub=%d num_threads=%d\n",
486 global_tid, num_teams_lb, num_teams_ub, num_threads));
512 if (previous_state == stats_state_e::SERIAL_REGION) {
513 KMP_EXCHANGE_PARTITIONED_TIMER(OMP_teams_overhead);
520 this_thr->th.th_teams_microtask =
microtask;
521 this_thr->th.th_teams_level =
522 this_thr->th.th_team->t.t_level;
525 kmp_team_t *parent_team = this_thr->th.th_team;
528 parent_team->
t.t_implicit_task_taskdata[tid]
531 OMPT_STORE_RETURN_ADDRESS(gtid);
536 if (this_thr->th.th_teams_size.nteams == 0) {
557 this_thr->th.th_cg_roots = tmp->
up;
558 KA_TRACE(100, (
"__kmpc_fork_teams: Thread %p popping node %p and moving up"
559 " to node %p. cg_nthreads was %d\n",
560 this_thr, tmp, this_thr->th.th_cg_roots, tmp->
cg_nthreads));
568 this_thr->th.th_current_task->td_icvs.thread_limit =
569 this_thr->th.th_cg_roots->cg_thread_limit;
571 this_thr->th.th_teams_microtask = NULL;
572 this_thr->th.th_teams_level = 0;
573 *(
kmp_int64 *)(&this_thr->th.th_teams_size) = 0L;
576 if (previous_state == stats_state_e::SERIAL_REGION) {
577 KMP_EXCHANGE_PARTITIONED_TIMER(OMP_serial);
609 OMPT_STORE_RETURN_ADDRESS(global_tid);
627 (
"__kmpc_end_serialized_parallel: called by T#%d\n", global_tid));
642 serial_team = this_thr->th.th_serial_team;
660 this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
661 OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame = ompt_data_none;
664 ompt_scope_end, NULL, OMPT_CUR_TASK_DATA(this_thr), 1,
665 OMPT_CUR_TASK_INFO(this_thr)->thread_num, ompt_task_implicit);
669 ompt_data_t *parent_task_data;
674 &(serial_team->
t.ompt_team_info.parallel_data), parent_task_data,
675 ompt_parallel_invoker_program | ompt_parallel_team,
676 OMPT_LOAD_RETURN_ADDRESS(global_tid));
679 this_thr->th.ompt_thread_info.state = ompt_state_overhead;
685 top = serial_team->
t.t_control_stack_top;
687 copy_icvs(&serial_team->
t.t_threads[0]->th.th_current_task->td_icvs, top);
688 serial_team->
t.t_control_stack_top = top->
next;
696 serial_team->
t.t_dispatch->th_disp_buffer;
697 serial_team->
t.t_dispatch->th_disp_buffer =
698 serial_team->
t.t_dispatch->th_disp_buffer->next;
703 if (serial_team->
t.t_serialized > 1) {
707 this_thr->th.th_def_allocator = serial_team->
t.t_def_allocator;
709 --serial_team->
t.t_serialized;
710 if (serial_team->
t.t_serialized == 0) {
714#if KMP_ARCH_X86 || KMP_ARCH_X86_64
715 if (__kmp_inherit_fp_control && serial_team->
t.t_fp_control_saved) {
716 __kmp_clear_x87_fpu_status_word();
717 __kmp_load_x87_fpu_control_word(&serial_team->
t.t_x87_fpu_control_word);
718 __kmp_load_mxcsr(&serial_team->
t.t_mxcsr);
724 if (ompd_state & OMPD_ENABLE_BP)
725 ompd_bp_parallel_end();
728 this_thr->th.th_team = serial_team->
t.t_parent;
729 this_thr->th.th_info.ds.ds_tid = serial_team->
t.t_master_tid;
732 this_thr->th.th_team_nproc = serial_team->
t.t_parent->t.t_nproc;
733 this_thr->th.th_team_master =
734 serial_team->
t.t_parent->t.t_threads[0];
735 this_thr->th.th_team_serialized = this_thr->th.th_team->t.t_serialized;
738 this_thr->th.th_dispatch =
739 &this_thr->th.th_team->t.t_dispatch[serial_team->
t.t_master_tid];
741 KMP_ASSERT(this_thr->th.th_current_task->td_flags.executing == 0);
742 this_thr->th.th_current_task->td_flags.executing = 1;
747 serial_team->
t.t_primary_task_state == 1);
748 this_thr->th.th_task_state =
749 (
kmp_uint8)serial_team->
t.t_primary_task_state;
751 this_thr->th.th_task_team =
752 this_thr->th.th_team->t.t_task_team[this_thr->th.th_task_state];
754 (
"__kmpc_end_serialized_parallel: T#%d restoring task_team %p / "
756 global_tid, this_thr->th.th_task_team, this_thr->th.th_team));
758#if KMP_AFFINITY_SUPPORTED
759 if (this_thr->th.th_team->t.t_level == 0 && __kmp_affinity.flags.reset) {
765 KA_TRACE(20, (
"__kmpc_end_serialized_parallel: T#%d decreasing nesting "
766 "depth of serial team %p to %d\n",
767 global_tid, serial_team, serial_team->
t.t_serialized));
771 serial_team->
t.t_level--;
776 this_thr->th.ompt_thread_info.state =
777 ((this_thr->th.th_team_serialized) ? ompt_state_work_serial
778 : ompt_state_work_parallel);
791 KC_TRACE(10, (
"__kmpc_flush: called\n"));
796#if OMPT_SUPPORT && OMPT_OPTIONAL
814 KC_TRACE(10, (
"__kmpc_barrier: called T#%d\n", global_tid));
830 ompt_frame_t *ompt_frame;
833 if (ompt_frame->enter_frame.ptr == NULL)
836 OMPT_STORE_RETURN_ADDRESS(global_tid);
847#if OMPT_SUPPORT && OMPT_OPTIONAL
849 ompt_frame->enter_frame = ompt_data_none;
864 KC_TRACE(10, (
"__kmpc_master: called T#%d\n", global_tid));
878#if OMPT_SUPPORT && OMPT_OPTIONAL
886 ompt_scope_begin, &(team->
t.ompt_team_info.parallel_data),
887 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
894#if KMP_USE_DYNAMIC_LOCK
919 KC_TRACE(10, (
"__kmpc_end_master: called T#%d\n", global_tid));
924#if OMPT_SUPPORT && OMPT_OPTIONAL
930 ompt_scope_end, &(team->
t.ompt_team_info.parallel_data),
931 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
953 KC_TRACE(10, (
"__kmpc_masked: called T#%d\n", global_tid));
968#if OMPT_SUPPORT && OMPT_OPTIONAL
974 ompt_scope_begin, &(team->
t.ompt_team_info.parallel_data),
975 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
982#if KMP_USE_DYNAMIC_LOCK
1007 KC_TRACE(10, (
"__kmpc_end_masked: called T#%d\n", global_tid));
1011#if OMPT_SUPPORT && OMPT_OPTIONAL
1017 ompt_scope_end, &(team->
t.ompt_team_info.parallel_data),
1018 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
1040 KC_TRACE(10, (
"__kmpc_ordered: called T#%d\n", gtid));
1049 __kmp_itt_ordered_prep(gtid);
1055#if OMPT_SUPPORT && OMPT_OPTIONAL
1059 OMPT_STORE_RETURN_ADDRESS(gtid);
1062 lck = (ompt_wait_id_t)(uintptr_t)&team->
t.t_ordered.dt.t_value;
1064 th->th.ompt_thread_info.wait_id =
lck;
1065 th->th.ompt_thread_info.state = ompt_state_wait_ordered;
1068 codeptr_ra = OMPT_LOAD_RETURN_ADDRESS(gtid);
1071 ompt_mutex_ordered, omp_lock_hint_none, kmp_mutex_impl_spin,
lck,
1077 if (th->th.th_dispatch->th_deo_fcn != 0)
1078 (*th->th.th_dispatch->th_deo_fcn)(>id, &cid,
loc);
1082#if OMPT_SUPPORT && OMPT_OPTIONAL
1085 th->th.ompt_thread_info.state = ompt_state_work_parallel;
1086 th->th.ompt_thread_info.wait_id = 0;
1091 ompt_mutex_ordered, (ompt_wait_id_t)(uintptr_t)
lck, codeptr_ra);
1097 __kmp_itt_ordered_start(gtid);
1112 KC_TRACE(10, (
"__kmpc_end_ordered: called T#%d\n", gtid));
1116 __kmp_itt_ordered_end(gtid);
1122 if (th->th.th_dispatch->th_dxo_fcn != 0)
1123 (*th->th.th_dispatch->th_dxo_fcn)(>id, &cid,
loc);
1127#if OMPT_SUPPORT && OMPT_OPTIONAL
1128 OMPT_STORE_RETURN_ADDRESS(gtid);
1133 ->
t.t_ordered.dt.t_value,
1134 OMPT_LOAD_RETURN_ADDRESS(gtid));
1139#if KMP_USE_DYNAMIC_LOCK
1141static __forceinline
void
1143 kmp_int32 gtid, kmp_indirect_locktag_t tag) {
1147 kmp_indirect_lock_t **
lck;
1148 lck = (kmp_indirect_lock_t **)
crit;
1149 kmp_indirect_lock_t *ilk = __kmp_allocate_indirect_lock(&idx, gtid, tag);
1150 KMP_I_LOCK_FUNC(ilk, init)(ilk->lock);
1151 KMP_SET_I_LOCK_LOCATION(ilk,
loc);
1154 (
"__kmp_init_indirect_csptr: initialized indirect lock #%d\n", tag));
1156 __kmp_itt_critical_creating(ilk->lock,
loc);
1161 __kmp_itt_critical_destroyed(ilk->lock);
1171#define KMP_ACQUIRE_TAS_LOCK(lock, gtid) \
1173 kmp_tas_lock_t *l = (kmp_tas_lock_t *)lock; \
1174 kmp_int32 tas_free = KMP_LOCK_FREE(tas); \
1175 kmp_int32 tas_busy = KMP_LOCK_BUSY(gtid + 1, tas); \
1176 if (KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free || \
1177 !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy)) { \
1179 KMP_FSYNC_PREPARE(l); \
1180 KMP_INIT_YIELD(spins); \
1181 kmp_backoff_t backoff = __kmp_spin_backoff_params; \
1183 if (TCR_4(__kmp_nth) > \
1184 (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
1187 KMP_YIELD_SPIN(spins); \
1189 __kmp_spin_backoff(&backoff); \
1191 KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free || \
1192 !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy)); \
1194 KMP_FSYNC_ACQUIRED(l); \
1198#define KMP_TEST_TAS_LOCK(lock, gtid, rc) \
1200 kmp_tas_lock_t *l = (kmp_tas_lock_t *)lock; \
1201 kmp_int32 tas_free = KMP_LOCK_FREE(tas); \
1202 kmp_int32 tas_busy = KMP_LOCK_BUSY(gtid + 1, tas); \
1203 rc = KMP_ATOMIC_LD_RLX(&l->lk.poll) == tas_free && \
1204 __kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy); \
1208#define KMP_RELEASE_TAS_LOCK(lock, gtid) \
1209 { KMP_ATOMIC_ST_REL(&((kmp_tas_lock_t *)lock)->lk.poll, KMP_LOCK_FREE(tas)); }
1213#include <sys/syscall.h>
1223#define KMP_ACQUIRE_FUTEX_LOCK(lock, gtid) \
1225 kmp_futex_lock_t *ftx = (kmp_futex_lock_t *)lock; \
1226 kmp_int32 gtid_code = (gtid + 1) << 1; \
1228 KMP_FSYNC_PREPARE(ftx); \
1229 kmp_int32 poll_val; \
1230 while ((poll_val = KMP_COMPARE_AND_STORE_RET32( \
1231 &(ftx->lk.poll), KMP_LOCK_FREE(futex), \
1232 KMP_LOCK_BUSY(gtid_code, futex))) != KMP_LOCK_FREE(futex)) { \
1233 kmp_int32 cond = KMP_LOCK_STRIP(poll_val) & 1; \
1235 if (!KMP_COMPARE_AND_STORE_RET32(&(ftx->lk.poll), poll_val, \
1237 KMP_LOCK_BUSY(1, futex))) { \
1240 poll_val |= KMP_LOCK_BUSY(1, futex); \
1243 if ((rc = syscall(__NR_futex, &(ftx->lk.poll), FUTEX_WAIT, poll_val, \
1244 NULL, NULL, 0)) != 0) { \
1249 KMP_FSYNC_ACQUIRED(ftx); \
1253#define KMP_TEST_FUTEX_LOCK(lock, gtid, rc) \
1255 kmp_futex_lock_t *ftx = (kmp_futex_lock_t *)lock; \
1256 if (KMP_COMPARE_AND_STORE_ACQ32(&(ftx->lk.poll), KMP_LOCK_FREE(futex), \
1257 KMP_LOCK_BUSY(gtid + 1 << 1, futex))) { \
1258 KMP_FSYNC_ACQUIRED(ftx); \
1266#define KMP_RELEASE_FUTEX_LOCK(lock, gtid) \
1268 kmp_futex_lock_t *ftx = (kmp_futex_lock_t *)lock; \
1270 KMP_FSYNC_RELEASING(ftx); \
1271 kmp_int32 poll_val = \
1272 KMP_XCHG_FIXED32(&(ftx->lk.poll), KMP_LOCK_FREE(futex)); \
1273 if (KMP_LOCK_STRIP(poll_val) & 1) { \
1274 syscall(__NR_futex, &(ftx->lk.poll), FUTEX_WAKE, \
1275 KMP_LOCK_BUSY(1, futex), NULL, NULL, 0); \
1278 KMP_YIELD_OVERSUB(); \
1302 __kmp_itt_critical_creating(
lck);
1318 __kmp_itt_critical_destroyed(
lck);
1345#if KMP_USE_DYNAMIC_LOCK
1346#if OMPT_SUPPORT && OMPT_OPTIONAL
1347 OMPT_STORE_RETURN_ADDRESS(global_tid);
1352#if OMPT_SUPPORT && OMPT_OPTIONAL
1353 ompt_state_t prev_state = ompt_state_undefined;
1358 KC_TRACE(10, (
"__kmpc_critical: called T#%d\n", global_tid));
1389 __kmp_itt_critical_acquiring(
lck);
1391#if OMPT_SUPPORT && OMPT_OPTIONAL
1392 OMPT_STORE_RETURN_ADDRESS(gtid);
1393 void *codeptr_ra = NULL;
1397 prev_state = ti.
state;
1399 ti.
state = ompt_state_wait_critical;
1402 codeptr_ra = OMPT_LOAD_RETURN_ADDRESS(gtid);
1405 ompt_mutex_critical, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
1406 (ompt_wait_id_t)(uintptr_t)
lck, codeptr_ra);
1415 __kmp_itt_critical_acquired(
lck);
1417#if OMPT_SUPPORT && OMPT_OPTIONAL
1420 ti.
state = prev_state;
1426 ompt_mutex_critical, (ompt_wait_id_t)(uintptr_t)
lck, codeptr_ra);
1433 KA_TRACE(15, (
"__kmpc_critical: done T#%d\n", global_tid));
1437#if KMP_USE_DYNAMIC_LOCK
1440static __forceinline kmp_dyna_lockseq_t __kmp_map_hint_to_lock(uintptr_t hint) {
1442#define KMP_TSX_LOCK(seq) lockseq_##seq
1444#define KMP_TSX_LOCK(seq) __kmp_user_lock_seq
1447#if KMP_ARCH_X86 || KMP_ARCH_X86_64
1448#define KMP_CPUINFO_RTM (__kmp_cpuinfo.flags.rtm)
1450#define KMP_CPUINFO_RTM 0
1454 if (hint & kmp_lock_hint_hle)
1455 return KMP_TSX_LOCK(hle);
1456 if (hint & kmp_lock_hint_rtm)
1457 return KMP_CPUINFO_RTM ? KMP_TSX_LOCK(rtm_queuing) : __kmp_user_lock_seq;
1458 if (hint & kmp_lock_hint_adaptive)
1459 return KMP_CPUINFO_RTM ? KMP_TSX_LOCK(adaptive) : __kmp_user_lock_seq;
1462 if ((hint & omp_lock_hint_contended) && (hint & omp_lock_hint_uncontended))
1463 return __kmp_user_lock_seq;
1464 if ((hint & omp_lock_hint_speculative) &&
1465 (hint & omp_lock_hint_nonspeculative))
1466 return __kmp_user_lock_seq;
1469 if (hint & omp_lock_hint_contended)
1470 return lockseq_queuing;
1473 if ((hint & omp_lock_hint_uncontended) && !(hint & omp_lock_hint_speculative))
1477 if (hint & omp_lock_hint_speculative)
1478 return KMP_CPUINFO_RTM ? KMP_TSX_LOCK(rtm_spin) : __kmp_user_lock_seq;
1480 return __kmp_user_lock_seq;
1483#if OMPT_SUPPORT && OMPT_OPTIONAL
1484#if KMP_USE_DYNAMIC_LOCK
1485static kmp_mutex_impl_t
1486__ompt_get_mutex_impl_type(
void *user_lock, kmp_indirect_lock_t *ilock = 0) {
1488 switch (KMP_EXTRACT_D_TAG(user_lock)) {
1493 return kmp_mutex_impl_queuing;
1496 return kmp_mutex_impl_spin;
1499 case locktag_rtm_spin:
1500 return kmp_mutex_impl_speculative;
1503 return kmp_mutex_impl_none;
1505 ilock = KMP_LOOKUP_I_LOCK(user_lock);
1508 switch (ilock->type) {
1510 case locktag_adaptive:
1511 case locktag_rtm_queuing:
1512 return kmp_mutex_impl_speculative;
1514 case locktag_nested_tas:
1515 return kmp_mutex_impl_spin;
1517 case locktag_nested_futex:
1519 case locktag_ticket:
1520 case locktag_queuing:
1522 case locktag_nested_ticket:
1523 case locktag_nested_queuing:
1524 case locktag_nested_drdpa:
1525 return kmp_mutex_impl_queuing;
1527 return kmp_mutex_impl_none;
1532static kmp_mutex_impl_t __ompt_get_mutex_impl_type() {
1535 return kmp_mutex_impl_spin;
1542 return kmp_mutex_impl_queuing;
1545 case lk_rtm_queuing:
1548 return kmp_mutex_impl_speculative;
1551 return kmp_mutex_impl_none;
1574#if OMPT_SUPPORT && OMPT_OPTIONAL
1575 ompt_state_t prev_state = ompt_state_undefined;
1578 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(global_tid);
1583 KC_TRACE(10, (
"__kmpc_critical: called T#%d\n", global_tid));
1586 kmp_dyna_lock_t *lk = (kmp_dyna_lock_t *)
crit;
1589 kmp_dyna_lockseq_t lockseq = __kmp_map_hint_to_lock(hint);
1591 if (KMP_IS_D_LOCK(lockseq)) {
1594 KMP_GET_D_TAG(lockseq));
1596 __kmp_init_indirect_csptr(
crit,
loc, global_tid, KMP_GET_I_TAG(lockseq));
1602 if (KMP_EXTRACT_D_TAG(lk) != 0) {
1606 __kmp_map_hint_to_lock(hint));
1609 __kmp_itt_critical_acquiring(
lck);
1611#if OMPT_SUPPORT && OMPT_OPTIONAL
1615 prev_state = ti.
state;
1617 ti.
state = ompt_state_wait_critical;
1622 ompt_mutex_critical, (
unsigned int)hint,
1623 __ompt_get_mutex_impl_type(
crit), (ompt_wait_id_t)(uintptr_t)
lck,
1628#if KMP_USE_INLINED_TAS
1630 KMP_ACQUIRE_TAS_LOCK(
lck, global_tid);
1632#elif KMP_USE_INLINED_FUTEX
1634 KMP_ACQUIRE_FUTEX_LOCK(
lck, global_tid);
1638 KMP_D_LOCK_FUNC(lk, set)(lk, global_tid);
1641 kmp_indirect_lock_t *ilk = *((kmp_indirect_lock_t **)lk);
1645 __kmp_map_hint_to_lock(hint));
1648 __kmp_itt_critical_acquiring(
lck);
1650#if OMPT_SUPPORT && OMPT_OPTIONAL
1654 prev_state = ti.
state;
1656 ti.
state = ompt_state_wait_critical;
1661 ompt_mutex_critical, (
unsigned int)hint,
1662 __ompt_get_mutex_impl_type(0, ilk), (ompt_wait_id_t)(uintptr_t)
lck,
1667 KMP_I_LOCK_FUNC(ilk, set)(
lck, global_tid);
1672 __kmp_itt_critical_acquired(
lck);
1674#if OMPT_SUPPORT && OMPT_OPTIONAL
1677 ti.
state = prev_state;
1683 ompt_mutex_critical, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
1689 KA_TRACE(15, (
"__kmpc_critical: done T#%d\n", global_tid));
1707 KC_TRACE(10, (
"__kmpc_end_critical: called T#%d\n", global_tid));
1709#if KMP_USE_DYNAMIC_LOCK
1710 int locktag = KMP_EXTRACT_D_TAG(
crit);
1718 __kmp_itt_critical_releasing(
lck);
1720#if KMP_USE_INLINED_TAS
1722 KMP_RELEASE_TAS_LOCK(
lck, global_tid);
1724#elif KMP_USE_INLINED_FUTEX
1726 KMP_RELEASE_FUTEX_LOCK(
lck, global_tid);
1730 KMP_D_LOCK_FUNC(
lck, unset)((kmp_dyna_lock_t *)
lck, global_tid);
1733 kmp_indirect_lock_t *ilk =
1734 (kmp_indirect_lock_t *)
TCR_PTR(*((kmp_indirect_lock_t **)
crit));
1741 __kmp_itt_critical_releasing(
lck);
1743 KMP_I_LOCK_FUNC(ilk, unset)(
lck, global_tid);
1768 __kmp_itt_critical_releasing(
lck);
1776#if OMPT_SUPPORT && OMPT_OPTIONAL
1779 OMPT_STORE_RETURN_ADDRESS(global_tid);
1782 ompt_mutex_critical, (ompt_wait_id_t)(uintptr_t)
lck,
1783 OMPT_LOAD_RETURN_ADDRESS(0));
1788 KA_TRACE(15, (
"__kmpc_end_critical: done T#%d\n", global_tid));
1802 KC_TRACE(10, (
"__kmpc_barrier_master: called T#%d\n", global_tid));
1814 ompt_frame_t *ompt_frame;
1817 if (ompt_frame->enter_frame.ptr == NULL)
1820 OMPT_STORE_RETURN_ADDRESS(global_tid);
1826#if OMPT_SUPPORT && OMPT_OPTIONAL
1828 ompt_frame->enter_frame = ompt_data_none;
1832 return (
status != 0) ? 0 : 1;
1845 KC_TRACE(10, (
"__kmpc_end_barrier_master: called T#%d\n", global_tid));
1862 KC_TRACE(10, (
"__kmpc_barrier_master_nowait: called T#%d\n", global_tid));
1878 ompt_frame_t *ompt_frame;
1881 if (ompt_frame->enter_frame.ptr == NULL)
1884 OMPT_STORE_RETURN_ADDRESS(global_tid);
1890#if OMPT_SUPPORT && OMPT_OPTIONAL
1892 ompt_frame->enter_frame = ompt_data_none;
1933#if OMPT_SUPPORT && OMPT_OPTIONAL
1942 ompt_work_single_executor, ompt_scope_begin,
1943 &(team->
t.ompt_team_info.parallel_data),
1944 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
1950 ompt_work_single_other, ompt_scope_begin,
1951 &(team->
t.ompt_team_info.parallel_data),
1952 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
1955 ompt_work_single_other, ompt_scope_end,
1956 &(team->
t.ompt_team_info.parallel_data),
1957 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data),
1981#if OMPT_SUPPORT && OMPT_OPTIONAL
1988 ompt_work_single_executor, ompt_scope_end,
1989 &(team->
t.ompt_team_info.parallel_data),
1990 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data), 1,
2005 KE_TRACE(10, (
"__kmpc_for_static_fini called T#%d\n", global_tid));
2007#if OMPT_SUPPORT && OMPT_OPTIONAL
2009 ompt_work_t ompt_work_type = ompt_work_loop_static;
2015 ompt_work_type = ompt_work_loop_static;
2017 ompt_work_type = ompt_work_sections;
2019 ompt_work_type = ompt_work_distribute;
2027 ompt_work_type, ompt_scope_end, &(team_info->
parallel_data),
2101 if (buffer &&
size) {
2115#if KMP_AFFINITY_SUPPORTED
2117 __kmp_affinity.flags.reset) {
2125 char const *format) {
2127 size_t num_required;
2134#if KMP_AFFINITY_SUPPORTED
2136 __kmp_affinity.flags.reset) {
2142 if (buffer && buf_size) {
2144 capture_buf.
used + 1);
2147 return num_required;
2161 int gtid, tid, bt = arg;
2192#if defined(KMP_STUB) || !KMP_AFFINITY_SUPPORTED
2199 return __kmp_aux_set_affinity_mask_proc(proc,
mask);
2204#if defined(KMP_STUB) || !KMP_AFFINITY_SUPPORTED
2211 return __kmp_aux_unset_affinity_mask_proc(proc,
mask);
2216#if defined(KMP_STUB) || !KMP_AFFINITY_SUPPORTED
2223 return __kmp_aux_get_affinity_mask_proc(proc,
mask);
2273 void *cpy_data,
void (*cpy_func)(
void *,
void *),
2276 KC_TRACE(10, (
"__kmpc_copyprivate: called T#%d\n", gtid));
2292 *data_ptr = cpy_data;
2295 ompt_frame_t *ompt_frame;
2298 if (ompt_frame->enter_frame.ptr == NULL)
2301 OMPT_STORE_RETURN_ADDRESS(gtid);
2310 (*cpy_func)(cpy_data, *data_ptr);
2316 OMPT_STORE_RETURN_ADDRESS(gtid);
2323#if OMPT_SUPPORT && OMPT_OPTIONAL
2325 ompt_frame->enter_frame = ompt_data_none;
2351 KC_TRACE(10, (
"__kmpc_copyprivate_light: called T#%d\n", gtid));
2366 *data_ptr = cpy_data;
2369 ompt_frame_t *ompt_frame;
2372 if (ompt_frame->enter_frame.ptr == NULL)
2374 OMPT_STORE_RETURN_ADDRESS(gtid);
2388#define INIT_LOCK __kmp_init_user_lock_with_checks
2389#define INIT_NESTED_LOCK __kmp_init_nested_user_lock_with_checks
2390#define ACQUIRE_LOCK __kmp_acquire_user_lock_with_checks
2391#define ACQUIRE_LOCK_TIMED __kmp_acquire_user_lock_with_checks_timed
2392#define ACQUIRE_NESTED_LOCK __kmp_acquire_nested_user_lock_with_checks
2393#define ACQUIRE_NESTED_LOCK_TIMED \
2394 __kmp_acquire_nested_user_lock_with_checks_timed
2395#define RELEASE_LOCK __kmp_release_user_lock_with_checks
2396#define RELEASE_NESTED_LOCK __kmp_release_nested_user_lock_with_checks
2397#define TEST_LOCK __kmp_test_user_lock_with_checks
2398#define TEST_NESTED_LOCK __kmp_test_nested_user_lock_with_checks
2399#define DESTROY_LOCK __kmp_destroy_user_lock_with_checks
2400#define DESTROY_NESTED_LOCK __kmp_destroy_nested_user_lock_with_checks
2405#if KMP_USE_DYNAMIC_LOCK
2408static __forceinline
void __kmp_init_lock_with_hint(
ident_t *
loc,
void **
lock,
2409 kmp_dyna_lockseq_t seq) {
2410 if (KMP_IS_D_LOCK(seq)) {
2411 KMP_INIT_D_LOCK(
lock, seq);
2416 KMP_INIT_I_LOCK(
lock, seq);
2418 kmp_indirect_lock_t *ilk = KMP_LOOKUP_I_LOCK(
lock);
2419 __kmp_itt_lock_creating(ilk->lock,
loc);
2425static __forceinline
void
2427 kmp_dyna_lockseq_t seq) {
2430 if (seq == lockseq_hle || seq == lockseq_rtm_queuing ||
2431 seq == lockseq_rtm_spin || seq == lockseq_adaptive)
2432 seq = __kmp_user_lock_seq;
2436 seq = lockseq_nested_tas;
2440 seq = lockseq_nested_futex;
2443 case lockseq_ticket:
2444 seq = lockseq_nested_ticket;
2446 case lockseq_queuing:
2447 seq = lockseq_nested_queuing;
2450 seq = lockseq_nested_drdpa;
2453 seq = lockseq_nested_queuing;
2455 KMP_INIT_I_LOCK(
lock, seq);
2457 kmp_indirect_lock_t *ilk = KMP_LOOKUP_I_LOCK(
lock);
2458 __kmp_itt_lock_creating(ilk->lock,
loc);
2467 KMP_FATAL(LockIsUninitialized,
"omp_init_lock_with_hint");
2470 __kmp_init_lock_with_hint(
loc, user_lock, __kmp_map_hint_to_lock(hint));
2472#if OMPT_SUPPORT && OMPT_OPTIONAL
2474 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2479 ompt_mutex_lock, (omp_lock_hint_t)hint,
2480 __ompt_get_mutex_impl_type(user_lock),
2481 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2488 void **user_lock, uintptr_t hint) {
2491 KMP_FATAL(LockIsUninitialized,
"omp_init_nest_lock_with_hint");
2494 __kmp_init_nest_lock_with_hint(
loc, user_lock, __kmp_map_hint_to_lock(hint));
2496#if OMPT_SUPPORT && OMPT_OPTIONAL
2498 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2503 ompt_mutex_nest_lock, (omp_lock_hint_t)hint,
2504 __ompt_get_mutex_impl_type(user_lock),
2505 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2514#if KMP_USE_DYNAMIC_LOCK
2518 KMP_FATAL(LockIsUninitialized,
"omp_init_lock");
2520 __kmp_init_lock_with_hint(
loc, user_lock, __kmp_user_lock_seq);
2522#if OMPT_SUPPORT && OMPT_OPTIONAL
2524 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2529 ompt_mutex_lock, omp_lock_hint_none,
2530 __ompt_get_mutex_impl_type(user_lock),
2531 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2537 static char const *
const func =
"omp_init_lock";
2542 if (user_lock == NULL) {
2565#if OMPT_SUPPORT && OMPT_OPTIONAL
2567 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2572 ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
2573 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2578 __kmp_itt_lock_creating(
lck);
2586#if KMP_USE_DYNAMIC_LOCK
2590 KMP_FATAL(LockIsUninitialized,
"omp_init_nest_lock");
2592 __kmp_init_nest_lock_with_hint(
loc, user_lock, __kmp_user_lock_seq);
2594#if OMPT_SUPPORT && OMPT_OPTIONAL
2596 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2601 ompt_mutex_nest_lock, omp_lock_hint_none,
2602 __ompt_get_mutex_impl_type(user_lock),
2603 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2609 static char const *
const func =
"omp_init_nest_lock";
2614 if (user_lock == NULL) {
2622 (
sizeof(
lck->tas.lk.poll) +
sizeof(
lck->tas.lk.depth_locked) <=
2628 (
sizeof(
lck->futex.lk.poll) +
sizeof(
lck->futex.lk.depth_locked) <=
2640#if OMPT_SUPPORT && OMPT_OPTIONAL
2642 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2647 ompt_mutex_nest_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
2648 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2653 __kmp_itt_lock_creating(
lck);
2660#if KMP_USE_DYNAMIC_LOCK
2664 if (KMP_EXTRACT_D_TAG(user_lock) == 0) {
2665 lck = ((kmp_indirect_lock_t *)KMP_LOOKUP_I_LOCK(user_lock))->
lock;
2669 __kmp_itt_lock_destroyed(
lck);
2671#if OMPT_SUPPORT && OMPT_OPTIONAL
2673 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2678 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2681 KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
2699#if OMPT_SUPPORT && OMPT_OPTIONAL
2701 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2706 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2711 __kmp_itt_lock_destroyed(
lck);
2733#if KMP_USE_DYNAMIC_LOCK
2736 kmp_indirect_lock_t *ilk = KMP_LOOKUP_I_LOCK(user_lock);
2737 __kmp_itt_lock_destroyed(ilk->lock);
2739#if OMPT_SUPPORT && OMPT_OPTIONAL
2741 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2746 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2749 KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
2756 (
sizeof(
lck->tas.lk.poll) +
sizeof(
lck->tas.lk.depth_locked) <=
2762 (
sizeof(
lck->futex.lk.poll) +
sizeof(
lck->futex.lk.depth_locked) <=
2771#if OMPT_SUPPORT && OMPT_OPTIONAL
2773 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2778 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2783 __kmp_itt_lock_destroyed(
lck);
2789 (
sizeof(
lck->tas.lk.poll) +
sizeof(
lck->tas.lk.depth_locked) <=
2795 (
sizeof(
lck->futex.lk.poll) +
sizeof(
lck->futex.lk.depth_locked) <=
2808#if KMP_USE_DYNAMIC_LOCK
2809 int tag = KMP_EXTRACT_D_TAG(user_lock);
2811 __kmp_itt_lock_acquiring(
2815#if OMPT_SUPPORT && OMPT_OPTIONAL
2817 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2822 ompt_mutex_lock, omp_lock_hint_none,
2823 __ompt_get_mutex_impl_type(user_lock),
2824 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2827#if KMP_USE_INLINED_TAS
2829 KMP_ACQUIRE_TAS_LOCK(user_lock, gtid);
2831#elif KMP_USE_INLINED_FUTEX
2833 KMP_ACQUIRE_FUTEX_LOCK(user_lock, gtid);
2837 __kmp_direct_set[tag]((kmp_dyna_lock_t *)user_lock, gtid);
2842#if OMPT_SUPPORT && OMPT_OPTIONAL
2845 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2868 __kmp_itt_lock_acquiring(
lck);
2870#if OMPT_SUPPORT && OMPT_OPTIONAL
2872 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2877 ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
2878 (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
2885 __kmp_itt_lock_acquired(
lck);
2888#if OMPT_SUPPORT && OMPT_OPTIONAL
2891 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
2899#if KMP_USE_DYNAMIC_LOCK
2904#if OMPT_SUPPORT && OMPT_OPTIONAL
2906 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2912 ompt_mutex_nest_lock, omp_lock_hint_none,
2913 __ompt_get_mutex_impl_type(user_lock),
2914 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2918 int acquire_status =
2919 KMP_D_LOCK_FUNC(user_lock, set)((kmp_dyna_lock_t *)user_lock, gtid);
2920 (
void)acquire_status;
2925#if OMPT_SUPPORT && OMPT_OPTIONAL
2931 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock,
2938 ompt_scope_begin, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
2949 (
sizeof(
lck->tas.lk.poll) +
sizeof(
lck->tas.lk.depth_locked) <=
2955 (
sizeof(
lck->futex.lk.poll) +
sizeof(
lck->futex.lk.depth_locked) <=
2965 __kmp_itt_lock_acquiring(
lck);
2967#if OMPT_SUPPORT && OMPT_OPTIONAL
2969 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
2975 ompt_mutex_nest_lock, omp_lock_hint_none,
2976 __ompt_get_mutex_impl_type(), (ompt_wait_id_t)(uintptr_t)
lck,
2985 __kmp_itt_lock_acquired(
lck);
2988#if OMPT_SUPPORT && OMPT_OPTIONAL
2994 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3000 ompt_scope_begin, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3010#if KMP_USE_DYNAMIC_LOCK
3012 int tag = KMP_EXTRACT_D_TAG(user_lock);
3016#if KMP_USE_INLINED_TAS
3018 KMP_RELEASE_TAS_LOCK(user_lock, gtid);
3020#elif KMP_USE_INLINED_FUTEX
3022 KMP_RELEASE_FUTEX_LOCK(user_lock, gtid);
3026 __kmp_direct_unset[tag]((kmp_dyna_lock_t *)user_lock, gtid);
3029#if OMPT_SUPPORT && OMPT_OPTIONAL
3031 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3036 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
3049#if KMP_OS_LINUX && \
3050 (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64)
3058#if OMPT_SUPPORT && OMPT_OPTIONAL
3060 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3065 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3085 __kmp_itt_lock_releasing(
lck);
3090#if OMPT_SUPPORT && OMPT_OPTIONAL
3092 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3097 ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3106#if KMP_USE_DYNAMIC_LOCK
3111 int release_status =
3112 KMP_D_LOCK_FUNC(user_lock, unset)((kmp_dyna_lock_t *)user_lock, gtid);
3113 (
void)release_status;
3115#if OMPT_SUPPORT && OMPT_OPTIONAL
3117 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3125 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock,
3131 ompt_scope_end, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
3143 (
sizeof(
lck->tas.lk.poll) +
sizeof(
lck->tas.lk.depth_locked) <=
3145#if KMP_OS_LINUX && \
3146 (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64)
3153#if OMPT_SUPPORT && OMPT_OPTIONAL
3159#if OMPT_SUPPORT && OMPT_OPTIONAL
3165#if OMPT_SUPPORT && OMPT_OPTIONAL
3167 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3175 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3180 ompt_mutex_scope_end, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3192 (
sizeof(
lck->futex.lk.poll) +
sizeof(
lck->futex.lk.depth_locked) <=
3202 __kmp_itt_lock_releasing(
lck);
3207#if OMPT_SUPPORT && OMPT_OPTIONAL
3209 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3217 ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3222 ompt_mutex_scope_end, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3234#if KMP_USE_DYNAMIC_LOCK
3236 int tag = KMP_EXTRACT_D_TAG(user_lock);
3240#if OMPT_SUPPORT && OMPT_OPTIONAL
3242 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3247 ompt_mutex_test_lock, omp_lock_hint_none,
3248 __ompt_get_mutex_impl_type(user_lock),
3249 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
3252#if KMP_USE_INLINED_TAS
3254 KMP_TEST_TAS_LOCK(user_lock, gtid, rc);
3256#elif KMP_USE_INLINED_FUTEX
3258 KMP_TEST_FUTEX_LOCK(user_lock, gtid, rc);
3262 rc = __kmp_direct_test[tag]((kmp_dyna_lock_t *)user_lock, gtid);
3268#if OMPT_SUPPORT && OMPT_OPTIONAL
3271 ompt_mutex_test_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
3302 __kmp_itt_lock_acquiring(
lck);
3304#if OMPT_SUPPORT && OMPT_OPTIONAL
3306 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3311 ompt_mutex_test_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
3312 (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3319 __kmp_itt_lock_acquired(
lck);
3321 __kmp_itt_lock_cancelled(
lck);
3324#if OMPT_SUPPORT && OMPT_OPTIONAL
3327 ompt_mutex_test_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3340#if KMP_USE_DYNAMIC_LOCK
3345#if OMPT_SUPPORT && OMPT_OPTIONAL
3347 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3352 ompt_mutex_test_nest_lock, omp_lock_hint_none,
3353 __ompt_get_mutex_impl_type(user_lock),
3354 (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
3357 rc = KMP_D_LOCK_FUNC(user_lock,
test)((kmp_dyna_lock_t *)user_lock, gtid);
3365#if OMPT_SUPPORT && OMPT_OPTIONAL
3371 ompt_mutex_test_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock,
3378 ompt_scope_begin, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
3391 (
sizeof(
lck->tas.lk.poll) +
sizeof(
lck->tas.lk.depth_locked) <=
3397 (
sizeof(
lck->futex.lk.poll) +
sizeof(
lck->futex.lk.depth_locked) <=
3407 __kmp_itt_lock_acquiring(
lck);
3410#if OMPT_SUPPORT && OMPT_OPTIONAL
3412 void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
3418 ompt_mutex_test_nest_lock, omp_lock_hint_none,
3419 __ompt_get_mutex_impl_type(), (ompt_wait_id_t)(uintptr_t)
lck,
3427 __kmp_itt_lock_acquired(
lck);
3429 __kmp_itt_lock_cancelled(
lck);
3432#if OMPT_SUPPORT && OMPT_OPTIONAL
3438 ompt_mutex_test_nest_lock, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3444 ompt_mutex_scope_begin, (ompt_wait_id_t)(uintptr_t)
lck, codeptr);
3463#define __KMP_SET_REDUCTION_METHOD(gtid, rmethod) \
3464 ((__kmp_threads[(gtid)]->th.th_local.packed_reduction_method) = (rmethod))
3466#define __KMP_GET_REDUCTION_METHOD(gtid) \
3467 (__kmp_threads[(gtid)]->th.th_local.packed_reduction_method)
3473static __forceinline
void
3483#if KMP_USE_DYNAMIC_LOCK
3485 kmp_dyna_lock_t *lk = (kmp_dyna_lock_t *)
crit;
3488 if (KMP_IS_D_LOCK(__kmp_user_lock_seq)) {
3490 KMP_GET_D_TAG(__kmp_user_lock_seq));
3492 __kmp_init_indirect_csptr(
crit,
loc, global_tid,
3493 KMP_GET_I_TAG(__kmp_user_lock_seq));
3499 if (KMP_EXTRACT_D_TAG(lk) != 0) {
3505 KMP_D_LOCK_FUNC(lk, set)(lk, global_tid);
3507 kmp_indirect_lock_t *ilk = *((kmp_indirect_lock_t **)lk);
3513 KMP_I_LOCK_FUNC(ilk, set)(
lck, global_tid);
3537static __forceinline
void
3543#if KMP_USE_DYNAMIC_LOCK
3545 if (KMP_IS_D_LOCK(__kmp_user_lock_seq)) {
3549 KMP_D_LOCK_FUNC(
lck, unset)((kmp_dyna_lock_t *)
lck, global_tid);
3551 kmp_indirect_lock_t *ilk =
3552 (kmp_indirect_lock_t *)
TCR_PTR(*((kmp_indirect_lock_t **)
crit));
3555 KMP_I_LOCK_FUNC(ilk, unset)(ilk->lock, global_tid);
3578static __forceinline
int
3584 if (th->th.th_teams_microtask) {
3585 *team_p = team = th->th.th_team;
3586 if (team->
t.t_level == th->th.th_teams_level) {
3590 th->th.th_info.ds.ds_tid = team->
t.t_master_tid;
3591 th->th.th_team = team->
t.t_parent;
3592 th->th.th_team_nproc = th->th.th_team->t.t_nproc;
3593 th->th.th_task_team = th->th.th_team->t.t_task_team[0];
3594 *task_state = th->th.th_task_state;
3595 th->th.th_task_state = 0;
3603static __forceinline
void
3606 th->th.th_info.ds.ds_tid = 0;
3607 th->th.th_team = team;
3608 th->th.th_team_nproc = team->
t.t_nproc;
3609 th->th.th_task_team = team->
t.t_task_team[task_state];
3631 size_t reduce_size,
void *reduce_data,
3632 void (*reduce_func)(
void *lhs_data,
void *rhs_data),
3640 int teams_swapped = 0, task_state;
3641 KA_TRACE(10, (
"__kmpc_reduce_nowait() enter: called T#%d\n", global_tid));
3656#if KMP_USE_DYNAMIC_LOCK
3684 loc, global_tid, num_vars, reduce_size, reduce_data, reduce_func,
lck);
3737 ompt_frame_t *ompt_frame;
3740 if (ompt_frame->enter_frame.ptr == NULL)
3743 OMPT_STORE_RETURN_ADDRESS(global_tid);
3750 global_tid,
FALSE, reduce_size, reduce_data, reduce_func);
3751 retval = (retval != 0) ? (0) : (1);
3752#if OMPT_SUPPORT && OMPT_OPTIONAL
3754 ompt_frame->enter_frame = ompt_data_none;
3771 if (teams_swapped) {
3776 (
"__kmpc_reduce_nowait() exit: called T#%d: method %08x, returns %08x\n",
3777 global_tid, packed_reduction_method, retval));
3795 KA_TRACE(10, (
"__kmpc_end_reduce_nowait() enter: called T#%d\n", global_tid));
3836 KA_TRACE(10, (
"__kmpc_end_reduce_nowait() exit: called T#%d: method %08x\n",
3837 global_tid, packed_reduction_method));
3860 size_t reduce_size,
void *reduce_data,
3861 void (*reduce_func)(
void *lhs_data,
void *rhs_data),
3868 int teams_swapped = 0, task_state;
3870 KA_TRACE(10, (
"__kmpc_reduce() enter: called T#%d\n", global_tid));
3885#if KMP_USE_DYNAMIC_LOCK
3897 loc, global_tid, num_vars, reduce_size, reduce_data, reduce_func,
lck);
3926 ompt_frame_t *ompt_frame;
3929 if (ompt_frame->enter_frame.ptr == NULL)
3932 OMPT_STORE_RETURN_ADDRESS(global_tid);
3940 global_tid,
TRUE, reduce_size, reduce_data, reduce_func);
3941 retval = (retval != 0) ? (0) : (1);
3942#if OMPT_SUPPORT && OMPT_OPTIONAL
3944 ompt_frame->enter_frame = ompt_data_none;
3961 if (teams_swapped) {
3966 (
"__kmpc_reduce() exit: called T#%d: method %08x, returns %08x\n",
3967 global_tid, packed_reduction_method, retval));
3987 int teams_swapped = 0, task_state;
3989 KA_TRACE(10, (
"__kmpc_end_reduce() enter: called T#%d\n", global_tid));
4008 ompt_frame_t *ompt_frame;
4011 if (ompt_frame->enter_frame.ptr == NULL)
4014 OMPT_STORE_RETURN_ADDRESS(global_tid);
4020#if OMPT_SUPPORT && OMPT_OPTIONAL
4022 ompt_frame->enter_frame = ompt_data_none;
4034 ompt_frame_t *ompt_frame;
4037 if (ompt_frame->enter_frame.ptr == NULL)
4040 OMPT_STORE_RETURN_ADDRESS(global_tid);
4046#if OMPT_SUPPORT && OMPT_OPTIONAL
4048 ompt_frame->enter_frame = ompt_data_none;
4055 ompt_frame_t *ompt_frame;
4058 if (ompt_frame->enter_frame.ptr == NULL)
4061 OMPT_STORE_RETURN_ADDRESS(global_tid);
4068#if OMPT_SUPPORT && OMPT_OPTIONAL
4070 ompt_frame->enter_frame = ompt_data_none;
4086 if (teams_swapped) {
4093 KA_TRACE(10, (
"__kmpc_end_reduce() exit: called T#%d: method %08x\n",
4094 global_tid, packed_reduction_method));
4099#undef __KMP_GET_REDUCTION_METHOD
4100#undef __KMP_SET_REDUCTION_METHOD
4114 return thread->th.th_current_task->td_task_id;
4129 parent_task = thread->th.th_current_task->
td_parent;
4130 return (parent_task == NULL ? 0 : parent_task->
td_task_id);
4158 (
"__kmpc_doacross_init() enter: called T#%d, num dims %d, active %d\n",
4159 gtid, num_dims, !team->
t.t_serialized));
4163 if (team->
t.t_serialized) {
4164 KA_TRACE(20, (
"__kmpc_doacross_init() exit: serialized team\n"));
4175 th,
sizeof(
kmp_int64) * (4 * num_dims + 1));
4186 for (
j = 1;
j < num_dims; ++
j) {
4189 if (dims[
j].st == 1) {
4191 range_length = dims[
j].
up - dims[
j].
lo + 1;
4193 if (dims[
j].st > 0) {
4195 range_length = (
kmp_uint64)(dims[
j].up - dims[
j].lo) / dims[
j].
st + 1;
4210 if (dims[0].st == 1) {
4211 trace_count = dims[0].
up - dims[0].
lo + 1;
4212 }
else if (dims[0].st > 0) {
4214 trace_count = (
kmp_uint64)(dims[0].up - dims[0].lo) / dims[0].
st + 1;
4217 trace_count = (
kmp_uint64)(dims[0].lo - dims[0].up) / (-dims[0].
st) + 1;
4219 for (
j = 1;
j < num_dims; ++
j) {
4241 if (flags == NULL) {
4244 (size_t)trace_count / 8 + 8;
4264 KA_TRACE(20, (
"__kmpc_doacross_init() exit: T#%d\n", gtid));
4278 KA_TRACE(20, (
"__kmpc_doacross_wait() enter: called T#%d\n", gtid));
4279 if (team->
t.t_serialized) {
4280 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: serialized team\n"));
4285 pr_buf = th->th.th_dispatch;
4291#
if OMPT_SUPPORT && OMPT_OPTIONAL
4295 if (vec[0] < lo || vec[0] > up) {
4296 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: T#%d iter %lld is out of "
4297 "bounds [%lld,%lld]\n",
4298 gtid, vec[0], lo, up));
4301 iter_number = vec[0] - lo;
4302 }
else if (st > 0) {
4303 if (vec[0] < lo || vec[0] > up) {
4304 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: T#%d iter %lld is out of "
4305 "bounds [%lld,%lld]\n",
4306 gtid, vec[0], lo, up));
4309 iter_number = (
kmp_uint64)(vec[0] - lo) / st;
4311 if (vec[0] > lo || vec[0] < up) {
4312 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: T#%d iter %lld is out of "
4313 "bounds [%lld,%lld]\n",
4314 gtid, vec[0], lo, up));
4317 iter_number = (
kmp_uint64)(lo - vec[0]) / (-st);
4319#if OMPT_SUPPORT && OMPT_OPTIONAL
4320 deps[0].variable.value = iter_number;
4321 deps[0].dependence_type = ompt_dependence_type_sink;
4323 for (
i = 1;
i < num_dims; ++
i) {
4331 if (vec[
i] < lo || vec[
i] > up) {
4332 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: T#%d iter %lld is out of "
4333 "bounds [%lld,%lld]\n",
4334 gtid, vec[
i], lo, up));
4338 }
else if (st > 0) {
4339 if (vec[
i] < lo || vec[
i] > up) {
4340 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: T#%d iter %lld is out of "
4341 "bounds [%lld,%lld]\n",
4342 gtid, vec[
i], lo, up));
4347 if (vec[
i] > lo || vec[
i] < up) {
4348 KA_TRACE(20, (
"__kmpc_doacross_wait() exit: T#%d iter %lld is out of "
4349 "bounds [%lld,%lld]\n",
4350 gtid, vec[
i], lo, up));
4355 iter_number = iter + ln * iter_number;
4356#if OMPT_SUPPORT && OMPT_OPTIONAL
4357 deps[
i].variable.value = iter;
4358 deps[
i].dependence_type = ompt_dependence_type_sink;
4361 shft = iter_number % 32;
4368#if OMPT_SUPPORT && OMPT_OPTIONAL
4371 &(OMPT_CUR_TASK_INFO(th)->task_data), deps, (
kmp_uint32)num_dims);
4375 (
"__kmpc_doacross_wait() exit: T#%d wait for iter %lld completed\n",
4376 gtid, (iter_number << 5) + shft));
4390 KA_TRACE(20, (
"__kmpc_doacross_post() enter: called T#%d\n", gtid));
4391 if (team->
t.t_serialized) {
4392 KA_TRACE(20, (
"__kmpc_doacross_post() exit: serialized team\n"));
4398 pr_buf = th->th.th_dispatch;
4403#
if OMPT_SUPPORT && OMPT_OPTIONAL
4407 iter_number = vec[0] - lo;
4408 }
else if (st > 0) {
4409 iter_number = (
kmp_uint64)(vec[0] - lo) / st;
4411 iter_number = (
kmp_uint64)(lo - vec[0]) / (-st);
4413#if OMPT_SUPPORT && OMPT_OPTIONAL
4414 deps[0].variable.value = iter_number;
4415 deps[0].dependence_type = ompt_dependence_type_source;
4417 for (
i = 1;
i < num_dims; ++
i) {
4425 }
else if (st > 0) {
4430 iter_number = iter + ln * iter_number;
4431#if OMPT_SUPPORT && OMPT_OPTIONAL
4432 deps[
i].variable.value = iter;
4433 deps[
i].dependence_type = ompt_dependence_type_source;
4436#if OMPT_SUPPORT && OMPT_OPTIONAL
4439 &(OMPT_CUR_TASK_INFO(th)->task_data), deps, (
kmp_uint32)num_dims);
4442 shft = iter_number % 32;
4448 KA_TRACE(20, (
"__kmpc_doacross_post() exit: T#%d iter %lld posted\n", gtid,
4449 (iter_number << 5) + shft));
4459 KA_TRACE(20, (
"__kmpc_doacross_fini() enter: called T#%d\n", gtid));
4460 if (team->
t.t_serialized) {
4461 KA_TRACE(20, (
"__kmpc_doacross_fini() exit: serialized team %p\n", team));
4466 if (num_done == th->th.th_team_nproc) {
4485 KA_TRACE(20, (
"__kmpc_doacross_fini() exit: T#%d\n", gtid));
4541 (ompt_severity_t)severity, message,
KMP_STRLEN(message),
4557 KMP_WARNING(UserDirectedWarning, src_loc, message);
4559 KMP_FATAL(UserDirectedError, src_loc, message);
4567#if OMPT_SUPPORT && OMPT_OPTIONAL
4572 ompt_work_scope, ompt_scope_begin,
4573 &(team->
t.ompt_team_info.parallel_data),
4574 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data), 1,
4583#if OMPT_SUPPORT && OMPT_OPTIONAL
4588 ompt_work_scope, ompt_scope_end,
4589 &(team->
t.ompt_team_info.parallel_data),
4590 &(team->
t.t_implicit_task_taskdata[tid].ompt_task_info.task_data), 1,
4596#ifdef KMP_USE_VERSION_SYMBOLS
4605#ifdef omp_set_affinity_format
4606#undef omp_set_affinity_format
4608#ifdef omp_get_affinity_format
4609#undef omp_get_affinity_format
4611#ifdef omp_display_affinity
4612#undef omp_display_affinity
4614#ifdef omp_capture_affinity
4615#undef omp_capture_affinity
A simple pure header implementation of VLA that aims to replace uses of actual VLA,...
@ KMP_IDENT_WORK_LOOP
To mark a static loop in OMPT callbacks.
@ KMP_IDENT_WORK_SECTIONS
To mark a sections directive in OMPT callbacks.
@ KMP_IDENT_AUTOPAR
Entry point generated by auto-parallelization.
@ KMP_IDENT_WORK_DISTRIBUTE
To mark a distribute construct in OMPT callbacks.
kmp_int32 __kmpc_ok_to_fork(ident_t *loc)
void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, kmpc_micro microtask,...)
void __kmpc_fork_call_if(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, kmp_int32 cond, void *args)
void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads)
void __kmpc_set_thread_limit(ident_t *loc, kmp_int32 global_tid, kmp_int32 thread_limit)
void __kmpc_serialized_parallel(ident_t *loc, kmp_int32 global_tid)
void __kmpc_push_num_threads_list(ident_t *loc, kmp_int32 global_tid, kmp_uint32 list_length, kmp_int32 *num_threads_list)
void __kmpc_push_num_teams(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_teams, kmp_int32 num_threads)
void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro microtask,...)
void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid)
void __kmpc_push_num_teams_51(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_teams_lb, kmp_int32 num_teams_ub, kmp_int32 num_threads)
void __kmpc_begin(ident_t *loc, kmp_int32 flags)
void __kmpc_end(ident_t *loc)
void __kmpc_end_reduce(ident_t *loc, kmp_int32 global_tid, kmp_critical_name *lck)
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)
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_barrier(ident_t *loc, kmp_int32 global_tid)
void __kmpc_flush(ident_t *loc)
kmp_int32 __kmpc_barrier_master(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_copyprivate(ident_t *loc, kmp_int32 gtid, size_t cpy_size, void *cpy_data, void(*cpy_func)(void *, void *), kmp_int32 didit)
void * __kmpc_copyprivate_light(ident_t *loc, kmp_int32 gtid, void *cpy_data)
kmp_int32 __kmpc_global_num_threads(ident_t *loc)
kmp_int32 __kmpc_global_thread_num(ident_t *loc)
kmp_int32 __kmpc_in_parallel(ident_t *loc)
kmp_int32 __kmpc_bound_thread_num(ident_t *loc)
kmp_int32 __kmpc_bound_num_threads(ident_t *loc)
void __kmpc_end_ordered(ident_t *loc, kmp_int32 gtid)
void __kmpc_end_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name *crit)
void __kmpc_for_static_fini(ident_t *loc, kmp_int32 global_tid)
void __kmpc_end_masked(ident_t *loc, kmp_int32 global_tid)
kmp_int32 __kmpc_master(ident_t *loc, kmp_int32 global_tid)
kmp_int32 __kmpc_single(ident_t *loc, kmp_int32 global_tid)
void __kmpc_doacross_init(ident_t *loc, int gtid, int num_dims, const struct kmp_dim *dims)
void __kmpc_end_master(ident_t *loc, kmp_int32 global_tid)
void __kmpc_end_single(ident_t *loc, kmp_int32 global_tid)
void __kmpc_ordered(ident_t *loc, kmp_int32 gtid)
kmp_int32 __kmpc_masked(ident_t *loc, kmp_int32 global_tid, kmp_int32 filter)
void __kmpc_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name *crit)
__itt_string_handle * name
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int mask
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t size
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark d int
int __kmp_pause_resource(kmp_pause_status_t level)
void * omp_allocator_handle_t
void __kmp_aux_set_defaults(char const *str, size_t len)
void __kmp_set_schedule(int gtid, kmp_sched_t new_sched, int chunk)
void __kmp_teams_master(int gtid)
#define UNPACK_REDUCTION_BARRIER(packed_reduction_method)
void __kmp_pop_task_team_node(kmp_info_t *thread, kmp_team_t *team)
int __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, void *reduce_data, void(*reduce)(void *, void *))
struct KMP_ALIGN_CACHE dispatch_private_info dispatch_private_info_t
void ___kmpc_free(int gtid, void *ptr, omp_allocator_handle_t al)
void __kmp_push_num_teams_51(ident_t *loc, int gtid, int num_teams_lb, int num_teams_ub, int num_threads)
#define __kmp_assign_root_init_mask()
int __kmp_dflt_max_active_levels
static kmp_team_t * __kmp_team_from_gtid(int gtid)
kmp_tasking_mode_t __kmp_tasking_mode
char * __kmp_affinity_format
void * __kmp_alloc(int gtid, size_t align, size_t sz, omp_allocator_handle_t al)
void * __kmp_calloc(int gtid, size_t align, size_t nmemb, size_t sz, omp_allocator_handle_t al)
@ fork_context_intel
Called from Intel generated code.
void __kmp_exit_single(int gtid)
int __kmp_get_team_size(int gtid, int level)
kmp_uint32 __kmp_eq_4(kmp_uint32 value, kmp_uint32 checker)
volatile int __kmp_all_nth
kmp_target_offload_kind_t __kmp_target_offload
void __kmp_parallel_dxo(int *gtid_ref, int *cid_ref, ident_t *loc_ref)
KMP_EXPORT void __kmpc_critical_with_hint(ident_t *, kmp_int32 global_tid, kmp_critical_name *, uint32_t hint)
void __kmp_push_num_threads(ident_t *loc, int gtid, int num_threads)
#define set__dynamic(xthread, xval)
#define __kmp_entry_gtid()
void __kmp_internal_end_library(int gtid)
void __kmp_set_max_active_levels(int gtid, int new_max_active_levels)
static int __kmp_tid_from_gtid(int gtid)
void __kmp_internal_end_thread(int gtid)
void __kmp_push_num_threads_list(ident_t *loc, int gtid, kmp_uint32 list_length, int *num_threads_list)
void __kmp_user_set_library(enum library_type arg)
KMP_EXPORT void __kmpc_init_nest_lock_with_hint(ident_t *loc, kmp_int32 gtid, void **user_lock, uintptr_t hint)
int __kmp_gtid_get_specific(void)
volatile int __kmp_init_middle
void __kmp_set_num_threads(int new_nth, int gtid)
PACKED_REDUCTION_METHOD_T __kmp_determine_reduction_method(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 * __kmp_realloc(int gtid, void *ptr, size_t sz, omp_allocator_handle_t al, omp_allocator_handle_t free_al)
void __kmp_end_split_barrier(enum barrier_type bt, int gtid)
int PACKED_REDUCTION_METHOD_T
int __kmp_enter_single(int gtid, ident_t *id_ref, int push_ws)
static kmp_info_t * __kmp_entry_thread()
int __kmp_get_ancestor_thread_num(int gtid, int level)
#define __kmp_thread_malloc(th, size)
void __kmp_middle_initialize(void)
static void copy_icvs(kmp_internal_control_t *dst, kmp_internal_control_t *src)
kmp_info_t ** __kmp_threads
#define TEST_REDUCTION_METHOD(packed_reduction_method, which_reduction_block)
static void __kmp_reset_root_init_mask(int gtid)
void __kmp_parallel_deo(int *gtid_ref, int *cid_ref, ident_t *loc_ref)
int __kmp_dispatch_num_buffers
#define set__max_active_levels(xthread, xval)
#define KMP_MASTER_GTID(gtid)
void __kmp_parallel_initialize(void)
int(* launch_t)(int gtid)
int __kmp_ignore_mppbeg(void)
volatile int __kmp_init_parallel
enum kmp_sched kmp_sched_t
void __kmp_aux_set_stacksize(size_t arg)
static const size_t KMP_AFFINITY_FORMAT_SIZE
void __kmp_push_num_teams(ident_t *loc, int gtid, int num_teams, int num_threads)
size_t __kmp_aux_capture_affinity(int gtid, const char *format, kmp_str_buf_t *buffer)
int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e fork_context, kmp_int32 argc, microtask_t microtask, launch_t invoker, kmp_va_list ap)
int __kmp_env_consistency_check
void __kmp_aux_display_affinity(int gtid, const char *format)
void __kmp_push_proc_bind(ident_t *loc, int gtid, kmp_proc_bind_t proc_bind)
int __kmp_invoke_task_func(int gtid)
void __kmp_set_strict_num_threads(ident_t *loc, int gtid, int sev, const char *msg)
#define __kmp_thread_calloc(th, nelem, elsize)
void __kmp_save_internal_controls(kmp_info_t *thread)
int __kmp_invoke_teams_master(int gtid)
static void __kmp_aux_convert_blocktime(int *bt)
void __kmp_serial_initialize(void)
kmp_uint32 __kmp_wait_4(kmp_uint32 volatile *spinner, kmp_uint32 checker, kmp_uint32(*pred)(kmp_uint32, kmp_uint32), void *obj)
void __kmp_resume_if_soft_paused()
KMP_EXPORT void __kmpc_init_lock_with_hint(ident_t *loc, kmp_int32 gtid, void **user_lock, uintptr_t hint)
static void __kmp_assert_valid_gtid(kmp_int32 gtid)
void __kmp_serialized_parallel(ident_t *id, kmp_int32 gtid)
void __kmp_pop_current_task_from_thread(kmp_info_t *this_thr)
void __kmp_internal_begin(void)
static kmp_info_t * __kmp_thread_from_gtid(int gtid)
#define KMP_MIN_DISP_NUM_BUFF
volatile int __kmp_init_serial
#define KMP_MAX_DISP_NUM_BUFF
int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int npr, int argc, void *argv[])
static void __kmp_type_convert(T1 src, T2 *dest)
void __kmp_join_call(ident_t *loc, int gtid, int exit_teams=0)
int __kmp_ignore_mppend(void)
union KMP_ALIGN_CACHE kmp_info kmp_info_t
void __kmp_task_team_wait(kmp_info_t *this_thr, kmp_team_t *team, int wait=1)
void __kmp_aux_set_blocktime(int arg, kmp_info_t *thread, int tid)
#define __kmp_thread_free(th, ptr)
static kmp_user_lock_p __kmp_get_critical_section_ptr(kmp_critical_name *crit, ident_t const *loc, kmp_int32 gtid)
void ompc_set_dynamic(int flag)
int kmpc_unset_affinity_mask_proc(int proc, void **mask)
#define __KMP_GET_REDUCTION_METHOD(gtid)
void __kmpc_unset_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void * omp_aligned_calloc(size_t align, size_t nmemb, size_t size, omp_allocator_handle_t allocator)
void __kmpc_destroy_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void __kmpc_doacross_post(ident_t *loc, int gtid, const kmp_int64 *vec)
void * omp_calloc(size_t nmemb, size_t size, omp_allocator_handle_t allocator)
void kmpc_set_disp_num_buffers(int arg)
static __forceinline int __kmp_swap_teams_for_teams_reduction(kmp_info_t *th, kmp_team_t **team_p, int *task_state)
int ompc_get_ancestor_thread_num(int level)
void KMP_EXPAND_NAME() ompc_set_affinity_format(char const *format)
void kmpc_set_stacksize_s(size_t arg)
void KMP_EXPAND_NAME() ompc_display_affinity(char const *format)
void __kmpc_push_num_threads_strict(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads, int severity, const char *message)
void __kmpc_scope(ident_t *loc, kmp_int32 gtid, void *reserved)
static __forceinline void __kmp_end_critical_section_reduce_block(ident_t *loc, kmp_int32 global_tid, kmp_critical_name *crit)
int kmpc_set_affinity_mask_proc(int proc, void **mask)
void kmpc_set_library(int arg)
void __kmpc_set_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void __kmpc_push_num_threads_list_strict(ident_t *loc, kmp_int32 global_tid, kmp_uint32 list_length, kmp_int32 *num_threads_list, int severity, const char *message)
void kmpc_set_stacksize(int arg)
#define DESTROY_NESTED_LOCK
void ompc_set_schedule(omp_sched_t kind, int modifier)
void __kmpc_error(ident_t *loc, int severity, const char *message)
void * omp_aligned_alloc(size_t align, size_t size, omp_allocator_handle_t allocator)
void kmpc_set_blocktime(int arg)
#define __KMP_SET_REDUCTION_METHOD(gtid, rmethod)
void kmpc_set_defaults(char const *str)
void __kmpc_end_scope(ident_t *loc, kmp_int32 gtid, void *reserved)
void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void omp_free(void *ptr, omp_allocator_handle_t allocator)
void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void * omp_realloc(void *ptr, size_t size, omp_allocator_handle_t allocator, omp_allocator_handle_t free_allocator)
kmp_uint64 __kmpc_get_taskid()
int ompc_get_team_size(int level)
size_t KMP_EXPAND_NAME() ompc_get_affinity_format(char *buffer, size_t size)
int kmpc_get_affinity_mask_proc(int proc, void **mask)
void __kmpc_doacross_fini(ident_t *loc, int gtid)
#define RELEASE_NESTED_LOCK
int __kmpc_test_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void __kmpc_destroy_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
static __forceinline void __kmp_restore_swapped_teams(kmp_info_t *th, kmp_team_t *team, int task_state)
void __kmpc_pop_num_threads(ident_t *loc, kmp_int32 global_tid)
int __kmpc_invoke_task_func(int gtid)
void __kmpc_unset_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
void __kmpc_push_proc_bind(ident_t *loc, kmp_int32 global_tid, kmp_int32 proc_bind)
void __kmpc_init_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
#define ACQUIRE_NESTED_LOCK
void ompc_set_nested(int flag)
size_t KMP_EXPAND_NAME() ompc_capture_affinity(char *buffer, size_t buf_size, char const *format)
static __forceinline void __kmp_enter_critical_section_reduce_block(ident_t *loc, kmp_int32 global_tid, kmp_critical_name *crit)
void ompc_set_max_active_levels(int max_active_levels)
kmp_uint64 __kmpc_get_parent_taskid()
void ompc_set_num_threads(int arg)
void * omp_alloc(size_t size, omp_allocator_handle_t allocator)
void __kmpc_doacross_wait(ident_t *loc, int gtid, const kmp_int64 *vec)
int __kmpc_get_target_offload(void)
int __kmpc_pause_resource(kmp_pause_status_t level)
int __kmpc_test_lock(ident_t *loc, kmp_int32 gtid, void **user_lock)
#define KMP_DEBUG_ASSERT(cond)
unsigned long long kmp_uint64
void __kmp_push_sync(int gtid, enum cons_type ct, ident_t const *ident, kmp_user_lock_p lck)
void __kmp_check_sync(int gtid, enum cons_type ct, ident_t const *ident, kmp_user_lock_p lck)
enum cons_type __kmp_pop_workshare(int gtid, enum cons_type ct, ident_t const *ident)
void __kmp_pop_sync(int gtid, enum cons_type ct, ident_t const *ident)
void __kmp_check_barrier(int gtid, enum cons_type ct, ident_t const *ident)
void __kmp_pop_parallel(int gtid, ident_t const *ident)
static volatile kmp_i18n_cat_status_t status
static kmp_bootstrap_lock_t lock
#define USE_ITT_BUILD_ARG(x)
size_t __kmp_base_user_lock_size
enum kmp_lock_kind __kmp_user_lock_kind
kmp_user_lock_p __kmp_user_lock_allocate(void **user_lock, kmp_int32 gtid, kmp_lock_flags_t flags)
void __kmp_user_lock_free(void **user_lock, kmp_int32 gtid, kmp_user_lock_p lck)
kmp_user_lock_p __kmp_lookup_user_lock(void **user_lock, char const *func)
#define INTEL_CRITICAL_SIZE
#define OMP_NEST_LOCK_T_SIZE
#define KMP_CHECK_USER_LOCK_INIT()
static void __kmp_release_user_lock_with_checks(kmp_user_lock_p lck, kmp_int32 gtid)
union kmp_user_lock * kmp_user_lock_p
static int __kmp_acquire_user_lock_with_checks(kmp_user_lock_p lck, kmp_int32 gtid)
#define KMP_LOCK_RELEASED
static void __kmp_destroy_user_lock_with_checks(kmp_user_lock_p lck)
static void __kmp_init_user_lock_with_checks(kmp_user_lock_p lck)
#define kmp_lf_critical_section
static void __kmp_set_user_lock_location(kmp_user_lock_p lck, const ident_t *loc)
#define KMP_LOCK_ACQUIRED_FIRST
#define OMP_CRITICAL_SIZE
#define KMP_LOCK_STILL_HELD
#define KMP_COMPARE_AND_STORE_RET64(p, cv, sv)
void(* microtask_t)(int *gtid, int *npr,...)
#define KMP_TEST_THEN_OR32(p, v)
#define KMP_TEST_THEN_INC32(p)
#define KMP_COMPARE_AND_STORE_RET32(p, cv, sv)
#define KMP_VERSION_OMPC_SYMBOL(apic_name, api_name, ver_num, ver_str)
#define kmp_va_addr_of(ap)
#define KMP_COMPARE_AND_STORE_ACQ32(p, cv, sv)
unsigned long kmp_uintptr_t
#define KMP_EXPAND_NAME(api_name)
#define KMP_COMPARE_AND_STORE_PTR(p, cv, sv)
static void __kmp_strncpy_truncate(char *buffer, size_t buf_size, char const *src, size_t src_size)
Functions for collecting statistics.
#define KMP_PUSH_PARTITIONED_TIMER(name)
#define KMP_GET_THREAD_STATE()
#define KMP_POP_PARTITIONED_TIMER()
#define KMP_COUNT_BLOCK(n)
#define KMP_SET_THREAD_STATE(state_name)
kmp_str_loc_t __kmp_str_loc_init(char const *psource, bool init_fname)
void __kmp_str_buf_free(kmp_str_buf_t *buffer)
char * __kmp_str_format(char const *format,...)
int __kmp_str_match_true(char const *data)
void __kmp_str_loc_free(kmp_str_loc_t *loc)
void __kmp_str_free(char **str)
#define __kmp_str_buf_init(b)
#define omp_get_affinity_format
#define omp_set_affinity_format
#define omp_display_affinity
#define omp_capture_affinity
void microtask(int *global_tid, int *bound_tid)
int test(unsigned upper_bound)
ompt_callbacks_active_t ompt_enabled
ompt_callbacks_internal_t ompt_callbacks
#define OMPT_GET_RETURN_ADDRESS(level)
#define OMPT_GET_FRAME_ADDRESS(level)
ompt_team_info_t * __ompt_get_teaminfo(int depth, int *size)
int __ompt_get_task_info_internal(int ancestor_level, int *type, ompt_data_t **task_data, ompt_frame_t **task_frame, ompt_data_t **parallel_data, int *thread_num)
ompt_task_info_t * __ompt_get_task_info_object(int depth)
void __ompt_lw_taskteam_unlink(kmp_info_t *thr)
ompt_data_t * __ompt_get_thread_data_internal()
#define OMPT_REDUCTION_BEGIN
#define OMPT_REDUCTION_DECL(this_thr, gtid)
#define OMPT_REDUCTION_END
kmp_int32 doacross_num_done
volatile kmp_int32 doacross_buf_idx
volatile kmp_uint32 * doacross_flags
std::atomic< kmp_int32 > poll
kmp_int32 tt_found_proxy_tasks
kmp_int32 tt_hidden_helper_task_encountered
kmp_int32 th_doacross_buf_idx
volatile kmp_uint32 * th_doacross_flags
kmp_int64 * th_doacross_info
struct kmp_internal_control * next
kmp_taskdata_t * td_parent
ompt_data_t parallel_data