ARGOBOTS  1.1
Typedefs | Enumerations | Functions
Work Unit

This group is for work units. More...

Typedefs

typedef struct ABT_unit_opaque * ABT_unit
 Work unit handle type for scheduling. More...
 
typedef enum ABT_unit_type ABT_unit_type
 Work unit type. More...
 
typedef uint64_t ABT_unit_id
 Work unit ID type. More...
 

Enumerations

enum  ABT_unit_type { ABT_UNIT_TYPE_THREAD, ABT_UNIT_TYPE_TASK, ABT_UNIT_TYPE_XSTREAM, ABT_UNIT_TYPE_EXT }
 Type of a work unit for scheduling. More...
 

Functions

int ABT_unit_set_associated_pool (ABT_unit unit, ABT_pool pool)
 No operation. More...
 
int ABT_unit_get_thread (ABT_unit unit, ABT_thread *thread)
 Get a thread handle of the target work unit. More...
 

Detailed Description

This group is for work units.

Typedef Documentation

◆ ABT_unit

typedef struct ABT_unit_opaque* ABT_unit

Work unit handle type for scheduling.

ABT_unit is a work unit handle encapsulated by its associated pool, so the value of ABT_unit is different from its associated ABT_thread or ABT_task.

A NULL handle of this type is ABT_UNIT_NULL.

Definition at line 869 of file abt.h.

◆ ABT_unit_id

typedef uint64_t ABT_unit_id

Work unit ID type.

Definition at line 879 of file abt.h.

◆ ABT_unit_type

Work unit type.

Definition at line 874 of file abt.h.

Enumeration Type Documentation

◆ ABT_unit_type

Type of a work unit for scheduling.

Enumerator
ABT_UNIT_TYPE_THREAD 

A ULT.

ABT_UNIT_TYPE_TASK 

A tasklet.

[Argobots 2.0] This type is an alias of ABT_UNIT_TYPE_THREAD.

ABT_UNIT_TYPE_XSTREAM 

Deprecated since no Argobots function uses it.

ABT_UNIT_TYPE_EXT 

An external thread.

Definition at line 548 of file abt.h.

Function Documentation

◆ ABT_unit_get_thread()

int ABT_unit_get_thread ( ABT_unit  unit,
ABT_thread thread 
)

Get a thread handle of the target work unit.

ABT_unit_get_thread() returns the ABT_thread handle associated with the work unit unit through thread.

Execution context
This routine can be called in any execution context. Argobots must be initialized. This routine does not switch the context of the calling ULT unless any user-defined function that is involved in this routine switch the context of the calling ULT.
Errors
ABT_SUCCESS is returned if this routine succeeds.
ABT_ERR_INV_UNIT is returned if unit is ABT_UNIT_NULL.
Undefined behavior
If Argobots is not initialized, the results are undefined.
If thread is NULL, the results are undefined.
Parameters
[in]unitwork unit handle
[out]threadwork unit handle
Returns
Error code

Definition at line 78 of file unit.c.

◆ ABT_unit_set_associated_pool()

int ABT_unit_set_associated_pool ( ABT_unit  unit,
ABT_pool  pool 
)

No operation.

ABT_unit_set_associated_pool() does nothing. This routine was originally provided for setting the associated pool for a work unit, but Argobots 1.1 manages this mapping when ABT_pool_push() or ABT_xstream_run_unit() is called. This routine is for the backward compatibility.

Changes from Argobots 1.0 to Argobots 1.1
[Argobots 1.0] The user must explicitly call this routine to change the associated pool of ABT_unit.
[Argobots 1.1] The Argobots runtime automatically changes the associated pool of ABT_unit if needed. This routine is therefore unnecessary.
Rationale
The unit-pool association management is hard for the user who does not know the internal implementation of Argobots. This change not only eases programming with Argobots but also addresses some issues without breaking the backward compatibility. See https://github.com/pmodels/argobots/issues/317 for details.
Execution context
This routine can be called in any execution context. Argobots must be initialized. This routine does not switch the context of the calling ULT unless any user-defined function that is involved in this routine switch the context of the calling ULT.
Errors
ABT_SUCCESS is returned if this routine succeeds.
ABT_ERR_INV_UNIT is returned if unit is ABT_UNIT_NULL.
ABT_ERR_INV_POOL is returned if pool is ABT_POOL_NULL.
Undefined behavior
If Argobots is not initialized, the results are undefined.
Parameters
[in]unitwork unit handle
[in]poolpool handle
Returns
Error code

Definition at line 48 of file unit.c.