PFUNC  1.0
Private Member Functions | Private Attributes | Friends
pfunc::detail::group Struct Reference

Implements a group structure across which barriers can be executed. More...

#include <pfunc/group.hpp>

List of all members.

Private Member Functions

 PFUNC_DEFINE_EXCEPT_PTR () public
template<typename TaskManager >
void barrier_steal (TaskManager &taskmgr)
 Implements the work-stealing barrier.
unsigned int join_group ()
void leave_group (void)
unsigned int get_id () const
unsigned int get_size () const
unsigned int get_barrier () const
void set_id (const unsigned int &gid)
void set_size (const unsigned int &gsize)
void set_barrier (const unsigned int &barr)
template<typename TaskManager >
void barrier (TaskManager &taskmgr)
 group ()
 group (const unsigned int &group_id, const unsigned int &group_size)
 group (const unsigned int &group_id, const unsigned int &group_size, const unsigned int &barrier)
 ~group ()

Private Attributes

ALIGN128 volatile bool barrier_phase
ALIGN128 volatile unsigned int barrier_count
volatile unsigned int rank_token
unsigned int group_id
unsigned int group_size
mutex group_lock
unsigned int type_of_barrier

Friends

bool operator== (const group &one, const group &two)

Detailed Description

Implements a group structure across which barriers can be executed.


Constructor & Destructor Documentation

pfunc::detail::group::group ( ) [inline, private]

Default constructor

pfunc::detail::group::group ( const unsigned int &  group_id,
const unsigned int &  group_size 
) [inline, private]

Parameterized Constructor

Parameters:
[in]group_idID of the group.
[in]group_sizeSize of the group.
pfunc::detail::group::group ( const unsigned int &  group_id,
const unsigned int &  group_size,
const unsigned int &  barrier 
) [inline, private]

Parameterized Constructor

Parameters:
[in]group_idID of the group.
[in]group_sizeSize of the group.
[in]barrierType of the barrier.
pfunc::detail::group::~group ( ) [inline, private]

Destructor


Member Function Documentation

template<typename TaskManager >
void pfunc::detail::group::barrier ( TaskManager &  taskmgr) [inline, private]
Parameters:
[in,out]taskmgrThe instance that does the steal.
template<typename TaskManager >
void pfunc::detail::group::barrier_steal ( TaskManager &  taskmgr) [inline, private]

Implements the work-stealing barrier.

Parameters:
[in,out]taskmgrThe instance of the library that we steal work from.
unsigned int pfunc::detail::group::get_barrier ( ) const [inline, private]
Returns:
Type of the barrier
unsigned int pfunc::detail::group::get_id ( ) const [inline, private]
Returns:
Id of the group
unsigned int pfunc::detail::group::get_size ( ) const [inline, private]

get_group_size

Returns:
Number of tasks in the group
unsigned int pfunc::detail::group::join_group ( ) [inline, private]
Returns:
Join this group and return a new rank.
void pfunc::detail::group::leave_group ( void  ) [inline, private]

Decrements the rank_token by one.

Implements the spinning barrier.

void pfunc::detail::group::set_barrier ( const unsigned int &  barr) [inline, private]
Parameters:
barrType of the barrier
void pfunc::detail::group::set_id ( const unsigned int &  gid) [inline, private]
Parameters:
gidId of the group
void pfunc::detail::group::set_size ( const unsigned int &  gsize) [inline, private]
Parameters:
gsizeNumber of tasks in the group

Friends And Related Function Documentation

bool operator== ( const group one,
const group two 
) [friend]
Parameters:
[in]oneThe group to be compared
[in]twoThe other group to be compared
Returns:
true If the groups are same
false otherwise

Member Data Documentation

ALIGN128 volatile unsigned int pfunc::detail::group::barrier_count [private]

# tasks active in barrier

Toggle of phases

unsigned int pfunc::detail::group::group_id [private]

For debugging purposes

Lock for implementing the barrier

unsigned int pfunc::detail::group::group_size [private]

Number of tasks in this group

volatile unsigned int pfunc::detail::group::rank_token [private]

Gives out ranks to tasks

unsigned int pfunc::detail::group::type_of_barrier [private]

Type of the barrier to be used


The documentation for this struct was generated from the following file: