ARGOBOTS  dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
Data Structures | Typedefs | Enumerations | Functions | Variables
Scheduler config

This group is for Scheduler config. More...

Data Structures

struct  ABT_sched_config_var
 A struct that sets and gets a scheduler configuration. More...
 

Typedefs

typedef struct ABT_sched_config_opaque * ABT_sched_config
 Scheduler configuration handle type. More...
 

Enumerations

enum  ABT_sched_config_type { ABT_SCHED_CONFIG_INT = 0, ABT_SCHED_CONFIG_DOUBLE = 1, ABT_SCHED_CONFIG_PTR = 2 }
 A struct that sets and gets a scheduler configuration. More...
 

Functions

int ABT_sched_config_create (ABT_sched_config *config,...)
 Create a new scheduler configuration. More...
 
int ABT_sched_config_read (ABT_sched_config config, int num_vars,...)
 Retrieve values from a scheduler configuration. More...
 
int ABT_sched_config_free (ABT_sched_config *config)
 Free a scheduler configuration. More...
 
int ABT_sched_config_set (ABT_sched_config config, int idx, ABT_sched_config_type type, const void *val)
 Register a value to a scheduler configuration. More...
 
int ABT_sched_config_get (ABT_sched_config config, int idx, ABT_sched_config_type *type, void *val)
 Retrieve a value from a scheduler configuration. More...
 

Variables

ABT_sched_config_var ABT_sched_config_var_end
 Predefined ABT_sched_config_var to mark the last parameter. More...
 
ABT_sched_config_var ABT_sched_basic_freq
 Predefined ABT_sched_config_var to configure the frequency for checking events of the basic scheduler. More...
 
ABT_sched_config_var ABT_sched_config_access
 Unused predefined ABT_sched_config_var. More...
 
ABT_sched_config_var ABT_sched_config_automatic
 Predefined ABT_sched_config_var to configure whether the scheduler is freed automatically or not. More...
 

Detailed Description

This group is for Scheduler config.

Typedef Documentation

◆ ABT_sched_config

typedef struct ABT_sched_config_opaque* ABT_sched_config

Scheduler configuration handle type.

A NULL handle of this type is ABT_SCHED_CONFIG_NULL.

Definition at line 852 of file abt.h.

Enumeration Type Documentation

◆ ABT_sched_config_type

A struct that sets and gets a scheduler configuration.

Enumerator
ABT_SCHED_CONFIG_INT 

Parameter of type int

ABT_SCHED_CONFIG_DOUBLE 

Parameter of type double

ABT_SCHED_CONFIG_PTR 

Parameter of type pointer

Definition at line 1336 of file abt.h.

Function Documentation

◆ ABT_sched_config_create()

int ABT_sched_config_create ( ABT_sched_config config,
  ... 
)

Create a new scheduler configuration.

ABT_sched_config_create() creates a new scheduler configuration and returns its handle through config.

The variadic arguments are an array of tuples composed of a variable of type ABT_sched_config_var and a value for this variable. The array must end with a single value ABT_sched_config_var_end.

Currently, Argobots supports the following hints:

  • ABT_sched_basic_freq:

    The frequency of event checks of the predefined scheduler. A smaller value indicates more frequent check. If this is not specified, the default value is used for scheduler creation.

  • ABT_sched_config_automatic:

    Whether the scheduler is automatically freed or not. If the value is ABT_TRUE, the scheduler is automatically freed when a work unit associated with the scheduler is freed. If this is not specified, the default value of each scheduler creation routine is used for scheduler creation.

  • ABT_sched_config_access:

    This is deprecated and ignored.

Note
To see the details of whether the scheduler is automatically freed or not, please check ABT_sched_create() and ABT_sched_create_basic().

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

Note
For example, this routine can be called as follows to configure the predefined scheduler to have a frequency for checking events equal to 5:

If the array contains multiple tuples that have the same idx of ABT_sched_config_var, idx is mapped to a corrupted value.

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_sched_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 the (2n+1)th element of the given variadic arguments is neither ABT_sched_config_var_end nor a variable of type ABT_sched_config_var, the results are undefined.
If the (2n+2)th element of the given variadic arguments is not a variable of a type specified by type of the (2n+1)th element of type ABT_sched_config_var, the results are undefined.
If config is NULL, the results are undefined.
Parameters
[out]configscheduler configuration handle
[in]...array of arguments
Returns
Error code

Definition at line 119 of file sched_config.c.

◆ ABT_sched_config_free()

int ABT_sched_config_free ( ABT_sched_config config)

Free a scheduler configuration.

ABT_sched_config_free() deallocates the resource used for the scheduler configuration sched_config and sets sched_config to ABT_SCHED_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_SCHED_CONFIG is returned if config points to ABT_SCHED_CONFIG_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]configscheduler configuration handle
Returns
Error code

Definition at line 269 of file sched_config.c.

◆ ABT_sched_config_get()

int ABT_sched_config_get ( ABT_sched_config  config,
int  idx,
ABT_sched_config_type type,
void *  val 
)

Retrieve a value from a scheduler configuration.

