Hi,

Recompiling OpenMPI with 

./configure FCFLAGS=-fdefault-integer-8 FFLAGS=-fdefault-integer-8 \
   --with-wrapper-fflags=-fdefault-integer-8 \
   --with-wrapper-fcflags=-fdefault-integer-8

is the easy way to go (at least for me). Changes to the Fortran code are 
minimal. Be aware that the underlying C code is still with 32bit int, and that 
arguments like counts will be downcasted to int.

If you don't recompile OpenMPI, then you will have to adapt' if not already 
done,  your Fortran code to reflect the types (kind=4) of communicators, types, 
error, sizes, rank, etc..

Yves Secretan
yves.secre...@ete.inrs.ca

Avant d'imprimer, pensez à l'environnement 


-----Message d'origine-----
De : users-boun...@open-mpi.org [mailto:users-boun...@open-mpi.org] De la part 
de Jeff Squyres
Envoyé : 29 juin 2012 07:03
À : war...@atmos.washington.edu; Open MPI Users
Objet : Re: [OMPI users] fortran program with integer kind=8 using openmpi

On Jun 28, 2012, at 8:37 PM, David Warren wrote:

> You should not have to recompile openmpi, but you do have to use the correct 
> type. You can check the size of integers in your fortrana nd use MPI_INTEGER4 
> or MPI_INTEGER8 depending on what you get.

If you configure ompi with -fdefault-integer-8, then OMPI will assume that 
Fortran integers are always 8 bytes, so be sure to also compile all of your MPI 
applications the same way.  Indeed, you may want to configure OMPI with 
something like:

./configure FCFLAGS=-fdefault-integer-8 FFLAGS=-fdefault-integer-8 \
   --with-wrapper-fflags=-fdefault-integer-8 \
   --with-wrapper-fcflags=-fdefault-integer-8

This will add -fdefault-integer-8 to the mpif77 and mpif90 command lines 
automatically so that you *can't* compile without that flag.

Be aware that 8-byte Fortran integers *should work* in Open MPI, but it is 
probably not well tested.  You may well run into some issues; be sure to let us 
know if you run into bugs.  Sending small test programs that show the problem 
are usually the best way to help us identify/fix the precise problem.

> in gfortran use
> integer i
> if(sizeof(i) .eq. 8) then
>     mpi_int_type=MPI_INTEGER8
> else
>     mpi_int_type=MPI_INTEGER4
> endif

I don't think that this should be necessary -- as long as you configured OMPI 
with the 8-byte-integer setting, then MPI_INTEGER should represent an 8 byte 
integer.

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/


_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

Reply via email to