Rate This Document
Findability
Accuracy
Completeness
Readability

kupl_egroup_reset

Reset an egroup to its initial state upon creation.

Interface Definition

void kupl_egroup_reset(kupl_egroup_h group);

Parameters

Parameter

Type

Description

Input/Output

group

kupl_egroup_h

An egroup object to be reset. If the egroup is nullptr, a global barrier is performed by default.

Input/Output

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>  
#include "kupl.h"  

int main()  
{  
    int executor_num = kupl_get_num_executors();  
    int n1 = executor_num/2;  
    int n2 = executor_num - executor_num/2; 
    int executors1[n1], executors2[n2];  
    for (int i =0; i < n1; i++) { 
        executors1[i] = i; 
    }  
    for (int i =0; i < n2; i++) { 
        executors2[i] = i + n1; 
    }  
    kupl_egroup_h egroup1 = kupl_egroup_create(executors1, n1);  
    kupl_egroup_h egroup2 = kupl_egroup_create(executors2, n2);  
    n1 = kupl_egroup_borrow(egroup1, egroup2);  
    kupl_egroup_reset(egroup1);  
    kupl_egroup_reset(egroup2); 
    kupl_egroup_destroy(egroup1);  
    kupl_egroup_destroy(egroup2);  
    return 0;  
}

The preceding example demonstrates how egroup1 and egroup2 are created, modified via the kupl_egroup_borrow function, and ultimately reset to their initial creation states using the kupl_egroup_reset function.