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

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 815 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 1227 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 a variable of type ABT_sched_config_var in the given list has an invalid type.
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 102 of file 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 243 of file 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 200 of file 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 34 of file config.c.

Referenced by sched_init().

◆ 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 27 of file 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 30 of file config.c.

Referenced by sched_create().

◆ 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 23 of file config.c.

Referenced by ABT_sched_config_create().

ABT_sched_config
struct ABT_sched_config_opaque * ABT_sched_config
Scheduler configuration handle type.
Definition: abt.h:815
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: config.c:200
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: config.c:23
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: config.c:34
ABT_sched_config_create
int ABT_sched_config_create(ABT_sched_config *config,...) ABT_API_PUBLIC
Create a new scheduler configuration.
Definition: config.c:102