⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpi_sizeof.f90.sh

📁 MPI stands for the Message Passing Interface. Written by the MPI Forum (a large committee comprising
💻 SH
字号:
#! /bin/sh## Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana#                         University Research and Technology#                         Corporation.  All rights reserved.# Copyright (c) 2004-2005 The University of Tennessee and The University#                         of Tennessee Research Foundation.  All rights#                         reserved.# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, #                         University of Stuttgart.  All rights reserved.# Copyright (c) 2004-2005 The Regents of the University of California.#                         All rights reserved.# Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.# $COPYRIGHT$# # Additional copyrights may follow# # $HEADER$#. "$1/fortran_kinds.sh"procedure='MPI_Sizeof'rank=0for kind in $lkindsdo    proc="${procedure}${rank}DL${kind}"    echo "subroutine ${proc}(x, size, ierr)"    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}"    echodonefor kind in $ikindsdo    proc="${procedure}${rank}DI${kind}"    echo "subroutine ${proc}(x, size, ierr)"    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}"    echodonefor kind in $rkindsdo    proc="${procedure}${rank}DR${kind}"    echo "subroutine ${proc}(x, size, ierr)"    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}"    echodonefor kind in $ckindsdo    proc="${procedure}${rank}DC${kind}"    echo "subroutine ${proc}(x, size, ierr)"    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${kind}"    echo "  ierr = 0"    echo "end subroutine ${proc}"    echodonefor rank in $ranksdo  case "$rank" in  1)  dim='*'  ;  esac  case "$rank" in  2)  dim='1,*'  ;  esac  case "$rank" in  3)  dim='1,1,*'  ;  esac  case "$rank" in  4)  dim='1,1,1,*'  ;  esac  case "$rank" in  5)  dim='1,1,1,1,*'  ;  esac  case "$rank" in  6)  dim='1,1,1,1,1,*'  ;  esac  case "$rank" in  7)  dim='1,1,1,1,1,1,*'  ;  esac  for kind in $lkinds  do    proc="${procedure}${rank}DL${kind}"    echo "subroutine ${proc}(x, size, ierr)"    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 "  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 "  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    proc="${procedure}${rank}DC${kind}"    echo "subroutine ${proc}(x, size, ierr)"    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${kind}"    echo "  ierr = 0"    echo "end subroutine ${proc}"    echo  done  echodoneechoechoecho

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -