ARGOBOTS  1227c643f7a7f974f1f1778a9ffebd29d7dafecf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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_pop_wait (ABT_pool pool, ABT_unit *p_unit, double time_secs)
 Pop a unit from the target pool with wait. 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 445 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 31 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 88 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 118 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 410 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 485 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 176 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 147 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 202 of file pool.c.

int ABT_pool_pop_wait ( ABT_pool  pool,
ABT_unit p_unit,
double  time_secs 
)

Pop a unit from the target pool with wait.

ABT_pool_pop_wait pops a unit from a pool pool if a unit is in a pool; otherwise, it suspends an underlying execution stream and waits in a pool. time_secs directs how long ABT_pool_pop_wait suspends the underlying execution stream. A work unit successfully popped from pool is returned via p_unit. If no work unit is available, it returns ABT_UNIT_NULL.

In most cases, ABT_pool_pop() is more efficient, but ABT_pool_pop_wait is useful in cases where users want to make execution streams active only when is available.

Parameters
[in]poolhandle to the pool
[out]p_unithandle to the unit
[in]time_secsduration of waiting time (seconds)
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 239 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 348 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 282 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 311 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 381 of file pool.c.