MADNESS 0.10.1
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:

Public Member Functions

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

Private Attributes

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

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 _barrier, _id, _nthread, barrier(), madness::binder, id(), and nthread().

◆ 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 _barrier, _id, _nthread, madness::binder, id(), and nthread().

Member Function Documentation

◆ barrier()

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

References _barrier, _id, _nthread, and MADNESS_ASSERT.

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

◆ id()

◆ 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 TaskThreadEnv(), TaskThreadEnv(), 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 TaskThreadEnv(), TaskThreadEnv(), and barrier().

◆ _id

const int madness::TaskThreadEnv::_id
private

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

Referenced by TaskThreadEnv(), TaskThreadEnv(), barrier(), and id().

◆ _nthread

const int madness::TaskThreadEnv::_nthread
private

Number of threads collaborating on task.

Referenced by TaskThreadEnv(), TaskThreadEnv(), barrier(), and nthread().


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