Re: About portable programming in fortran

From: Tim Prince (tprince_at_nospamcomputer.org)
Date: 03/29/05

  • Next message: glen herrmannsfeldt: "Re: About portable programming in fortran"
    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/


  • Next message: glen herrmannsfeldt: "Re: About portable programming in fortran"

    Relevant Pages

    • Re: GNU Fortran 95: Opinions?
      ... > that your Fortran code uses to message passing. ... I realize that -- but MPI is something used by many Fortran programmers. ... very few gfortran intrinsics. ...
      (comp.lang.fortran)
    • Fortran assumed-shape array problems with MPI
      ... I am using fortran 90 with MPI and I faced a ... declares the dummy argument as 4-dimensional assumed-shape array. ... the assumed-shape array problem is one of them. ...
      (comp.lang.fortran)
    • Re: Is there a tool or compiler option to make program crash as soon as access memory illegally
      ... I write parallel programs in Fortran / MPI and it's extremely easy to ... produce codes which crash with all sorts of mysterious memory errors ... want to debug a parallel program is a parallel debugger - which means ...
      (comp.unix.programmer)
    • Re: 64-bit integers & MPI/F90
      ... does someone know if there is an MPI datatype for 64-bit integers ... includes MPI_INTEGER8, but several versions of MPI still in widespread ... nonstandard datatypes offered by the underlying Fortran and C ... then the MPI implementation should offer an MPI ...
      (comp.lang.fortran)
    • Re: MPI Turotial live
      ... (Follow the link that says "MPI Tutorial") ... in MPI, particularly any technical errors. ... bullet of debugging the real comm scheme has to be bitten. ... On my system I have only C and Fortran 77. ...
      (comp.parallel.mpi)