Scroll to navigation

PMIX_QUERY_CREATE(3) OpenPMIx PMIX_QUERY_CREATE(3)

PMIx_Query_create — Allocate and initialize an array of pmix_query_t(5) <#man5-pmix-query-t> structures.

SYNOPSIS

#include <pmix.h>
pmix_query_t* PMIx_Query_create(size_t n);


Python Syntax

No Python equivalent

INPUT PARAMETERS

•
n: Number of pmix_query_t(5) <#man5-pmix-query-t> structures to allocate in the array.

DESCRIPTION

Allocate a contiguous array of n pmix_query_t <#man5-pmix-query-t> structures on the heap and initialize each element by calling PMIx_Query_construct(3) <#man3-pmix-query-construct> on it. The returned array is owned by the caller and must eventually be released with PMIx_Query_free(3) <#man3-pmix-query-free> (passing the same count n) or, for a single-element array, with PMIx_Query_release(3) <#man3-pmix-query-release>.

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

RETURN VALUE

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

NOTES

The PMIX_QUERY_CREATE convenience macro is a direct wrapper for this function; it assigns the returned pointer to its first argument.

EXAMPLES

Create and later free an array of query structures:

pmix_query_t *queries;
queries = PMIx_Query_create(2);
/* ... populate queries[0], queries[1] ... */
PMIx_Query_free(queries, 2);


See also:

PMIx_Query_construct(3) <#man3-pmix-query-construct>, PMIx_Query_destruct(3) <#man3-pmix-query-destruct>, PMIx_Query_free(3) <#man3-pmix-query-free>, PMIx_Query_release(3) <#man3-pmix-query-release>, PMIx_Query_qualifiers_create(3) <#man3-pmix-query-qualifiers-create>, PMIx_Query_info(3) <#man3-pmix-query-info>, pmix_query_t(5) <#man5-pmix-query-t>


Copyright

2014-2026, OpenPMIx Community

November 5, 2026