[mpich-discuss] Overwriting mpi_waitany_
Matthieu Dorier
matthieu.dorier at irisa.fr
Wed Mar 5 15:00:19 CST 2014
Great, thanks!
Matthieu Dorier
PhD student at ENS Rennes
http://people.irisa.fr/Matthieu.Dorier
----- Mail original -----
> De: "Rajeev Thakur" <thakur at mcs.anl.gov>
> À: discuss at mpich.org
> Envoyé: Mercredi 5 Mars 2014 21:45:04
> Objet: Re: [mpich-discuss] Overwriting mpi_waitany_
>
> The C function returns the index with a 0 base. You have to add one to it to
> return the value in Fortran. See the last line of the Fortran binding for
> Waitany in MPICH.
>
> Rajeev
>
>
> On Mar 5, 2014, at 1:42 PM, Matthieu Dorier <matthieu.dorier at irisa.fr>
> wrote:
>
> > Hi,
> >
> > I'm trying to overwrite the weak symbol mpi_waitany_ (fortran symbol), but
> > I get an error (the function doesn't seem to work since it returns an
> > index of 0).
> > Here is my code, any idea why it doesn't work?
> >
> > void mpi_waitany_(MPI_Fint* count, MPI_Fint* array_of_requests,
> > MPI_Fint* index, MPI_Fint* status, MPI_Fint* err)
> > {
> > MPI_Status cstatus;
> > MPI_Status_f2c(status, &cstatus);
> > MPI_Request* c_req =
> > (MPI_Request*)malloc(sizeof(MPI_Request)*(*count));
> > int i;
> > for(i=0;i<*count;i++) {
> > c_req[i] = MPI_Request_f2c(array_of_requests[i]);
> > }
> > *err = PMPI_Waitany(*count,c_req,index,&cstatus);
> > MPI_Status_c2f(&cstatus, status);
> > for(i=0;i<*count;i++) {
> > array_of_requests[i] = MPI_Request_c2f(c_req[i]);
> > }
> > free(c_req);
> > }
> >
> > Thanks!
> >
> > Matthieu Dorier
> > PhD student at ENS Rennes
> > http://people.irisa.fr/Matthieu.Dorier
> > _______________________________________________
> > discuss mailing list discuss at mpich.org
> > To manage subscription options or unsubscribe:
> > https://lists.mpich.org/mailman/listinfo/discuss
>
> _______________________________________________
> 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