cpusetGetMemList(3x)cpusetGetMemList(3x)NAMEcpusetGetMemList - get the list of all nodes with memory assigned to a
cpuset
SYNOPSIS
#include <cpuset.h>
cpuset_NodeList_t *cpusetGetMemList(char *qname);
DESCRIPTION
The cpusetGetMemList function is used to obtain the list of the nodes
with memory assigned to the specified cpuset. Only processes running
with a user ID or group ID that has read access permissions on the
permissions file can successfully execute this function. The qname
argument is the name of the specified cpuset.
The function returns a pointer to a structure of type cpuset_NodeList_t
(defined in <cpuset.h>). The function cpusetGetMemList allocates the
memory for the structure and the user is responsible for freeing the
memory using the function cpusetFreeNodeList(3x). The cpuset_NodeList_t
structure is defined as follows:
typedef struct {
int count;
cnodeid_t *list;
} cpuset_NodeList_t;
count is the number of node IDs in the list. list references the memory
array that holds the list of node IDs. The memory for list is allocated
when the cpuset_NodeList_t is allocated and it is released when the
cpuset_NodeList_t structure is released.
EXAMPLES
This example obtains the list of nodes with memory assigned to the cpuset
mpi_set and prints out the node ID values.
char *qname = "mpi_set";
cpuset_NodeList_t *mems;
int i;
/* Get the list of memory else print error & exit */
if ( !(mems = cpusetGetMemList(qname)) ) {
perror("cpusetGetMemList");
exit(1);
}
printf("CPUSET[%s] assigned Node memories:\n",
qname);
for (i = 0; i < memss->count; i++)
printf("MEM_NODE_ID[%d]\n", mems->list[i]);
cpusetFreeMemList(mems);
Page 1
cpusetGetMemList(3x)cpusetGetMemList(3x)NOTEScpusetGetMemList is found in the library "libcpuset.so", and will be
loaded if the option -lcpuset is used with cc(1) or ld(1).
SEE ALSOcpuset(1), cpusetFreeNodeList(3x), cpuset(5).
DIAGNOSTICS
If successful, cpusetGetMemList returns a pointer to a cpuset_MemList_t
structure. If cpusetGetMemList fails, it returns NULL and errno is set
to indicate the error. The possible values for errno include those
values as set by sysmp(2) and sbrk(2).
Page 2