ARGOBOTS
Functions
Pool

Functions

int ABT_pool_create (ABT_pool_def *def, ABT_pool_config config, ABT_pool *newpool)
 Create a new pool and return its handle through newpool. More...
 
int ABT_pool_create_basic (ABT_pool_kind kind, ABT_pool_access access, ABT_bool automatic, ABT_pool *newpool)
 Create a new pool from a predefined type and return its handle through newpool. More...
 
int ABT_pool_free (ABT_pool *pool)
 Free the given pool, and modify its value to ABT_POOL_NULL. More...
 
int ABT_pool_get_access (ABT_pool pool, ABT_pool_access *access)
 Get the access type of target pool. More...
 
int ABT_pool_get_total_size (ABT_pool pool, size_t *size)
 Return the total size of a pool. More...
 
int ABT_pool_get_size (ABT_pool pool, size_t *size)
 Return the size of a pool. More...
 
int ABT_pool_pop (ABT_pool pool, ABT_unit *p_unit)
 Pop a unit from the target pool. More...
 
int ABT_pool_push (ABT_pool pool, ABT_unit unit)
 Push a unit to the target pool. More...
 
int ABT_pool_remove (ABT_pool pool, ABT_unit unit)
 Remove a specified unit from the target pool. More...
 
int ABT_pool_print_all (ABT_pool pool, void *arg, void(*print_fn)(void *, ABT_unit))
 Apply a print function to every unit in a pool using a user-defined function. More...
 
int ABT_pool_set_data (ABT_pool pool, void *data)
 Set the specific data of the target user-defined pool. More...
 
int ABT_pool_get_data (ABT_pool pool, void **data)
 Retrieve the specific data of the target user-defined pool. More...
 
int ABT_pool_add_sched (ABT_pool pool, ABT_sched sched)
 Push a scheduler to a pool. More...
 
int ABT_pool_get_id (ABT_pool pool, int *id)
 Get the ID of the target pool. More...
 

Detailed Description

This group is for Pool.

Function Documentation

int ABT_pool_add_sched ( ABT_pool  pool,
ABT_sched  sched 
)

Push a scheduler to a pool.

By pushing a scheduler, the user can change the running scheduler: when the top scheduler (the running scheduler) will pick it from the pool and run it, it will become the new scheduler. This new scheduler will be in charge until it explicitly yields, except if ABT_sched_finish() or ABT_sched_exit() are called.

The scheduler should have been created by ABT_sched_create or ABT_sched_create_basic.

Parameters
[in]poolhandle to the pool
[in]schedhandle to the sched
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 433 of file pool.c.

int ABT_pool_create ( ABT_pool_def def,
ABT_pool_config  config,
ABT_pool newpool 
)

Create a new pool and return its handle through newpool.

This function creates a new pool, given by a definition (def) and a configuration (config). The configuration can be ABT_SCHED_CONFIG_NULL or obtained from a specific function of the pool defined by def. The configuration will be passed as the parameter of the initialization function of the pool.

Parameters
[in]defdefinition required for pool creation
[in]configspecific config used during the pool creation
[out]newpoolhandle to a new pool
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 30 of file pool.c.

int ABT_pool_create_basic ( ABT_pool_kind  kind,
ABT_pool_access  access,
ABT_bool  automatic,
ABT_pool newpool 
)

Create a new pool from a predefined type and return its handle through newpool.

For more details see ABT_pool_create().

Parameters
[in]kindname of the predefined pool
[in]accessaccess type of the predefined pool
[in]automaticABT_TRUE if the pool should be automatically freed
[out]newpoolhandle to a new pool
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 63 of file pool.c.

int ABT_pool_free ( ABT_pool pool)

Free the given pool, and modify its value to ABT_POOL_NULL.

Parameters
[in,out]poolhandle
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 89 of file pool.c.

int ABT_pool_get_access ( ABT_pool  pool,
ABT_pool_access access 
)

Get the access type of target pool.

Parameters
[in]poolhandle to the pool
[out]accessaccess type
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 119 of file pool.c.

int ABT_pool_get_data ( ABT_pool  pool,
void **  data 
)

Retrieve the specific data of the target user-defined pool.

This function will be called by the user in a user-defined function of his user-defined pool.

Parameters
[in]poolhandle to the pool
[in]dataspecific data of the pool
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 398 of file pool.c.

int ABT_pool_get_id ( ABT_pool  pool,
int *  id 
)

Get the ID of the target pool.

ABT_pool_get_id() returns the ID of pool.

Parameters
[in]poolhandle to the target pool
[out]idpool id
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 523 of file pool.c.

int ABT_pool_get_size ( ABT_pool  pool,
size_t *  size 
)

Return the size of a pool.

The returned size is the number of elements in the pool (provided by the specific function in case of a user-defined pool).

Parameters
[in]poolhandle to the pool
[out]sizesize of the pool
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 177 of file pool.c.

int ABT_pool_get_total_size ( ABT_pool  pool,
size_t *  size 
)

Return the total size of a pool.

The returned size is the number of elements in the pool (provided by the specific function in case of a user-defined pool), plus the number of blocked ULTs and migrating ULTs.

Parameters
[in]poolhandle to the pool
[out]sizesize of the pool
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 148 of file pool.c.

int ABT_pool_pop ( ABT_pool  pool,
ABT_unit p_unit 
)

Pop a unit from the target pool.

Parameters
[in]poolhandle to the pool
[out]p_unithandle to the unit
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 203 of file pool.c.

int ABT_pool_print_all ( ABT_pool  pool,
void *  arg,
void(*)(void *, ABT_unit print_fn 
)

Apply a print function to every unit in a pool using a user-defined function.

This function applies print_fn to every unit in pool. As the name of the argument implies, print_fn may not have any side effect; ABT_pool_print_all() is for the purpose of debugging and profiling. For example, changing the state of ABT_unit in print_fn is forbidden.

When pool does not support the print-all feature, ABT_ERR_POOL is returned.

Parameters
[in]poolhandle to the pool
[in]argargument passed to print_fn
[in]print_fnuser-defined print function
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 336 of file pool.c.

int ABT_pool_push ( ABT_pool  pool,
ABT_unit  unit 
)

Push a unit to the target pool.

Parameters
[in]poolhandle to the pool
[in]unithandle to the unit
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 258 of file pool.c.

int ABT_pool_remove ( ABT_pool  pool,
ABT_unit  unit 
)

Remove a specified unit from the target pool.

Parameters
[in]poolhandle to the pool
[in]unithandle to the unit
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 294 of file pool.c.

int ABT_pool_set_data ( ABT_pool  pool,
void *  data 
)

Set the specific data of the target user-defined pool.

This function will be called by the user during the initialization of his user-defined pool.

Parameters
[in]poolhandle to the pool
[in]dataspecific data of the pool
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 369 of file pool.c.