pthread_rad_attach(3) [osf1 man page]
pthread_rad_attach(3) Library Functions Manual pthread_rad_attach(3) NAME
pthread_rad_attach, pthread_rad_bind - Attaches or binds a thread to a NUMA Resource Affinity Domain (libpthread library) SYNOPSIS
#include <numa.h> int pthread_rad_attach( pthread_t thread, radset_t radset, ulong_t flags ); int pthread_rad_bind( pthread_t thread, radset_t radset, ulong_t flags ); PARAMETERS
Identifies the thread to be attached or bound to the specified set of Resource Affinity Domains (RADs). Identifies the RAD set to which the thread is to be attached or bound. DESCRIPTION
The pthread_rad_attach() function attaches the thread specified by the thread argument to the RAD set specified by the radset argument. The pthread_rad_bind() function binds the specified thread to the specified RAD set. While both functions assign a home RAD for the thread, an attach operation allows remote execution on other RADs while a bind operation restricts execution to the home RAD. In the following paragraphs, the term "assign" is used when the description refers equally to both the attach and the bind operations. The memory allocation policy for the process will be set to MPOL_THREAD. The home RAD for the process will be selected by the system sched- uler from among the RADs included in radset based on current system load balance and the flags argument. The overflow set (mattr_radset) for the process will be set to radset. The following symbolic values are defined for the flags argument: The requested assignments are mandatory. If this option is not set, the system will consider the request to be a "hint" and may take no action for any or all of specified processes. The thread has small memory requirements, so the system should (for the home RAD) favor those RADs with light CPU loads, independent of their available memory. The thread has large memory requirements, so the system should (for the home RAD) favor those RADs with more available memory, independent of their CPU loads. If the caller does not have partition administration privilege and if the radset argument contains RADs that are not in the caller's parti- tion, an error will be returned. NOTES
The value for the radset argument could be obtained from an nloc() call to assign or migrate the process to a RAD close (or closer) to a particular resource. When obtained in this manner, the radset value will identify RADs that were in the caller's partition at the time of the nloc() call. The partition configuration could change between the call to nloc() and a subsequent call to pthread_rad_attach(), result- ing in an error. An application should be prepared to handle this error, even though it should not be a frequent occurrence. RETURN VALUES
Success. Failure. In this case, the integer value indicates the type of error. Possible errors are as follows: The thread is hard attached (RAD_INSIST) to RADs or has memory wired (locked) on its current RAD such that it cannot be migrated to the specified RAD set. One of more of the RADs in the radset argument or options in the flags argument are invalid. RAD_INSIST and RAD_MIGRATE were specified, and the thread cannot be migrated because insufficient memory exists on RADs in the specified RAD set. The caller does not have appropriate privileges to assign processes to RADs in the specified RAD set. The thread specified by thread does not exist. ERRORS
None. SEE ALSO
Functions: nloc(3), pthread_rad_detach(3) pthread_rad_attach(3)
Check Out this Related Man Page
radsetops(3) Library Functions Manual radsetops(3) NAME
radsetops, radaddset, radandset, radcopyset, radcountset, raddelset, raddiffset, rademptyset, radfillset, radisemptyset, radismember, radorset, radsetcreate, radsetdestroy, radxorset - Perform operations on a set of Resource Affinity Domains (libnuma library) SYNOPSIS
#include <radset.h> int radaddset( radset_t set, radid_t radid ); int radandset( radset_t set_src1, radset_t set_src2, radset_t set_dst ); int radcopyset( radset_t set_src, radset_t set_dst ); int radcountset( radset_t set ); int raddelset( radset_t set, radid_t radid ); int raddiffset( radset_t set_src1, radset_t set_src2, radset_t set_dst ); int rademptyset( radset_t set ); int radfillset( radset_t set ); int radisemptyset( radset_t set ); int radismember( radset_t set, radid_t radid ); int radorset( radset_t set_src1, radset_t set_src2, radset_t set_dst ); int radsetcreate( radset_t *set ); int radsetdestroy( radset_t *set ); int radxorset( radset_t set_src1, radset_t set_src2, radset_t set_dst ); PARAMETERS
Identifies the RAD for which the function is requesting information or on which the function operates. Specifies or points to a set of Resource Affinity Domains (RADs) on which the function operates. Specifies, depending on the function, one of the following: A source RAD set that the function copies to a destination RAD set One of two RAD sets for which the function will find a logical difference One of two RAD sets on which the function will perform a logical AND, OR, or XOR operation Specifies the destination RAD set where the function stores the results of the logical operation it performs. DESCRIPTION
The radsetops primitives manipulate a specified set of Resource Affinity Domains (RADs). These functions operate on data objects (of type radset_t) that are created by calls to radsetcreate(). The radsetcreate() function allocates, and sets to empty, the specified RAD set. The radsetdestroy() function releases the RAD set memory allocated by radsetcreate(). The radfillset() function initializes the specified RAD set, such that all RADs that are currently configured in the caller's partition are included in that set. The radcountset() function returns the number of members in the specified RAD set. The rademptyset() function reinitializes the specified RAD set, such that no RADs are included in that set. The radisemptyset() function tests whether the specified RAD set is empty. The radismember() function tests whether the specified RAD is a member of the specified RAD set. The radaddset() and raddelset() functions respectively add or delete the specified RAD from the specified RAD set. The raddiffset() function finds the logical difference between the RAD sets specified by the arguments set_src1 and set_src2 and stores the result in the RAD set specified by set_dst. (The result is made up of those members included in set_src1 but not in set_src2.) The radandset(), radorset(), and radxorset()functions respectively perform a logical AND, OR, or XOR operation on the RAD sets specified by the arguments set_src1 and set_src2, storing the result in the RAD set specified by set_dst. RETURN VALUES
The radisemptyset() and radismember() functions return the following values: Success (True). Success (False). Failure. In this case, errno is set to indicate the type of error. The remaining functions return the following values: Success. Failure. In this case, errno is set to indicate the type of error. ERRORS
If the radcountset(), rademptyset(), radfillset(), radisemptyset(), radorset(), radxorset(), radandset(), raddiffset(), and radcopyset() functions fail, they set errno to the following value for the specified condition specified: The specified RAD set is invalid, possibly not created by radsetcreate(). If the radsetcreate() and radsetdestroy() functions fail, they set errno to one of the following values for the condition specified: The set argument points to an invalid address. (radsetcreate() only) No memory could be allocated for the RAD set. If the radaddset(), raddelset(), and radismember() functions fail, they set errno to one of the following values for the condition speci- fied: The specified RAD set is invalid, possibly not created by radsetcreate(). The value of radid is an invalid or unsupported RAD iden- tifier. EXAMPLES
The following example demonstrates various operations on RAD sets: #include <radset.h> int main() { radset_t radset, radset2; /* Create radsets - initialized as empty */ radsetcreate(&radset); radsetcreate(&radset2); /* demonstrate radset operations */ /* add rad 0 to radset */ if (radaddset(radset, 0) == -1) { perror("radaddset"); return 0; } /* copy radset to radset2 */ if (radcopyset(radset, radset2) == -1) { perror("radcopyset"); return 0; } /* add rad 1 to radset */ if (radaddset(radset, 1) == -1) { perror("radaddset"); return 0; } /* store the difference of radset and radset2 in radset */ if (raddiffset(radset, radset2, radset) == -1) { perror("raddiffset"); return 0; } /* Enumerate radset. */ while (1) { radid_t id; int flags = SET_CURSOR_CONSUME; rad_cursor_t rad_cursor = SET_CURSOR_INIT; id = rad_foreach(radset, flags, &rad_cursor); if (id == RAD_NONE) { printf(" "); break; } else { printf("%3d ", id); } } /* Destroy radset and radset2*/ radsetdestroy(&radset); radsetdestroy(&radset2); return 0; } SEE ALSO
Functions: numa_intro(3), rad_foreach(3) Files: numa_types(4) radsetops(3)