[mpich-discuss] create group and communicator failed for RMA
Sufeng Niu
sniu at hawk.iit.edu
Thu Jul 18 16:02:50 CDT 2013
Hello,
in my mpi program, I create 3 groups and communicators:
forward_rank = (int *)malloc((numprocs-1) * sizeof(int));
backward_rank = (int *)malloc((numprocs-1) * sizeof(int));
comp_rank = (int *)malloc((numprocs-2) * sizeof(int));
for (i=0; i<numprocs-1; i++){
backward_rank[i] = i+1;
forward_rank[i] = i;
}
for (i=0; i<numprocs-2; i++){
comp_rank[i] = i+1;
}
MPI_Group global_group, fgroup, bgroup, cgroup; // forward
group, backward group, computation group
MPI_Comm MPI_FOR_WORLD, MPI_BACK_WORLD, MPI_COMP_WORLD; //
forward, backward, computation communicator
MPI_Comm_group(MPI_COMM_WORLD, &global_group);
MPI_Group_incl(global_group, numprocs-1, forward_rank, &bgroup);
MPI_Comm_create(MPI_COMM_WORLD, bgroup, &MPI_BACK_WORLD);
MPI_Group_incl(global_group, numprocs-1, backward_rank, &fgroup);
MPI_Comm_create(MPI_COMM_WORLD, fgroup, &MPI_FOR_WORLD);
MPI_Group_incl(global_group, numprocs-2, comp_rank, &cgroup);
MPI_Comm_create(MPI_COMM_WORLD, cgroup, &MPI_COMP_WORLD);
And I used them for my RMA operation
So in my main function transfer new communicator to another c file as:
udp_sub(win, &MPI_FOR_WORLD);
image_sub(rank, win, strip_buff, &MPI_FOR_WORLD, &MPI_BACK_WORLD,
&MPI_COMP_WORLD);
in udp_sub and image_sub function:
I called:
MPI_Win_create(image_buff, 2*image_info->image_size*sizeof(uint16),
sizeof(uint16), MPI_INFO_NULL, *MPI_FOR_WORLD, win);
but I got the error when I execute them:
MPI_Win_create(189): MPI_Win_create(base=0x7fe50c06c010, size=9216000,
disp_unit=2, MPI_INFO_NULL, MPI_COMM_NULL, win=0x1a5e940) failed
MPI_Win_create(116): Null communicator
I already transfer the communicator address to it, but I don't understand
why communicator is null. or I did in a wrong way? Any suggestions are
appreciate. Thank you!
--
Best Regards,
Sufeng Niu
ECASP lab, ECE department, Illinois Institute of Technology
Tel: 312-731-7219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130718/55a864cf/attachment.html>
More information about the discuss
mailing list