ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
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... | |
This group is for Scheduler config.
typedef struct ABT_sched_config_opaque* ABT_sched_config |
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.
ABT_sched_create()
and ABT_sched_create_basic()
.config
must be freed by ABT_sched_config_free()
after its use.
If the array contains multiple tuples that have the same idx
of ABT_sched_config_var
, idx
is mapped to a corrupted value.
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.ABT_sched_config_var_end
nor a variable of type ABT_sched_config_var
, the results are undefined.type
of the (2n+1)th element of type ABT_sched_config_var
, the results are undefined.config
is NULL
, the results are undefined.[out] | config | scheduler configuration handle |
[in] | ... | array of arguments |
Definition at line 119 of file sched_config.c.
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
.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_SCHED_CONFIG
is returned if config
points to ABT_SCHED_CONFIG_NULL
.config
is NULL
, the results are undefined.config
is accessed after calling this routine, the results are undefined.[in,out] | config | scheduler configuration handle |
Definition at line 269 of file sched_config.c.
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.
idx
= 1. 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
.config
is accessed concurrently, the results are undefined.[in] | config | scheduler configuration handle |
[in] | idx | index of a target value |
[out] | type | type of a target value |
[out] | val | target value |
Definition at line 388 of file sched_config.c.
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.
idx
= 1. 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
.[in] | config | scheduler configuration handle |
[in] | num_vars | number of variable pointers in ... |
[out] | ... | array of variable pointers |
Definition at line 221 of file sched_config.c.
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
.
idx
= 1. If value
is NULL
, this routine deletes a value associated with idx
if such exists.
ABT_SUCCESS
even if value
is NULL
but no value is associated with idx
.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.config
is accessed concurrently, the results are undefined.[in] | config | scheduler configuration handle |
[in] | idx | index of a target value |
[in] | type | type of a target value |
[in] | val | target value |
Definition at line 328 of file sched_config.c.
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 |
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 |
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 |
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.