ARGOBOTS  66b1c39742507d8df30e8d28c54839b961a14814
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
ULT Attributes

Functions

int ABT_thread_attr_create (ABT_thread_attr *newattr)
 Create a new ULT attribute object. More...
 
int ABT_thread_attr_free (ABT_thread_attr *attr)
 Free the ULT attribute object. More...
 
int ABT_thread_attr_set_stack (ABT_thread_attr attr, void *stackaddr, size_t stacksize)
 Set stack attributes. More...
 
int ABT_thread_attr_get_stack (ABT_thread_attr attr, void **stackaddr, size_t *stacksize)
 Get stack attributes. More...
 
int ABT_thread_attr_set_stacksize (ABT_thread_attr attr, size_t stacksize)
 Set the stack size in the attribute object. More...
 
int ABT_thread_attr_get_stacksize (ABT_thread_attr attr, size_t *stacksize)
 Get the stack size from the attribute object. More...
 
int ABT_thread_attr_set_callback (ABT_thread_attr attr, void(*cb_func)(ABT_thread thread, void *cb_arg), void *cb_arg)
 Set callback function and its argument in the attribute object. More...
 
int ABT_thread_attr_set_migratable (ABT_thread_attr attr, ABT_bool flag)
 Set the ULT's migratability in the attribute object. More...
 

Detailed Description

Attributes are used to specify ULT behavior that is different from the default. When a ULT is created with ABT_thread_create(), attributes can be specified with an ABT_thread_attr object.

Function Documentation

int ABT_thread_attr_create ( ABT_thread_attr newattr)

Create a new ULT attribute object.

ABT_thread_attr_create() creates a ULT attribute object with default attribute values. The handle to the attribute object is returned through newattr. The attribute object can be used in more than one ULT.

Parameters
[out]newattrhandle to a new attribute object
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 26 of file thread_attr.c.

int ABT_thread_attr_free ( ABT_thread_attr attr)

Free the ULT attribute object.

ABT_thread_attr_free() deallocates memory used for the ULT attribute object. If this function successfully returns, attr will be set to ABT_THREAD_ATTR_NULL.

Parameters
[in,out]attrhandle to the target attribute object
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 51 of file thread_attr.c.

int ABT_thread_attr_get_stack ( ABT_thread_attr  attr,
void **  stackaddr,
size_t *  stacksize 
)

Get stack attributes.

ABT_thread_attr_get_stack() retrieves the stack address and the stack size (in bytes) from the attribute attr to stackaddr and stacksize, respectively.

The user can obtain the ULT's attributes using ABT_thread_get_attr().

Parameters
[in]attrhandle to the target attribute object
[out]stackaddrstack address
[out]stacksizestack size in bytes
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 128 of file thread_attr.c.

int ABT_thread_attr_get_stacksize ( ABT_thread_attr  attr,
size_t *  stacksize 
)

Get the stack size from the attribute object.

ABT_thread_attr_get_stacksize() returns the stack size (in bytes) through stacksize from the attribute object associated with handle attr.

Parameters
[in]attrhandle to the target attribute object
[out]stacksizestack size in bytes
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 182 of file thread_attr.c.

int ABT_thread_attr_set_callback ( ABT_thread_attr  attr,
void(*)(ABT_thread thread, void *cb_arg)  cb_func,
void *  cb_arg 
)

Set callback function and its argument in the attribute object.

ABT_thread_attr_set_callback() sets the callback function and its argument, which will be invoked on ULT migration.

Parameters
[in]attrhandle to the target attribute object
[in]cb_funccallback function pointer
[in]cb_argargument for the callback function
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 204 of file thread_attr.c.

int ABT_thread_attr_set_migratable ( ABT_thread_attr  attr,
ABT_bool  flag 
)

Set the ULT's migratability in the attribute object.

ABT_thread_attr_set_migratable() sets the ULT's migratability in the target attribute object. If flag is ABT_TRUE, the ULT created with this attribute becomes migratable. On the other hand, if \ flag is ABT_FALSE, the ULT created with this attribute becomes unmigratable.

Parameters
[in]attrhandle to the target attribute object
[in]flagmigratability flag (ABT_TRUE: migratable, ABT_FALSE: not)
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 238 of file thread_attr.c.

int ABT_thread_attr_set_stack ( ABT_thread_attr  attr,
void *  stackaddr,
size_t  stacksize 
)

Set stack attributes.

ABT_thread_attr_set_stack() sets the stack address and the stack size (in bytes) in the attribute object associated with handle attr. If attr is used to create a ULT, the memory pointed to by stackaddr will be used as the stack area for the new ULT.

If stackaddr is NULL, a stack with size stacksize will be created by the Argobots runtime. If it is not NULL, it should be aligned by 8 (i.e., stackaddr & 0x7 must be zero), and the user has to deallocate the stack memory after the ULT, for which attr was used, terminates.

Parameters
[in]attrhandle to the target attribute object
[in]stackaddrstack address
[in]stacksizestack size in bytes
Returns
Error code
Return values
ABT_SUCCESSon success
ABT_ERR_OTHERinvalid stack address

Definition at line 84 of file thread_attr.c.

int ABT_thread_attr_set_stacksize ( ABT_thread_attr  attr,
size_t  stacksize 
)

Set the stack size in the attribute object.

ABT_thread_attr_set_stacksize() sets the stack size (in bytes) in the attribute object associated with handle attr.

Parameters
[in]attrhandle to the target attribute object
[in]stacksizestack size in bytes
Returns
Error code
Return values
ABT_SUCCESSon success

Definition at line 151 of file thread_attr.c.