PFUNC 1.0
Functions | Variables
pfunc::global Namespace Reference

Functions

template<typename TaskManager >
void init (TaskManager &tmanager)
 Used to initialize a global task manager that can then be used in the following functions:
void clear ()
 Clears the global task manager. Note that this does not destroy the task manager object itself. That is to be ensured by the user.
static unsigned int thread_id ()
static void group_rank (unsigned int &rank)
static void group_size (unsigned int &size)
template<typename TaskType >
static void wait (TaskType &task)
template<typename ForwardIterator >
static void wait_any (ForwardIterator first, ForwardIterator last, int *completion_arr)
template<typename ForwardIterator >
static void wait_all (ForwardIterator first, ForwardIterator last)
template<typename TaskType >
static bool test (TaskType &task)
template<typename ForwardIterator >
static bool test_all (ForwardIterator first, ForwardIterator last, int *completion_arr)
static void barrier ()
template<typename Task , typename Functor >
static void spawn (Task &task, Functor &func)
template<typename Task , typename Attribute , typename Functor >
static void spawn (Task &task, const Attribute &attr, Functor &func)
template<typename Task , typename Attribute , typename Functor >
static void spawn (Task &task, const Attribute &attr, group &grp, Functor &func)
static void taskmgr_max_attempts_set (const unsigned int &attempts)
static void taskmgr_max_attempts_get (unsigned int &attempts)
static void get_num_queues (unsigned int &num_queues)
static void get_num_threads (unsigned int &num_threads)

Variables

detail::taskmgr_virtual_baseglobal_tmanager = NULL

Function Documentation

static void pfunc::global::barrier ( ) [inline, static]

Executes a barrier across the tasks associated with the specified group. The group is automatically gotten from the task that called barrier.

void pfunc::global::clear ( )

Clears the global task manager. Note that this does not destroy the task manager object itself. That is to be ensured by the user.

static void pfunc::global::get_num_queues ( unsigned int &  num_queues) [inline, static]
static void pfunc::global::get_num_threads ( unsigned int &  num_threads) [inline, static]
static void pfunc::global::group_rank ( unsigned int &  rank) [inline, static]
Parameters:
[out]rankRank of the task in the group.
static void pfunc::global::group_size ( unsigned int &  size) [inline, static]
Parameters:
[out]sizeSize of the group in which the task is a part of.
template<typename TaskManager >
void pfunc::global::init ( TaskManager &  tmanager)

Used to initialize a global task manager that can then be used in the following functions:

See also:
current_thread_id
group_rank
group_size
wait
wait_any
wait_all
test
test_all
run
Parameters:
[in]tmanagerThe task manager that is to be used globally.
template<typename Task , typename Functor >
static void pfunc::global::spawn ( Task &  task,
Functor &  func 
) [inline, static]

Spawn the task specified. The specification consists of a task, the task attributes, the group the task belongs to and the functor that executes the task.

Parameters:
[out]taskTask to the task we are adding.
[in]funcThe work function to execute
template<typename Task , typename Attribute , typename Functor >
static void pfunc::global::spawn ( Task &  task,
const Attribute &  attr,
Functor &  func 
) [inline, static]

Spawn the task specified. The specification consists of a task, the task attributes, the group the task belongs to and the functor that executes the task.

Parameters:
[out]taskTask to the task we are adding.
[in]attrAttributes with which to create this job.
[in]funcThe work function to execute
template<typename Task , typename Attribute , typename Functor >
static void pfunc::global::spawn ( Task &  task,
const Attribute &  attr,
group &  grp,
Functor &  func 
) [inline, static]

Spawn the task specified. The specification consists of a task, the task attributes, the group the task belongs to and the functor that executes the task.

Parameters:
[out]taskTask to the task we are adding.
[in]attrAttributes with which to create this job.
[in,out]grpGroup that contains the group of these tasks.
[in]funcThe work function to execute
static void pfunc::global::taskmgr_max_attempts_get ( unsigned int &  attempts) [inline, static]
static void pfunc::global::taskmgr_max_attempts_set ( const unsigned int &  attempts) [inline, static]
template<typename TaskType >
static bool pfunc::global::test ( TaskType &  task) [inline, static]

Test for completion of the task associated with the task

Parameters:
[in,out]taskTask to be tested for completion.
Returns:
True if the task completed, false otherwise.
template<typename ForwardIterator >
static bool pfunc::global::test_all ( ForwardIterator  first,
ForwardIterator  last,
int *  completion_arr 
) [inline, static]

Test for completion of the tasks specified by the set of tasks.

Parameters:
[in]firstFirst of the tasks to be tested on.
[in]lastEnd marker for the tasks to be tested on (true last+1).
[out]completion_arrContains the results of the tests.
static unsigned int pfunc::global::thread_id ( ) [inline, static]

Retrieves the ID of the currently executing thread.

template<typename TaskType >
static void pfunc::global::wait ( TaskType &  task) [inline, static]
Parameters:
[in,out]taskThe task to be waited on.
template<typename ForwardIterator >
static void pfunc::global::wait_all ( ForwardIterator  first,
ForwardIterator  last 
) [inline, static]

Waits for all the tasks in the specified set to complete.

Parameters:
[in]firstFirst of the tasks to be waited on
[in]lastEnd marker for the tasks to be waited on (true last+1)
template<typename ForwardIterator >
static void pfunc::global::wait_any ( ForwardIterator  first,
ForwardIterator  last,
int *  completion_arr 
) [inline, static]

Waits for one of the tasks specified in the set. The algorithm implemented is one of test_all () followed by exponential backoff.

Parameters:
[in]firstFirst of the tasks to be waited on.
[in]lastEnd marker for the tasks to be waited on (true last+1).
[out]completion_arrArray that contains the completion status.

Variable Documentation

Global variable that holds the task manager