Re: About portable programming in fortran
From: Tim Prince (tprince_at_nospamcomputer.org)
Date: 03/29/05
- Previous message: James Van Buskirk: "Re: INTERFACE problem"
- In reply to: Kamaraju Kusumanchi: "Re: About portable programming in fortran"
- Next in thread: glen herrmannsfeldt: "Re: About portable programming in fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Mar 2005 05:59:50 GMT
"Kamaraju Kusumanchi" <kk288@cornell.edu> wrote in message
news:d2ahre$ocp$1@news01.cit.cornell.edu...
> Steven G. Kargl wrote:
>> program a
>> integer, parameter :: sp = kind(1.e0) integer, parameter :: dp =
>> kind(1.d0)
>> real(sp) s
>> real(dp) d
>> complex(sp) c
>> complex(dp) z
>> s = 1.e0_sp d = 1.e0_dp c = cmplx(1.e0_sp,0.e0_sp) z =
>> cmplx(1.e0_dp,0.e0_dp) print *, sqrt(s), sqrt(d), sqrt(c), sqrt(z)
>> end program
>>
>
> I am not the OP, but I am also stuck with this question. While the above
> example works for sp and dp, things can get much more complicated. For
> example when you do MPI programming, you have to explicitly say the type
> of variable you are passing. Consider for example a call to MPI_alltoall
>
> call MPI_ALLTOALL(oned_array, 2, MPI_REAL, spare, 2, MPI_REAL, &
> MPI_COMM_WORLD, ierror)
>
>
> In this function, we need to pass a variable "MPI_REAL" which are
> predefined constants in the mpi. The size of MPI_REAL cannot be changed.
> So if you wish to go from sp to dp, the MPI_REAL should actually be
> replaced by MPI_DOUBLE_PRECISION.
>
> I really do not know the best solution for the above problem. Would
> welcome any suggestions...
As MPI doesn't really fall under "portable programming in Fortran," the
ubiquitous g77 style pre-processing is the nearest approximation. In the
same vein, there is a NG comp.parallel.mpi and a wiki
http://www.mpi-comm-world.org/
- Previous message: James Van Buskirk: "Re: INTERFACE problem"
- In reply to: Kamaraju Kusumanchi: "Re: About portable programming in fortran"
- Next in thread: glen herrmannsfeldt: "Re: About portable programming in fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|