kupl_egroup_create
Create a KUPL egroup, which is a collection of KUPL executors.
Interface Definition
kupl_egroup_h kupl_egroup_create(int *executors, int executors_num);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
executors |
int * |
Executors that form the egroup. The specific parameter input method is to assign the IDs of the executors constituting the collection to this array. Constraint: 0 ≤ executors[i] ≤ kupl_get_num_executors() |
Input |
executors_num |
int |
Number of executors in the egroup Constraint: 0 ≤ executors_num ≤ kupl_get_num_executors() |
Input |
Return Value
- Success: created egroup
- Failure: nullptr
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <stdio.h> #include "kupl.h" int main() { int executor_num = kupl_get_num_executors(); int executors[executor_num]; for (int i =0; i < executor_num; i++) { executors[i] = i; } kupl_egroup_h egroup = kupl_egroup_create(executors, executor_num); kupl_egroup_destroy(egroup); return 0; } |
The preceding example demonstrates how to create and destroy an egroup. The kupl_egroup_create function creates an egroup containing all executors.
Parent topic: executor-Related Functions