1
1
openmpi/ompi/mpi/f90/scripts/mpi_sizeof.f90.sh
Jeff Squyres f8e634d6ca Bring over /tmp/f90-stuff branch to the trunk.
svn merge -r 9453:9609 https://svn.open-mpi.org/svn/ompi/tmp/f90-stuff .

Several improvements over the current F90 MPI bindings:

- The capability to make 4 sizes of the F90 bindings:
  - trivial: only the F90-specific MPI functions (sizeof and a few
    others)
  - small: (this is the default) all MPI functions that do not take
    choice buffers
  - medium: small + all MPI functions that take one choice buffer
    (e.g., MPI_SEND)
  - large: all MPI functions, but those that take 2 choice buffers
    (e.g., MPI_GATHER) only allow both buffers to be of the same type
- Remove all non-standard MPI types (LOGICAL*x, CHARACTER*x)
- Remove use of selected_*_kind() and only use MPI-defined types
  (INTEGER*x, etc.)
- Decrease complexity of the F90 configure and build system

This commit was SVN r9610.
2006-04-11 03:33:38 +00:00

157 строки
4.4 KiB
Bash
Исполняемый файл

#! /bin/sh
. "$1/fortran_kinds.sh"
procedure='MPI_Sizeof'
rank=0
for kind in $lkinds
do
proc="${procedure}${rank}DL${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " logical*${kind}, intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_LOGICAL${kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for kind in $ikinds
do
proc="${procedure}${rank}DI${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " integer*${kind}, intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_INT${kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for kind in $rkinds
do
proc="${procedure}${rank}DR${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " real*${kind}, intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_REAL${kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for kind in $ckinds
do
case "$kind" in 4) size_kind='8' ; esac
case "$kind" in 8) size_kind='16' ; esac
case "$kind" in 16) size_kind='32' ; esac
proc="${procedure}${rank}DC${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " complex*${kind}, intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_COMPLEX${size_kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for rank in $ranks
do
case "$rank" in 1) dim=':' ; esac
case "$rank" in 2) dim=':,:' ; esac
case "$rank" in 3) dim=':,:,:' ; esac
case "$rank" in 4) dim=':,:,:,:' ; esac
case "$rank" in 5) dim=':,:,:,:,:' ; esac
case "$rank" in 6) dim=':,:,:,:,:,:' ; esac
case "$rank" in 7) dim=':,:,:,:,:,:,:' ; esac
for kind in $lkinds
do
proc="${procedure}${rank}DL${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " logical*${kind}, dimension(${dim}), intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_LOGICAL${kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for kind in $ikinds
do
proc="${procedure}${rank}DI${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " integer*${kind}, dimension(${dim}), intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_INT${kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for kind in $rkinds
do
proc="${procedure}${rank}DR${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " real*${kind}, dimension(${dim}), intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_REAL${kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
for kind in $ckinds
do
case "$kind" in 4) size_kind='8' ; esac
case "$kind" in 8) size_kind='16' ; esac
case "$kind" in 16) size_kind='32' ; esac
proc="${procedure}${rank}DC${kind}"
echo "subroutine ${proc}(x, size, ierr)"
echo " include 'mpif.h'"
echo " implicit none"
echo " include 'fortran_sizes.h'"
echo " complex*${kind}, dimension(${dim}), intent(in) :: x"
echo " integer, intent(out) :: size"
echo " integer, intent(out) :: ierr"
echo " size = OMPI_SIZEOF_F90_COMPLEX${size_kind}"
echo " ierr = 0"
echo "end subroutine ${proc}"
echo
done
echo
done
echo
echo
echo