ARGOBOTS  dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
Data Structures | Enumerations | Functions | Variables
Pool config

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...
 

Detailed Description

This group is for Pool config.

Enumeration Type Documentation

◆ ABT_pool_config_type

A struct that sets and gets a pool configuration.

Enumerator
ABT_POOL_CONFIG_INT 

Parameter of type int

ABT_POOL_CONFIG_DOUBLE 

Parameter of type double

ABT_POOL_CONFIG_PTR 

Parameter of type pointer

Definition at line 1516 of file abt.h.

Function Documentation

◆ ABT_pool_config_create()

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.

Note
To see the details of whether the pool is automatically freed or not, please check ABT_pool_create().

config must be freed by ABT_pool_config_free() after its use.

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_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.
Undefined behavior
If Argobots is not initialized, the results are undefined.
If config is NULL, the results are undefined.
Parameters
[out]configpool configuration handle
Returns
Error code

Definition at line 79 of file pool_config.c.

◆ ABT_pool_config_free()

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.

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_POOL_CONFIG is returned if config points to ABT_SCHED_POOL_NULL.
Undefined behavior
If Argobots is not initialized, the results are undefined.
If config is NULL, the results are undefined.
If config is accessed after calling this routine, the results are undefined.
Parameters
[in,out]configpool configuration handle
Returns
Error code

Definition at line 123 of file pool_config.c.

◆ ABT_pool_config_get()

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.

Note
For example, this routine can be called as follows to get a value that is corresponding to key = 1.
int val;
ABT_pool_config_get(&config, var.key, &type, &val);
assert(type == var.type);
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_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.
Undefined behavior
If Argobots is not initialized, the results are undefined.
If config is accessed concurrently, the results are undefined.
Parameters
[in]configpool configuration handle
[in]keyindex of a target value
[out]typetype of a target value
[out]valtarget value
Returns
Error code

Definition at line 243 of file pool_config.c.

◆ ABT_pool_config_set()

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.

Note
For example, this routine can be called as follows to set a value that is corresponding to key = 1.
int val = 10;
ABT_pool_config_set(&config, var.key, var.type, &val);

If value is NULL, this routine deletes a value associated with key if such exists.

Note
This routine returns ABT_SUCCESS even if value is NULL but no value is associated with key.
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_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.
Undefined behavior
If Argobots is not initialized, the results are undefined.
If config is accessed concurrently, the results are undefined.
Parameters
[in]configpool configuration handle
[in]keyindex of a target value
[in]typetype of a target value
[in]valtarget value
Returns
Error code

Definition at line 183 of file pool_config.c.

Variable Documentation

◆ ABT_pool_config_automatic

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().

ABT_pool_config_type
ABT_pool_config_type
A struct that sets and gets a pool configuration.
Definition: abt.h:1516
ABT_pool_config_get
int ABT_pool_config_get(ABT_pool_config config, int key, ABT_pool_config_type *p_type, void *val) ABT_API_PUBLIC
Retrieve a value from a pool configuration.
Definition: pool_config.c:243
ABT_pool_config_var::type
ABT_pool_config_type type
Definition: abt.h:1536
ABT_POOL_CONFIG_INT
@ ABT_POOL_CONFIG_INT
Definition: abt.h:1518
ABT_pool_config_set
int ABT_pool_config_set(ABT_pool_config config, int key, ABT_pool_config_type type, const void *val) ABT_API_PUBLIC
Register a value to a pool configuration.
Definition: pool_config.c:183
ABT_pool_config_var::key
int key
Definition: abt.h:1534
ABT_pool_config_var
A struct that sets and gets a pool configuration.
Definition: abt.h:1529