cpusetSetCPUList(3x)cpusetSetCPUList(3x)NAMEcpusetSetCPUList - set the list of all nodes with memory assigned to a
cpuset
SYNOPSIS
#include <cpuset.h>
int cpusetSetCPUList(cpuset_QueueDef_t *qdef, int count,
cnodeid_t *mem;
DESCRIPTION
The cpusetSetCPUList function is used to set the list of the CPU IDs that
will be assigned to the cpuset. The list of CPUs will be copied into
memory reference by the qdef argument, which must be allocated by the
cpusetAllocQueueDef(3x) function. For additional information on the
cpuset_QueueDef_t type, consult the cpusetAllocQueueDef(3x) man page.
The count argument is the number of CPU IDs in the list. The list
argument references the memory array that holds the list of CPU IDs that
will be included in the cpuset.
This list of CPUs will then be used when the cpuset is created, using the
cpusetCreate(3x) function, to determine what CPUs to include in the
cpuset.
EXAMPLES
This example sets the list of CPUs for the cpuset mpi_set.
cpuset_QueueDef_t *qdef = NULL;
int count = 4;
cnodeid_t cpus[] = {2,3,4,5}
/* Create qdef struct, zero CPUs specified */
qdef = cpusetAllocQueueDef(0);
/* Set the list of CPUs */
if ( !cpusetSetCPUList(qdef, count, mems)) ) {
perror("cpusetSetCPUList");
exit(1);
}
/* After setting other cpuset queue attributes */
/* Create the cpuset */
if ( !cpusetCreate("mpi_set", qdef) ) {
perror("cpusetCreate");
exit(1);
}
NOTEScpusetSetCPUList is found in the library "libcpuset.so", and will be
loaded if the option -lcpuset is used with cc(1) or ld(1).
Page 1
cpusetSetCPUList(3x)cpusetSetCPUList(3x)SEE ALSOcpuset(1), cpusetAllocQueueDef(3x), cpusetCreate(3x), cpuset(5).
DIAGNOSTICS
If successful, cpusetSetCPUList returns 1. If cpusetSetCPUList fails, it
returns 0 and errno is set to indicate the error.
Page 2