ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
This group is for Pool config. More...
Data Structures | |
struct | ABT_pool_config_var |
A struct that sets and gets a pool configuration. More... | |
Enumerations | |
enum | ABT_pool_config_type { ABT_POOL_CONFIG_INT = 0, ABT_POOL_CONFIG_DOUBLE = 1, ABT_POOL_CONFIG_PTR = 2 } |
A struct that sets and gets a pool configuration. More... | |
Functions | |
int | ABT_pool_config_create (ABT_pool_config *config) |
Create a new pool configuration. More... | |
int | ABT_pool_config_free (ABT_pool_config *config) |
Free a pool configuration. More... | |
int | ABT_pool_config_set (ABT_pool_config config, int key, ABT_pool_config_type type, const void *val) |
Register a value to a pool configuration. More... | |
int | ABT_pool_config_get (ABT_pool_config config, int key, ABT_pool_config_type *type, void *val) |
Retrieve a value from a pool configuration. More... | |
Variables | |
const ABT_pool_config_var | ABT_pool_config_automatic |
Predefined ABT_pool_config_var to configure whether the pool is freed automatically or not. More... | |
This group is for Pool config.
enum ABT_pool_config_type |
int ABT_pool_config_create | ( | ABT_pool_config * | config | ) |
Create a new pool configuration.
ABT_pool_config_create()
creates a new empty pool configuration and returns its handle through config
.
Currently, Argobots supports the following hints:
ABT_pool_config_automatic:
Whether the pool is automatically freed or not. If the value is ABT_TRUE
, the pool is automatically freed when all schedulers associated with the pool are freed. If this hint is not specified, the default value of each pool creation routine is used for pool creation.
ABT_pool_create()
.config
must be freed by ABT_pool_config_free()
after its use.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_ARG
is returned if type
of the given ABT_pool_config_var
is invalid.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.config
is NULL
, the results are undefined.[out] | config | pool configuration handle |
Definition at line 79 of file pool_config.c.
int ABT_pool_config_free | ( | ABT_pool_config * | config | ) |
Free a pool configuration.
ABT_pool_config_free()
deallocates the resource used for the pool configuration pool_config
and sets pool_config
to ABT_POOL_CONFIG_NULL
.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_POOL_CONFIG
is returned if config
points to ABT_SCHED_POOL_NULL
.config
is NULL
, the results are undefined.config
is accessed after calling this routine, the results are undefined.[in,out] | config | pool configuration handle |
Definition at line 123 of file pool_config.c.
int ABT_pool_config_get | ( | ABT_pool_config | config, |
int | key, | ||
ABT_pool_config_type * | type, | ||
void * | val | ||
) |
Retrieve a value from a pool configuration.
ABT_pool_config_get()
reads a value associated with the index key
of ABT_pool_config_var
from the pool configuration config
. If val
is not NULL
, val
is set to the value. If type
is not NULL
, type
is set to the type of the value.
key
= 1. ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_ARG
is returned if config
does not have a value associated with key
.ABT_ERR_INV_POOL_CONFIG
is returned if config
is ABT_SCHED_POOL_NULL
.config
is accessed concurrently, the results are undefined.[in] | config | pool configuration handle |
[in] | key | index of a target value |
[out] | type | type of a target value |
[out] | val | target value |
Definition at line 243 of file pool_config.c.
int ABT_pool_config_set | ( | ABT_pool_config | config, |
int | key, | ||
ABT_pool_config_type | type, | ||
const void * | val | ||
) |
Register a value to a pool configuration.
ABT_pool_config_set()
associated a value pointed to by the value val
with the index key
in the pool configuration config
. This routine overwrites a value and its type if a value has already been associated with key
.
key
= 1. If value
is NULL
, this routine deletes a value associated with key
if such exists.
ABT_SUCCESS
even if value
is NULL
but no value is associated with key
.ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_ARG
is returned if type
is invalid.ABT_ERR_INV_POOL_CONFIG
is returned if config
is ABT_SCHED_POOL_NULL
.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.config
is accessed concurrently, the results are undefined.[in] | config | pool configuration handle |
[in] | key | index of a target value |
[in] | type | type of a target value |
[in] | val | target value |
Definition at line 183 of file pool_config.c.
ABT_pool_config_automatic |
Predefined ABT_pool_config_var to configure whether the pool is freed automatically or not.
Its type is int. If the value is non-zero, the pool is freed automatically after its associated objects are released. If the value is zero, the pool is configured to be not freed automatically by the Argobots runtime.
Definition at line 39 of file pool_config.c.
Referenced by pool_create().