ABT_sched_config_get() reads a value associated with the index idx of ABT_sched_config_var from the scheduler 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 idx = 1.
int val;
ABT_sched_config_get(&config, var.idx, &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 idx.
ABT_ERR_INV_SCHED_CONFIG is returned if config is ABT_SCHED_CONFIG_NULL.
Undefined behavior
If Argobots is not initialized, the results are undefined.
If config is accessed concurrently, the results are undefined.
Parameters
[in]configscheduler configuration handle
[in]idxindex of a target value
[out]typetype of a target value
[out]valtarget value
Returns
Error code

Definition at line 388 of file sched_config.c.

◆ ABT_sched_config_read()

int ABT_sched_config_read ( ABT_sched_config  config,
int  num_vars,
  ... 
)

Retrieve values from a scheduler configuration.

ABT_sched_config_read() reads values from the scheduler configuration config and sets the values to variables given as the variadic arguments that contain at least num_vars pointers. This routine sets the i th argument where i starts from 0 to a value mapped to a tuple that has ABT_sched_config_var with its idx = i. Each argument needs to be a pointer of a type specified by a corresponding type of ABT_sched_config_var. If the i th argument is NULL, a value associated with idx = i is not copied. If a value associated with idx = i does not exist, the i th argument is not updated.

Note
For example, this routine can be called as follows to get a value that is corresponding to idx = 1.
// ABT_sched_config_var var = { 1, ABT_SCHED_CONFIG_INT };
int val;
ABT_sched_config_read(&config, 2, NULL, &val);
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 num_vars is negative.
ABT_ERR_INV_SCHED_CONFIG is returned if config is ABT_SCHED_CONFIG_NULL.
Undefined behavior
If Argobots is not initialized, the results are undefined.
Parameters
[in]configscheduler configuration handle
[in]num_varsnumber of variable pointers in ...
[out]...array of variable pointers
Returns
Error code

Definition at line 221 of file sched_config.c.

◆ ABT_sched_config_set()

int ABT_sched_config_set ( ABT_sched_config  config,
int  idx,
ABT_sched_config_type  type,
const void *  val 
)

Register a value to a scheduler configuration.

ABT_sched_config_set() associated a value pointed to by the value val with the index idx in the scheduler configuration config. This routine overwrites a value and its type if a value has already been associated with idx.

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

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

Note
This routine returns ABT_SUCCESS even if value is NULL but no value is associated with idx.
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_SCHED_CONFIG is returned if config is ABT_SCHED_CONFIG_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]configscheduler configuration handle
[in]idxindex of a target value
[in]typetype of a target value
[in]valtarget value
Returns
Error code

Definition at line 328 of file sched_config.c.

Variable Documentation

◆ ABT_sched_basic_freq

ABT_sched_basic_freq

Predefined ABT_sched_config_var to configure the frequency for checking events of the basic scheduler.

Its type is int. The user may not change its variables.

Definition at line 51 of file sched_config.c.

◆ ABT_sched_config_access

ABT_sched_config_access

Unused predefined ABT_sched_config_var.

Its type is int. Currently, this setting is ignored. The user may not change its variables.

Definition at line 44 of file sched_config.c.

◆ ABT_sched_config_automatic

ABT_sched_config_automatic

Predefined ABT_sched_config_var to configure whether the scheduler is freed automatically or not.

Its type is int. If the value is non-zero, the scheduler is freed automatically after its associated objects are released. If the value is zero, the scheduler is configured to be not freed automatically by the Argobots runtime. The user may not change its variables.

Definition at line 47 of file sched_config.c.

◆ ABT_sched_config_var_end

ABT_sched_config_var_end

Predefined ABT_sched_config_var to mark the last parameter.

Check ABT_sched_config_create() for details. The user may not change its variables.

Definition at line 40 of file sched_config.c.

ABT_sched_config_var
A struct that sets and gets a scheduler configuration.
Definition: abt.h:1349
ABT_sched_config_set
int ABT_sched_config_set(ABT_sched_config config, int idx, ABT_sched_config_type type, const void *val) ABT_API_PUBLIC
Register a value to a scheduler configuration.
Definition: sched_config.c:328
ABT_sched_config
struct ABT_sched_config_opaque * ABT_sched_config
Scheduler configuration handle type.
Definition: abt.h:852
ABT_sched_config_read
int ABT_sched_config_read(ABT_sched_config config, int num_vars,...) ABT_API_PUBLIC
Retrieve values from a scheduler configuration.
Definition: sched_config.c:221
ABT_sched_config_var::type
ABT_sched_config_type type
Definition: abt.h:1353
ABT_sched_config_var_end
ABT_sched_config_var ABT_sched_config_var_end
Predefined ABT_sched_config_var to mark the last parameter.
Definition: sched_config.c:40
ABT_SCHED_CONFIG_INT
@ ABT_SCHED_CONFIG_INT
Definition: abt.h:1338
ABT_sched_basic_freq
ABT_sched_config_var ABT_sched_basic_freq
Predefined ABT_sched_config_var to configure the frequency for checking events of the basic scheduler...
Definition: sched_config.c:51
ABT_sched_config_var::idx
int idx
Definition: abt.h:1351
ABT_sched_config_get
int ABT_sched_config_get(ABT_sched_config config, int idx, ABT_sched_config_type *p_type, void *val) ABT_API_PUBLIC
Retrieve a value from a scheduler configuration.
Definition: sched_config.c:388
ABT_sched_config_create
int ABT_sched_config_create(ABT_sched_config *config,...) ABT_API_PUBLIC
Create a new scheduler configuration.
Definition: sched_config.c:119
ABT_sched_config_type
ABT_sched_config_type
A struct that sets and gets a scheduler configuration.
Definition: abt.h:1336