ARGOBOTS
1.1
|
This group is for initialization and finalization of the Argobots environment. More...
Functions | |
int | ABT_init (int argc, char **argv) |
Initialize the Argobots execution environment. More... | |
int | ABT_finalize (void) |
Finalize the Argobots execution environment. More... | |
int | ABT_initialized (void) |
Check if the Argobots execution environment has been initialized. More... | |
This group is for initialization and finalization of the Argobots environment.
int ABT_finalize | ( | void | ) |
Finalize the Argobots execution environment.
If ABT_finalize()
is called at the first nesting level, ABT_finalize()
deallocates the resource used for the Argobots execution environment and sets the state of Argobots to uninitialized. If ABT_finalize()
is not called at the first nesting level, ABT_finalize()
decrements the reference counter atomically.
Initialization and finalization of Argobots are performed atomically.
Argobots can be initialized and finalized multiple times in a nested manner, but the caller of ABT_finalize()
must be the same as that of ABT_init()
at the same nesting level. Specifically, if ABT_finalize()
is called at the first nesting level, the caller must be the primary ULT that is running on the primary execution stream.
ABT_finalize()
is thread-safe, but calling ABT_finalize()
concurrently is discouraged because the user cannot guarantee the calling order of ABT_finalize()
although ABT_finalize()
needs to be called by the same caller as that of ABT_init()
at the same nesting level.
free()
while the main scheduler of the primary execution stream is freed during ABT_finalize()
. The detailed behavior of this routine will be clarified in the future.ABT_init()
at the same nesting level. This routine may switch the context of the calling ULT.ABT_SUCCESS
is returned if this routine succeeds.ABT_init()
at the same nesting level, the results are undefined.int ABT_init | ( | int | argc, |
char ** | argv | ||
) |
Initialize the Argobots execution environment.
ABT_init()
initializes the Argobots execution environment. If Argobots has not been initialized, the first caller of ABT_init()
becomes the primary ULT that is running on the primary execution stream. If Argobots has already been initialized, ABT_init()
increments a reference counter atomically. This routine returns ABT_SUCCESS
even if Argobots has already been initialized.
Initialization and finalization of Argobots are performed atomically.
Argobots must be finalized by ABT_finalize()
after its use. Argobots can be initialized and finalized multiple times in a nested manner, but the caller of ABT_finalize()
must be the same as that of ABT_init()
at the same nesting level.
ABT_init()
is thread-safe, but calling ABT_init()
concurrently is discouraged because the user cannot know the calling order of ABT_init()
, which is needed to finalize Argobots correctly. ABT_finalize()
needs to be called by the same caller as that of ABT_init()
at the same nesting level.
ABT_init()
can be called again after Argobots is finalized by ABT_finalize()
.This routine does not use the arguments argc
and argv
.
argc
and argv
, the caller of ABT_init()
does not need to be an external thread that starts a program (e.g., a POSIX thread that runs main()
).ABT_SUCCESS
is returned if this routine succeeds.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.[in] | argc | unused parameter |
[in] | argv | unused parameter |
int ABT_initialized | ( | void | ) |
Check if the Argobots execution environment has been initialized.
ABT_initialized()
returns ABT_SUCCESS
if the Argobots execution environment has been initialized. Otherwise, it returns ABT_ERR_UNINITIALIZED
.
Initialization and finalization of Argobots are performed atomically.
ABT_SUCCESS
is returned if the Argobots execution environment has been initialized.ABT_ERR_UNINITIALIZED
is returned if the Argobots execution environment has not been initialized.