OpenMP Runtime
Functions | Variables
tomp_parallel.c File Reference

Implements GOMP_parallel_[start|end]. More...

#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
#include "omp.h"
#include "tomp_parallel.h"
#include "tomp_log.h"
Include dependency graph for tomp_parallel.c:

Functions

void tomp_eoStartLoopX (tomp_event_t eventHdl)
 Function executed by the worker cores when they pull an event from the workshare queue.
tomp_Teamtomp_initialize_team (unsigned int threadNum)
 Create and initialize a team.
void tomp_start_team (tomp_Team *team, void(*fn)(void *), unsigned char *data)
 Start the team by pushing events to the StartLoop queue.
void GOMP_parallel_start (void(*fn)(void *), unsigned char *data, unsigned int num_threads)
 GOMP_parallel_start is used for the for loop parallelism.
void GOMP_parallel_end (void)
 Wait for implicit/explicit tasks to complete and terminate the team.
int omp_get_num_threads (void)
int omp_get_thread_num (void)
int omp_get_num_procs (void)
int omp_in_parallel (void)
int omp_get_level (void)
int omp_get_ancestor_thread_num (int level)
int omp_get_team_size (int level)
int omp_get_active_level (void)
void tomp_completePendingTasks ()
 Complete all explicit tasks generated upto the implicit/explicit barrier.
tomp_TeamStatetomp_alloc_TeamState ()

Variables

tomp_Thread tomp_thread
void * __TI_tls_currentTP
 Local TLS pointer (one per core)
tomp_event_t tomp_eventHdlTbl [TOMP_DEVICE_NUM_CORES-1]
tomp_Tasktomp_taskPtrTbl [TOMP_DEVICE_NUM_CORES-1]
tomp_Tasktomp_initialTaskForMaster
 Initial Task for master.
tomp_Tasktomp_implicitTaskForMaster
 Implicit Task for master.

Detailed Description

Implements GOMP_parallel_[start|end].


Function Documentation

void GOMP_parallel_start ( void(*)(void *)  fn,
unsigned char *  data,
unsigned int  num_threads 
)

GOMP_parallel_start is used for the for loop parallelism.

The same function is executed on various chunks of data (SPMD) Therefore, we are creating a single EO, a single PARALLEL queue, and an event group. For each thread in the team, we are sending an event that belongs to the event group.

Parameters:
fnpointer to the function to execute
datapointer to the data to process
num_threads(number of threads in the OpenMP team)
See also:
GOMP_parallel_end()

Here is the call graph for this function:

Complete all explicit tasks generated upto the implicit/explicit barrier.

From OMP Spec 3.0, p67, line 23 All threads of the team executing the binding parallel region must execute the barrier region and complete execution of all explicit tasks generated in the binding parallel region up to this point before any are allowed to continue execution beyond the barrier.

Here is the call graph for this function:

Here is the caller graph for this function:

tomp_Team* tomp_initialize_team ( unsigned int  threadNum)

Create and initialize a team.

Parameters:
threadNumnumber of threads in the team
Returns:
a pointer to the initialized team
See also:
GOMP_parallel_start

Here is the call graph for this function:

Here is the caller graph for this function:

void tomp_start_team ( tomp_Team team,
void(*)(void *)  fn,
unsigned char *  data 
)

Start the team by pushing events to the StartLoop queue.

Parameters:
teampointer to a team
fnfunction corresponding to the implicit task (outlined fn)
datadata associated with the function
See also:
GOMP_parallel_start, tomp_eoStartLoop

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Local TLS pointer (one per core)

See also:
___c6xabi_get_tp in tomp_tls_get_tp.asm

Implicit Task for master.

The current_task field in tomp_Thread for the master points to this task when the thread is in a parallel region.

Initial Task for master.

This task is the initial implicit task associated with the initial thread. OpenMP Spec 3.0, p12, lines 1-4. There is a distinction between the initial implicit task and the implicit tasks created for a parallel region and this distinction is important for ownership of locks.

 All Classes Files Functions Variables Typedefs Enumerations Defines