Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nloc(3) [osf1 man page]

nloc(3) 						     Library Functions Manual							   nloc(3)

NAME
nloc - Queries the NUMA Topology or Resource Affinity Domains (libnuma library) SYNOPSIS
#include <numa.h> int nloc( numa_attr_t *numa_attr, radset_t radset ); PARAMETERS
Points to a structure that specifies the criteria for selecting a set of resource Affinity Domains (RADs). This structure contains the fol- lowing elements: The type of resource for which the set of "nearby" RADs is requested. The resource descriptor for which the RAD set is requested. The distance criteria for selecting resources. RADs in the caller's partition that have a distance <= this value will be included in the radset returned by nloc(). See DESCRIPTION for more information about nattr_distance. Flags that influence the selection of RADs. See DESCRIPTION for details. Specifies a buffer to contain the set of RADs in the caller's partition that satisfy the criteria specified by numa_attr. DESCRIPTION
The nloc() function will return in radset the set of RADs that have a distance <= the nattr_distance value from the specified resource. The returned radset value may be used as an argument to explicit process or thread placement APIs or in the mattr_radset member of a memory allocation policy structure for explicit memory placement. For simple NUMA topologies that have only two distances -- local and remote -- the following symbolic values for nattr_distance are defined: Represents the distance value for resources that are directly connected to the specified resource. Represents the maximum dis- tance value for the system. Generally, all RADs in the partition will be <= this distance. The following symbolic values are defined for the nattr_flags field: When specified, only RADs that have processes bound to them will be returned in radset. When specified, only RADs that do not have processes bound to them will be returned in radset. RETURN VALUES
Success. Failure. In this case, errno is set to indicate the error. ERRORS
If the nloc() function fails, it sets errno to one of the following values for the reason specified: The numa_attr argument (or its nattr_descr field) or the radset argument point to an invalid address. One or more of the following conditions are true: The numa_attr argument contains an undefined type value. The nattr_descr field contains an invalid resource value for the specified type. The nattr_distance or nattr_flags fields contain an invalid or undefined value. The process specified by rd_pid does not exist. There are too many symbolic links in rd_pathname. The rd_pathname length exceeds MAXPATHLEN, or a component of rd_pathname exceeds MAXNAMELEN. The file named by rd_pathname does not exist. A component of rd_pathname is not a directory. SEE ALSO
Functions: rad_get_info(3) Files: numa_types(4) nloc(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)
Man Page