1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2001 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
11 int main(int argc, char *argv[])
13 MPIR_Group group, *group_ptr = &group;
16 MPI_Init(&argc, &argv);
18 /* Setup a sample group */
23 group.idx_of_first_lpid = -1;
24 group.lrank_to_lpid = (MPII_Group_pmap_t *)
25 MPL_malloc(group.size * sizeof(MPII_Group_pmap_t));
26 for (i = 0; i < group.size; i++) {
27 group.lrank_to_lpid[i].lrank = i;
28 group.lrank_to_lpid[i].lpid = group.size - i - 1;
29 group.lrank_to_lpid[i].next_lpid = -1;
30 group.lrank_to_lpid[i].flag = 0;
33 /* Set up the group lpid list */
34 MPII_Group_setup_lpid_list(group_ptr);
36 /* Print the group structure */
37 printf("Index of first lpid = %d\n", group.idx_of_first_lpid);
38 for (i = 0; i < group.size; i++) {
39 printf("lrank_to_lpid[%d].next_lpid = %d, .lpid = %d\n",
40 i, group.lrank_to_lpid[i].next_lpid, group.lrank_to_lpid[i].lpid);