3
* This is to test GA_PGroup_create (is a collective operation)
4
* _pgroup_create -- helps to create different sized group from the given processes and helps to alocate different job for diffferent group
5
* groups are identified using the group handle
16
main(int argc, char **argv)
18
int rank, nprocs, i, j;
19
int p_Geven, p_Godd, p_size, mod, p_size_mod, *list_even=NULL, *list_odd=NULL;
21
MPI_Init(&argc, &argv);
23
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
24
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
26
MA_init(C_INT, 1000, 1000);
32
p_size_mod=p_size+mod;
33
list_even = (int*)malloc(p_size*sizeof(int));
34
list_odd = (int*)malloc(p_size*sizeof(int));
37
for(i=0; i<nprocs; i++)
46
for(i=0; i<nprocs; i++)
57
for(i=0; i<p_size; i++)
58
printf(" %d--> %d --:: -- %d\n", i, list_even[i], list_odd[i]);
62
printf("%d: My ID is %d :: %d --- nodeid & nnodes for GA \n", rank, GA_Nodeid(), GA_Nnodes());
64
p_Geven=GA_Pgroup_create(list_even, p_size_mod);
65
p_Godd=GA_Pgroup_create(list_odd, p_size);
68
printf("%d: My ID is %d :: %d -- even \n", rank, GA_Pgroup_nodeid(p_Geven), GA_Pgroup_nnodes(p_Geven));
70
printf("%d: My ID is %d :: %d --- odd\n", rank, GA_Pgroup_nodeid(p_Godd), GA_Pgroup_nnodes(p_Godd));