File: groups.c

package info (click to toggle)
ga 5.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,472 kB
  • sloc: ansic: 192,963; fortran: 53,761; f90: 11,218; cpp: 5,784; makefile: 2,248; sh: 1,945; python: 1,734; perl: 534; csh: 134; asm: 106
file content (71 lines) | stat: -rw-r--r-- 1,325 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#if HAVE_CONFIG_H
#   include "config.h"
#endif

#include <stdlib.h>
#include <assert.h>

#include "armci.h"
#include "message.h"
#include "comex.h"

/* ARMCI has the notion of a default group and a world group. */
ARMCI_Group ARMCI_Default_Proc_Group = 0;


int ARMCI_Group_rank(ARMCI_Group *id, int *rank)
{
    return comex_group_rank(*id, rank);
}


void ARMCI_Group_size(ARMCI_Group *id, int *size)
{
    comex_group_size(*id, size);
}


int ARMCI_Absolute_id(ARMCI_Group *id, int group_rank)
{
    int world_rank;
    assert(COMEX_SUCCESS == 
            comex_group_translate_world(*id, group_rank, &world_rank));
    return world_rank;
}


void ARMCI_Group_set_default(ARMCI_Group *id) 
{
    ARMCI_Default_Proc_Group = *id;
}


void ARMCI_Group_get_default(ARMCI_Group *group_out)
{
    *group_out = ARMCI_Default_Proc_Group;
}


void ARMCI_Group_get_world(ARMCI_Group *group_out)
{
    *group_out = COMEX_GROUP_WORLD;
}


void ARMCI_Group_free(ARMCI_Group *id)
{
    comex_group_free(*id);
}


void ARMCI_Group_create_child(
        int n, int *pid_list, ARMCI_Group *id_child, ARMCI_Group *id_parent)
{
    comex_group_create(n, pid_list, *id_parent, id_child);
}


void ARMCI_Group_create(int n, int *pid_list, ARMCI_Group *group_out)
{
    comex_group_create(n, pid_list, ARMCI_Default_Proc_Group, group_out);
}