cpusetSetNodeList(3x)cpusetSetNodeList(3x)NAMEcpusetSetNodeList - set the list of nodes assigned to a cpuset
SYNOPSIS
#include <cpuset.h>
int cpusetSetNodeList(cpuset_QueueDef_t *qdef, int count,
cnodeid_t *nodes);
DESCRIPTION
The cpusetSetNodeList function is used to set the list of nodes that will
be assigned to a cpuset. The assignment of a node to a cpuset results in
the assignment of all of the CPU and memory resources on the node to the
cpuset. The benefit of specifying resource assignments by node is that
it ensures none of the resources on the nodes will be shared by multiple
cpusets, provided the cpuset attribute flags indicate the resources
should be exclusive to the cpuset (see cpusetSetFlags(3x)).
The count argument is the number of node IDs provided in the list. The
nodes argument is the list of node IDs provided in a memory array. The
qdef argument references a block of memory that stores the various
attributes and resource lists that describe a cpuset. It must be
allocated using the cpusetAllocQueueDef(3x) function in order to use
cpusetSetNodeList. The list of nodes will be copied into the memory
referenced by the qdef argument.
The list of nodes will be used during a subsequent call to
cpusetCreate(3x) to determine what resources, CPU and memory, should be
assigned to the cpuset being created.
EXAMPLES
This example set the list of nodes assigned to the cpuset mpi_set.
cpuset_QueueDef_t *qdef;
int count = 4;
int nodes = {2,3,4,5}
/* Create a cpuset definition with 0 CPUs defined */
qdef = cpusetAllocQueueDef(0);
/* Get the list of nodes else print error & exit */
if ( !cpusetSetNodeList(qdef, count, nodes) ) {
perror("cpusetSetNodeList");
exit(1);
}
/* Set other cpuset attributes */
if (!cpusetCreate("mpi_set", qdef)) {
perror("cpusetCreate");
exit(1);
}
Page 1
cpusetSetNodeList(3x)cpusetSetNodeList(3x)NOTEScpusetSetNodeList 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), cpusetAllocQueueDef(3x), cpusetCreate(3x), cpusetSetFlags(3x),
cpuset(5).
DIAGNOSTICS
If successful, cpusetSetNodeList returns 1. If cpusetSetNodeList fails,
it returns 0 and errno is set to indicate the error.
Page 2