On Feb 2, 2005, at 11:18 PM, Clotho wrote:
> I run lam testsuite 7.0.6 on EM64T and find error "Error in set/get
> attribute" for program comm/attrsetget_f.f . The program shows no
> error in 32 bit machines.
>
> Finally I find that I need to explicitly declare "integer" as
> "integer*8" to solve the problem.
>
> Here is part of the program
>
> ------------------------------
> :
> integer attr
> integer newattr
> :
> attr = 1234
> call MPI_Comm_set_attr(MPI_COMM_WORLD, key, attr, ierr)
> call MPI_Comm_get_attr(MPI_COMM_WORLD, key, newattr,
> + flag, ierr)
>
> if (newattr .ne. attr)then
> call lamtest_error_f('Error in set/get attribute')
> endif
> :
> -------------------------------
>
> Debug the program, I find that the "newattr" is correctly set to
> "1234", but "attr" is strangely modified to other values (eg., 1, 2)
> after MPI_Comm_get_attr().
>
> Declare "attr" and "newattr" with 8-bytes integers can solve the
> problem.
> integer*8 attr
> integer*8 newattr
Ugh. Silly fortran, changing the sizes of types.
This is actually somewhat odd, given the C wrapper code for this -- it
expects a C (int*), and assigns to it as such. I'm guessing that a C
int is 64 bits on your machine/compiler? If so, is a Fortran integer
not the same? That would be somewhat surprising -- are you mixing
compilers, perchance?
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|