kmp_gsupport.c File Reference

#include "kmp.h"
#include "kmp_atomic.h"
#include "ompt-specific.h"

Go to the source code of this file.

Defines

#define KMP_DISPATCH_FINI_CHUNK   __kmp_aux_dispatch_fini_chunk_8
#define KMP_DISPATCH_FINI_CHUNK_ULL   __kmp_aux_dispatch_fini_chunk_8u
#define KMP_DISPATCH_INIT   __kmp_aux_dispatch_init_8
#define KMP_DISPATCH_INIT_ULL   __kmp_aux_dispatch_init_8u
#define KMP_DISPATCH_NEXT   __kmpc_dispatch_next_8
#define KMP_DISPATCH_NEXT_ULL   __kmpc_dispatch_next_8u
#define LOOP_NEXT(func, fini_code)
#define LOOP_NEXT_ULL(func, fini_code)
#define LOOP_RUNTIME_START(func, schedule)
#define LOOP_RUNTIME_START_ULL(func, schedule)
#define LOOP_START(func, schedule)
#define LOOP_START_ULL(func, schedule)
#define MKLOC(loc, routine)   static ident_t (loc) = {0, KMP_IDENT_KMPC, 0, 0, ";unknown;unknown;0;0;;" };
#define PARALLEL_LOOP_START(func, schedule)

Functions

void __kmp_GOMP_fork_call (ident_t *loc, int gtid, microtask_t wrapper, int argc,...)
void __kmp_GOMP_microtask_wrapper (int *gtid, int *npr, void(*task)(void *), void *data)
void __kmp_GOMP_parallel_microtask_wrapper (int *gtid, int *npr, void(*task)(void *), void *data, unsigned num_threads, ident_t *loc, enum sched_type schedule, long start, long end, long incr, long chunk_size)
void GOMP_atomic_end (void)
void GOMP_atomic_start (void)
void GOMP_barrier (void)
void GOMP_critical_end (void)
void GOMP_critical_name_end (void **pptr)
void GOMP_critical_name_start (void **pptr)
void GOMP_critical_start (void)
void GOMP_loop_end (void)
void GOMP_loop_end_nowait (void)
void GOMP_ordered_end (void)
void GOMP_ordered_start (void)
void GOMP_parallel_end (void)
void GOMP_parallel_sections_start (void(*task)(void *), void *data, unsigned num_threads, unsigned count)
void GOMP_parallel_start (void(*task)(void *), void *data, unsigned num_threads)
void GOMP_sections_end (void)
void GOMP_sections_end_nowait (void)
unsigned GOMP_sections_next (void)
unsigned GOMP_sections_start (unsigned count)
void GOMP_single_copy_end (void *data)
void * GOMP_single_copy_start (void)
int GOMP_single_start (void)
 LOOP_NEXT (GOMP_loop_ordered_guided_next)
 LOOP_NEXT (GOMP_loop_ordered_static_next)
 LOOP_NEXT_ULL (GOMP_loop_ull_ordered_guided_next)
 LOOP_NEXT_ULL (GOMP_loop_ull_ordered_static_next)

Variables

kmp_critical_name__kmp_unnamed_critical_addr

Define Documentation

#define KMP_DISPATCH_FINI_CHUNK   __kmp_aux_dispatch_fini_chunk_8

Definition at line 263 of file kmp_gsupport.c.

Referenced by LOOP_NEXT().

#define KMP_DISPATCH_FINI_CHUNK_ULL   __kmp_aux_dispatch_fini_chunk_8u

Definition at line 268 of file kmp_gsupport.c.

Referenced by LOOP_NEXT_ULL().

#define KMP_DISPATCH_INIT   __kmp_aux_dispatch_init_8
#define KMP_DISPATCH_INIT_ULL   __kmp_aux_dispatch_init_8u

Definition at line 267 of file kmp_gsupport.c.

#define KMP_DISPATCH_NEXT   __kmpc_dispatch_next_8

Definition at line 264 of file kmp_gsupport.c.

Referenced by GOMP_sections_next(), and GOMP_sections_start().

#define KMP_DISPATCH_NEXT_ULL   __kmpc_dispatch_next_8u

Definition at line 269 of file kmp_gsupport.c.

#define LOOP_NEXT ( func,
fini_code   ) 
Value:
int func(long *p_lb, long *p_ub)                                         \
    {                                                                        \
        int status;                                                          \
        long stride;                                                         \
        int gtid = __kmp_get_gtid();                                         \
        MKLOC(loc, #func);                                                   \
        KA_TRACE(20, ( #func ": T#%d\n", gtid));                             \
                                                                             \
        fini_code                                                            \
        status = KMP_DISPATCH_NEXT(&loc, gtid, NULL, (kmp_int *)p_lb,        \
          (kmp_int *)p_ub, (kmp_int *)&stride);                              \
        if (status) {                                                        \
            *p_ub += (stride > 0) ? 1 : -1;                                  \
        }                                                                    \
                                                                             \
        KA_TRACE(20, ( #func " exit: T#%d, *p_lb 0x%lx, *p_ub 0x%lx, stride 0x%lx, "  \
          "returning %d\n", gtid, *p_lb, *p_ub, stride, status));            \
        return status;                                                       \
    }

Definition at line 469 of file kmp_gsupport.c.

#define LOOP_NEXT_ULL ( func,
fini_code   ) 
Value:
int func(unsigned long long *p_lb, unsigned long long *p_ub)             \
    {                                                                        \
        int status;                                                          \
        long long stride;                                                    \
        int gtid = __kmp_get_gtid();                                         \
        MKLOC(loc, #func);                                                   \
        KA_TRACE(20, ( #func ": T#%d\n", gtid));                             \
                                                                             \
        fini_code                                                            \
        status = KMP_DISPATCH_NEXT_ULL(&loc, gtid, NULL, (kmp_uint64 *)p_lb, \
          (kmp_uint64 *)p_ub, (kmp_int64 *)&stride);                         \
        if (status) {                                                        \
            *p_ub += (stride > 0) ? 1 : -1;                                  \
        }                                                                    \
                                                                             \
        KA_TRACE(20, ( #func " exit: T#%d, *p_lb 0x%llx, *p_ub 0x%llx, stride 0x%llx, " \
          "returning %d\n", gtid, *p_lb, *p_ub, stride, status));            \
        return status;                                                       \
    }

Definition at line 610 of file kmp_gsupport.c.

#define LOOP_RUNTIME_START ( func,
schedule   ) 
Value:
int func (long lb, long ub, long str, long *p_lb, long *p_ub)            \
    {                                                                        \
        int status;                                                          \
        long stride;                                                         \
        long chunk_sz = 0;                                                   \
        int gtid = __kmp_entry_gtid();                                       \
        MKLOC(loc, #func);                                                   \
        KA_TRACE(20, ( #func ": T#%d, lb 0x%lx, ub 0x%lx, str 0x%lx, chunk_sz %d\n",  \
          gtid, lb, ub, str, chunk_sz ));                                    \
                                                                             \
        if ((str > 0) ? (lb < ub) : (lb > ub)) {                             \
            KMP_DISPATCH_INIT(&loc, gtid, (schedule), lb,                    \
              (str > 0) ? (ub - 1) : (ub + 1), str, chunk_sz, TRUE);         \
            status = KMP_DISPATCH_NEXT(&loc, gtid, NULL, (kmp_int *)p_lb,    \
              (kmp_int *)p_ub, (kmp_int *)&stride);                          \
            if (status) {                                                    \
                KMP_DEBUG_ASSERT(stride == str);                             \
                *p_ub += (str > 0) ? 1 : -1;                                 \
            }                                                                \
        }                                                                    \
        else {                                                               \
            status = 0;                                                      \
        }                                                                    \
                                                                             \
        KA_TRACE(20, ( #func " exit: T#%d, *p_lb 0x%lx, *p_ub 0x%lx, returning %d\n", \
          gtid, *p_lb, *p_ub, status));                                      \
        return status;                                                       \
    }

Definition at line 438 of file kmp_gsupport.c.

#define LOOP_RUNTIME_START_ULL ( func,
schedule   ) 

Definition at line 575 of file kmp_gsupport.c.

#define LOOP_START ( func,
schedule   ) 
Value:
int func (long lb, long ub, long str, long chunk_sz, long *p_lb,         \
      long *p_ub)                                                            \
    {                                                                        \
        int status;                                                          \
        long stride;                                                         \
        int gtid = __kmp_entry_gtid();                                       \
        MKLOC(loc, #func);                                                   \
        KA_TRACE(20, ( #func ": T#%d, lb 0x%lx, ub 0x%lx, str 0x%lx, chunk_sz 0x%lx\n",  \
          gtid, lb, ub, str, chunk_sz ));                                    \
                                                                             \
        if ((str > 0) ? (lb < ub) : (lb > ub)) {                             \
            KMP_DISPATCH_INIT(&loc, gtid, (schedule), lb,                    \
              (str > 0) ? (ub - 1) : (ub + 1), str, chunk_sz,                \
              (schedule) != kmp_sch_static);                                 \
            status = KMP_DISPATCH_NEXT(&loc, gtid, NULL, (kmp_int *)p_lb,    \
              (kmp_int *)p_ub, (kmp_int *)&stride);                          \
            if (status) {                                                    \
                KMP_DEBUG_ASSERT(stride == str);                             \
                *p_ub += (str > 0) ? 1 : -1;                                 \
            }                                                                \
        }                                                                    \
        else {                                                               \
            status = 0;                                                      \
        }                                                                    \
                                                                             \
        KA_TRACE(20, ( #func " exit: T#%d, *p_lb 0x%lx, *p_ub 0x%lx, returning %d\n", \
          gtid, *p_lb, *p_ub, status));                                      \
        return status;                                                       \
    }

Definition at line 406 of file kmp_gsupport.c.

#define LOOP_START_ULL ( func,
schedule   ) 

Definition at line 540 of file kmp_gsupport.c.

#define MKLOC ( loc,
routine   )     static ident_t (loc) = {0, KMP_IDENT_KMPC, 0, 0, ";unknown;unknown;0;0;;" };
#define PARALLEL_LOOP_START ( func,
schedule   ) 
Value:
void func (void (*task) (void *), void *data, unsigned num_threads,      \
      long lb, long ub, long str, long chunk_sz)                             \
    {                                                                        \
        int gtid = __kmp_entry_gtid();                                       \
        int last = FALSE;                                                    \
        MKLOC(loc, #func);                                                   \
        KA_TRACE(20, ( #func ": T#%d, lb 0x%lx, ub 0x%lx, str 0x%lx, chunk_sz 0x%lx\n",        \
          gtid, lb, ub, str, chunk_sz ));                                    \
                                                                             \
        if (__kmpc_ok_to_fork(&loc) && (num_threads != 1)) {                 \
            if (num_threads != 0) {                                          \
                __kmp_push_num_threads(&loc, gtid, num_threads);             \
            }                                                                \
            __kmp_GOMP_fork_call(&loc, gtid,                                 \
              (microtask_t)__kmp_GOMP_parallel_microtask_wrapper, 9,         \
              task, data, num_threads, &loc, (schedule), lb,                 \
              (str > 0) ? (ub - 1) : (ub + 1), str, chunk_sz);               \
        }                                                                    \
        else {                                                               \
            __kmpc_serialized_parallel(&loc, gtid);                          \
        }                                                                    \
                                                                             \
        KMP_DISPATCH_INIT(&loc, gtid, (schedule), lb,                        \
          (str > 0) ? (ub - 1) : (ub + 1), str, chunk_sz,                    \
          (schedule) != kmp_sch_static);                                     \
                                                                             \
        KA_TRACE(20, ( #func " exit: T#%d\n", gtid));                        \
    }

Definition at line 662 of file kmp_gsupport.c.


Function Documentation

void __kmp_GOMP_fork_call ( ident_t loc,
int  gtid,
microtask_t  wrapper,
int  argc,
  ... 
)
void __kmp_GOMP_microtask_wrapper ( int *  gtid,
int *  npr,
void(*)(void *)  task,
void *  data 
)

Definition at line 281 of file kmp_gsupport.c.

Referenced by GOMP_parallel_start().

void __kmp_GOMP_parallel_microtask_wrapper ( int *  gtid,
int *  npr,
void(*)(void *)  task,
void *  data,
unsigned  num_threads,
ident_t loc,
enum sched_type  schedule,
long  start,
long  end,
long  incr,
long  chunk_size 
)

Definition at line 292 of file kmp_gsupport.c.

References KMP_DISPATCH_INIT, and kmp_sch_static.

Referenced by GOMP_parallel_sections_start().

void GOMP_atomic_end ( void   ) 
void GOMP_atomic_start ( void   ) 
void GOMP_barrier ( void   ) 

Definition at line 63 of file kmp_gsupport.c.

References __kmp_entry_gtid, __kmpc_barrier(), KA_TRACE, and MKLOC.

void GOMP_critical_end ( void   ) 

Definition at line 101 of file kmp_gsupport.c.

References __kmp_get_gtid, __kmpc_end_critical(), KA_TRACE, and MKLOC.

void GOMP_critical_name_end ( void **  pptr  ) 

Definition at line 121 of file kmp_gsupport.c.

References __kmp_get_gtid, __kmpc_end_critical(), KA_TRACE, and MKLOC.

void GOMP_critical_name_start ( void **  pptr  ) 

Definition at line 111 of file kmp_gsupport.c.

References __kmp_entry_gtid, __kmpc_critical(), KA_TRACE, and MKLOC.

void GOMP_critical_start ( void   ) 

Definition at line 91 of file kmp_gsupport.c.

References __kmp_entry_gtid, __kmpc_critical(), KA_TRACE, and MKLOC.

void GOMP_loop_end ( void   ) 

Definition at line 515 of file kmp_gsupport.c.

References __kmp_barrier(), __kmp_get_gtid, bs_plain_barrier, FALSE, and KA_TRACE.

void GOMP_loop_end_nowait ( void   ) 

Definition at line 527 of file kmp_gsupport.c.

References __kmp_get_gtid, and KA_TRACE.

void GOMP_ordered_end ( void   ) 

Definition at line 240 of file kmp_gsupport.c.

References __kmp_get_gtid, __kmpc_end_ordered(), KA_TRACE, and MKLOC.

void GOMP_ordered_start ( void   ) 

Definition at line 230 of file kmp_gsupport.c.

References __kmp_entry_gtid, __kmpc_ordered(), KA_TRACE, and MKLOC.

void GOMP_parallel_end ( void   ) 
void GOMP_parallel_sections_start ( void(*)(void *)  task,
void *  data,
unsigned  num_threads,
unsigned  count 
)
void GOMP_parallel_start ( void(*)(void *)  task,
void *  data,
unsigned  num_threads 
)
void GOMP_sections_end ( void   ) 

Definition at line 873 of file kmp_gsupport.c.

References __kmp_barrier(), __kmp_get_gtid, bs_plain_barrier, FALSE, and KA_TRACE.

void GOMP_sections_end_nowait ( void   ) 

Definition at line 885 of file kmp_gsupport.c.

References __kmp_get_gtid, and KA_TRACE.

unsigned GOMP_sections_next ( void   ) 
unsigned GOMP_sections_start ( unsigned  count  ) 
void GOMP_single_copy_end ( void *  data  ) 
void* GOMP_single_copy_start ( void   ) 
int GOMP_single_start ( void   ) 
LOOP_NEXT ( GOMP_loop_ordered_guided_next   ) 

Definition at line 507 of file kmp_gsupport.c.

References KMP_DISPATCH_FINI_CHUNK.

LOOP_NEXT ( GOMP_loop_ordered_static_next   ) 

Definition at line 501 of file kmp_gsupport.c.

References KMP_DISPATCH_FINI_CHUNK.

LOOP_NEXT_ULL ( GOMP_loop_ull_ordered_guided_next   ) 

Definition at line 648 of file kmp_gsupport.c.

References KMP_DISPATCH_FINI_CHUNK_ULL.

LOOP_NEXT_ULL ( GOMP_loop_ull_ordered_static_next   ) 

Definition at line 642 of file kmp_gsupport.c.

References KMP_DISPATCH_FINI_CHUNK_ULL.


Variable Documentation


Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1