PFUNC
1.0
|
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_base * | global_tmanager = NULL |
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] |
[out] | rank | Rank of the task in the group. |
static void pfunc::global::group_size | ( | unsigned int & | size | ) | [inline, static] |
[out] | size | Size of the group in which the task is a part of. |
void pfunc::global::init | ( | TaskManager & | tmanager | ) |
Used to initialize a global task manager that can then be used in the following functions:
[in] | tmanager | The task manager that is to be used globally. |
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.
[out] | task | Task to the task we are adding. |
[in] | func | The work function to execute |
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.
[out] | task | Task to the task we are adding. |
[in] | attr | Attributes with which to create this job. |
[in] | func | The work function to execute |
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.
[out] | task | Task to the task we are adding. |
[in] | attr | Attributes with which to create this job. |
[in,out] | grp | Group that contains the group of these tasks. |
[in] | func | The 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] |
static bool pfunc::global::test | ( | TaskType & | task | ) | [inline, static] |
Test for completion of the task associated with the task
[in,out] | task | Task to be tested for completion. |
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.
[in] | first | First of the tasks to be tested on. |
[in] | last | End marker for the tasks to be tested on (true last+1). |
[out] | completion_arr | Contains the results of the tests. |
static unsigned int pfunc::global::thread_id | ( | ) | [inline, static] |
Retrieves the ID of the currently executing thread.
static void pfunc::global::wait | ( | TaskType & | task | ) | [inline, static] |
[in,out] | task | The task to be waited on. |
static void pfunc::global::wait_all | ( | ForwardIterator | first, |
ForwardIterator | last | ||
) | [inline, static] |
Waits for all the tasks in the specified set to complete.
[in] | first | First of the tasks to be waited on |
[in] | last | End marker for the tasks to be waited on (true last+1) |
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.
[in] | first | First of the tasks to be waited on. |
[in] | last | End marker for the tasks to be waited on (true last+1). |
[out] | completion_arr | Array that contains the completion status. |
Global variable that holds the task manager