[mpich-discuss] MPICH2 for Win: Topology functions
Rajeev Thakur
thakur at mcs.anl.gov
Tue Nov 27 13:31:56 CST 2012
Can you send us a small standalone test program that demonstrates the error?
Rajeev
On Nov 27, 2012, at 7:27 AM, Alejandro Allievi wrote:
> Hi,
>
> I'm setting up a grid topology and associated communicator using the
> function Setup_grid below. It works fine for process zero but throws:
>
> Fatal error in PMPI_Comm_rank: Invalid communicator, error stack:
> PMPI_Comm_rank(109): MPI_Comm_rank(MPI_COMM_NULL, rank=000000000022FE4C) failed
> PMPI_Comm_rank(66).: Null communicator
>
> Does MPICH2 for Win7 support topology functions???
>
> Thanks for any help.
>
> Alejandro
>
> ************CODE BELOW***************************
> void Setup_grid(GRID_INFO_T* grid /* out */) {
> int old_rank;
> int dimensions[2];
> int wrap_around[2];
> int coordinates[2];
> int free_coords[2];
>
>
> /* Set up Global Grid Information */
> MPI_Comm_size(MPI_COMM_WORLD, &(grid->p));
> MPI_Comm_rank(MPI_COMM_WORLD, &old_rank);
>
> printf("Process %d of %d inside Setup_Grid\n", old_rank, grid->p);
>
> /* We assume p is a perfect square */
> grid->q = (int) sqrt((double) grid->p);
> dimensions[0] = dimensions[1] = grid->q;
>
> /* We want a circular shift in second dimension. */
> /* Don't care about first */
> wrap_around[0] = wrap_around[1] = 1;
> MPI_Cart_create(MPI_COMM_WORLD, 2, dimensions,
> wrap_around, 1, &(grid->comm));
>
> MPI_Comm_rank(grid->comm, &(grid->my_rank));
> MPI_Cart_coords(grid->comm, grid->my_rank, 2, coordinates);
> grid->my_row = coordinates[0];
> grid->my_col = coordinates[1];
>
> /* Set up row communicators */
> free_coords[0] = 0;
> free_coords[1] = 1;
> MPI_Cart_sub(grid->comm, free_coords, &(grid->row_comm));
>
> /* Set up column communicators */
> free_coords[0] = 1;
> free_coords[1] = 0;
> MPI_Cart_sub(grid->comm, free_coords, &(grid->col_comm));
>
> printf("Process %d leaving Setup_Grid\n", old_rank);
>
> } /* Setup_grid */
>
> --
> Alejandro Allievi
> http://www.ace-net.ca/wiki/Alejandro_Allievi
>
> "Tenez, mon ami, si vous y pensez bien, vous trouverez qu'en tout,
> notre véritable sentiment n'est pas celui dans lequel nous n'avons
> jamais vacillé; mais celui auquel nous sommes le plus habituellement
> revenus". Denis Diderot.
>
> Este e-mail esta consignado sólo para el destinatario designado en el
> mismo y puede contener información confidencial y privilegiada. Su
> distribución o copiado está prohibido. Si Usted no fuera el
> destinatario designado, por favor notifíquenos de inmediato y destruya
> este e-mail en forma permanente así como todas las copias del mismo.
> Ce courriel peut renfermer des renseignements confidentiels et
> privilégiés et s'adresse au destinataire désigné seulement. La
> distribution ou la copie de ce courriel est interdit. Si vous n'êtes
> pas le destinataire désigné, veuillez nous en aviser immédiatement et
> détruire de façon permanente ce courriel ainsi que toute copie de
> celui-ci. This e-mail may contain confidential information, and is
> intended only for the named recipient and may be privileged.
> Distribution or copying of this email is prohibited. If you are not
> the named recipient, please notify us immediately and permanently
> destroy this email and all copies of it.
> _______________________________________________
> discuss mailing list discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
More information about the discuss
mailing list