Scroll to navigation

PMIX_CPUSET_CREATE(3) OpenPMIx PMIX_CPUSET_CREATE(3)

PMIx_Cpuset_create — Allocate and initialize an array of pmix_cpuset_t(5) <#man5-pmix-cpuset-t> structures.

SYNOPSIS

#include <pmix.h>
pmix_cpuset_t* PMIx_Cpuset_create(size_t n);


Python Syntax

No Python equivalent

INPUT PARAMETERS

•
n: Number of pmix_cpuset_t(5) <#man5-pmix-cpuset-t> structures to allocate.

DESCRIPTION

Allocate a contiguous array of n pmix_cpuset_t <#man5-pmix-cpuset-t> structures on the heap and construct each element (zeroing its source and bitmap fields).

If n is zero, no allocation is performed and NULL is returned.

RETURN VALUE

Returns a pointer to the newly allocated and initialized array, or NULL if n is zero or the allocation fails.

NOTES

An array obtained from PMIx_Cpuset_create must be released with PMIx_Cpuset_free(3) <#man3-pmix-cpuset-free>, which destructs every element and frees the array storage itself. Pass the same count n used at creation.

The convenience macro PMIX_CPUSET_CREATE is provided as a wrapper around this function.

EXAMPLES

Create and later release an array of cpusets:

pmix_cpuset_t *array;
array = PMIx_Cpuset_create(2);
/* ... populate and use the cpusets ... */
PMIx_Cpuset_free(array, 2);


See also:

PMIx_Cpuset_free(3) <#man3-pmix-cpuset-free>, PMIx_Cpuset_construct(3) <#man3-pmix-cpuset-construct>, PMIx_Cpuset_destruct(3) <#man3-pmix-cpuset-destruct>, pmix_cpuset_t(5) <#man5-pmix-cpuset-t>


Copyright

2014-2026, OpenPMIx Community

November 5, 2026