MADNESS  0.10.1
Public Member Functions | Private Attributes | List of all members
madness::TaskThreadEnv Class Reference

Used to pass information about the thread environment to a user's task. More...

#include <thread.h>

Collaboration diagram for madness::TaskThreadEnv:
Collaboration graph
[legend]

Public Member Functions

 TaskThreadEnv (int nthread, int id)
 Constructor collecting necessary environmental information. More...
 
 TaskThreadEnv (int nthread, int id, Barrier *barrier)
 Constructor collecting necessary environmental information. More...
 
bool barrier () const
 
int id () const
 Get the ID of this thread. More...
 
int nthread () const
 Get the number of threads collaborating on this task. More...
 

Private Attributes

Barrier_barrier
 Pointer to the shared barrier, null if there is only a single thread. More...
 
const int _id
 ID of this thread (0,...,nthread-1). More...
 
const int _nthread
 Number of threads collaborating on task. More...
 

Detailed Description

Used to pass information about the thread environment to a user's task.

Constructor & Destructor Documentation

◆ TaskThreadEnv() [1/2]

madness::TaskThreadEnv::TaskThreadEnv ( int  nthread,
int  id,
Barrier barrier 
)
inline

Constructor collecting necessary environmental information.

Todo:
Verify this documentation.
Parameters
[in]nthreadThe number of threads collaborating on this task.
[in]idThe ID of this thread.
[in]barrierPointer to the shared barrier.

References madness::ThreadBinder::bind(), and madness::binder.

◆ TaskThreadEnv() [2/2]

madness::TaskThreadEnv::TaskThreadEnv ( int  nthread,
int  id 
)
inline

Constructor collecting necessary environmental information.

Todo:
Verify this documentation.
Parameters
[in]nthreadThe number of threads collaborating on this task.
[in]idThe ID of this thread.
Todo:
I cannot get the TaskThreadEnv to work with Barrier. Need to figure out why.

References madness::ThreadBinder::bind(), and madness::binder.

Member Function Documentation

◆ barrier()

bool madness::TaskThreadEnv::barrier ( ) const
inline
Todo:
Brief description needed.
Todo:
Descriptions needed.
Returns
Description needed.

References _barrier, _id, _nthread, madness::Barrier::enter(), and MADNESS_ASSERT.

Referenced by TestBarrier::run(), and TimeBarrier::run().

◆ id()

int madness::TaskThreadEnv::id ( ) const
inline

◆ nthread()

int madness::TaskThreadEnv::nthread ( ) const
inline

Get the number of threads collaborating on this task.

Returns
The number of threads.

References _nthread.

Referenced by madness::SystolicMatrixAlgorithm< T >::run(), madness::TaskInterface::run(), and TestBarrier::run().

Member Data Documentation

◆ _barrier

Barrier* madness::TaskThreadEnv::_barrier
private

Pointer to the shared barrier, null if there is only a single thread.

Referenced by barrier().

◆ _id

const int madness::TaskThreadEnv::_id
private

ID of this thread (0,...,nthread-1).

Referenced by barrier(), and id().

◆ _nthread

const int madness::TaskThreadEnv::_nthread
private

Number of threads collaborating on task.

Referenced by barrier(), and nthread().


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