Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] bug in openmpi-1.3/ompi/mpi/f77/profile/pcart_coords_f.c
From: George Bosilca (bosilca_at_[hidden])
Date: 2009-02-04 10:06:42


Christoph,

You're absolutely right. In addition to your comment about the
syntactically wrong line of code, even in the case when the fortran
and C integers have the same length, we modify the value pointer by
the fortran IN only argument.
A patch is on the way.

   Thanks,
     george.

On Feb 4, 2009, at 09:21 , Christoph van Wüllen wrote:

> dear developers,
>
> there is an error in the above mentioned file, in line 74:
>
> if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
> OMPI_ARRAY_INT_2_FINT(coords, OMPI_FINT_2_INT(*maxdims));
>
> the OMPI_ARRAY_INT_2_FINT macro uses the second argument with
> pre-decrement, such that it must be an lvalue and should not
> contain a type-cast.
>
> In the built at hand this code expands to
>
> if (0 == (int) (*ierr)) {
> while((int) (*maxdims) > 0) { coords[(int) (*maxdims) - 1] =
> c_coords[(int) (*maxdims) - 1]; --(int) (*maxdims); } free(c_coords);
> }
>
> if MPI_FINT is, e.g. "long long" (that is, if FORTRAN integers are
> 64 bit, but C int/long is 32 bit), and
>
> --(int) (*maxdims)
>
> is not correct syntactically. I guess one could omit the
> OMPI_FINT_2_INT in the second line, but you should check this.
>
> Anyway, bad testing. The code has probably never been build for
> FORTRAN with 64-bit integers.
>
> Never mind,
>
> +---------------------------------+----------------------------------+
> | Prof. Christoph van Wüllen | Tele-Phone (+49) (0)631 205 2749 |
> | TU Kaiserslautern, FB Chemie | Tele-Fax (+49) (0)631 205 2750 |
> | Erwin-Schrödinger-Str. | |
> | D-67663 Kaiserslautern, Germany | vanWullen_at_[hidden] |
> | |
> | HomePage: http://www.chemie.uni-kl.de/wcms/ag-vanwullen.html |
> +---------------------------------+----------------------------------+
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel