1
1

ompi/fortran: remove proof-of-concept mpi_f08 module

This module was always intended to be a proof of concept, and was far
from complete.  If/when someone implemented F08 descriptor support for
the mpi_f08 module, this commit can either be restored or used as
reference material.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2017-08-10 05:41:27 -07:00
родитель 1a70e5bd16
Коммит 791bcee6c0
29 изменённых файлов: 45 добавлений и 1577 удалений

Просмотреть файл

@ -1,6 +1,6 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
@ -35,8 +35,6 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
ompi/mpi/fortran/use-mpi-f08/Makefile
ompi/mpi/fortran/use-mpi-f08/mod/Makefile
ompi/mpi/fortran/use-mpi-f08-desc/Makefile
ompi/mpi/fortran/use-mpi-f08-desc/mod/Makefile
ompi/mpi/fortran/mpiext/Makefile
ompi/mpi/tool/Makefile
ompi/mpi/tool/profile/Makefile

Просмотреть файл

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 IBM Corporation. All rights reserved.
dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
@ -231,26 +231,6 @@ AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check,
AC_DEFINE_UNQUOTED(OMPI_PARAM_CHECK, $ompi_param_check,
[Whether we want to check MPI parameters never or possible (an integer constant)])
#
# Do we want the prototype "use mpi_f08" implementation that uses
# Fortran descriptors?
#
AC_MSG_CHECKING([which 'use mpi_f08' implementation to use])
AC_ARG_ENABLE(mpi-f08-subarray-prototype,
AC_HELP_STRING([--enable-mpi-f08-subarray-prototype],
[Use the PROTOTYPE and SEVERLY FUNCTIONALITY-LIMITED Fortran 08 'use mpi_f08' implementation that supports subarrrays (via Fortran descriptors). This option will disable the normal 'use mpi_f08' implementation and *only* build the prototype implementation.]))
OMPI_BUILD_FORTRAN_F08_SUBARRAYS=0
AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -lt $OMPI_FORTRAN_USEMPIF08_BINDINGS],
[AC_MSG_RESULT([none (use mpi_f08 disabled)])],
[AS_IF([test "$enable_mpi_f08_subarray_prototype" = "yes"],
[OMPI_BUILD_FORTRAN_F08_SUBARRAYS=1],
[AC_MSG_RESULT([regular (no subarray support)])])
])
AC_DEFINE_UNQUOTED([OMPI_BUILD_FORTRAN_F08_SUBARRAYS],
[$OMPI_BUILD_FORTRAN_F08_SUBARRAYS],
[Whether we built the 'use mpi_f08' prototype subarray-based implementation or not (i.e., whether to build the use-mpi-f08-desc prototype or the regular use-mpi-f08 implementation)])
AC_ARG_ENABLE([mpi-io],
[AC_HELP_STRING([--disable-mpi-io],
[Disable built-in support for MPI-2 I/O, likely because

Просмотреть файл

@ -3,7 +3,7 @@ dnl
dnl Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
dnl Copyright (c) 2011-2012 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2015-2017 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
@ -215,8 +215,8 @@ module mpi_f08_ext
EOF
# Only build this mpi_f08_ext module if we're building the "use
# mpi_f08" module *and* it's the non-descriptor one.
AS_IF([test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS]
# mpi_f08" module
AS_IF([test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS],
[OMPI_BUILD_FORTRAN_USEMPIF08_EXT=1],
[OMPI_BUILD_FORTRAN_USEMPIF08_EXT=0])
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPIF08_EXT,

Просмотреть файл

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
dnl Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
dnl reserved.
@ -34,8 +34,6 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
OMPI_FORTRAN_USEMPI_DIR=
OMPI_FORTRAN_USEMPI_LIB=
OMPI_FORTRAN_USEMPIF08_DIR=
OMPI_FORTRAN_USEMPIF08_MOD=
OMPI_FORTRAN_USEMPIF08_LIB=
OMPI_FORTRAN_MAX_ARRAY_RANK=0
@ -52,7 +50,6 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
OMPI_FORTRAN_HAVE_BIND_C_TYPE_NAME=0
OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK=0
OMPI_FORTRAN_HAVE_PRIVATE=0
OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.FALSE.
# These macros control symbol names for Fortran/C interoperability
#
@ -533,35 +530,20 @@ end type test_mpi_handle],
OMPI_FORTRAN_HAVE_F08_ASSUMED_RANK=1])
# Which mpi_f08 implementation are we using?
# a) partial, proof-of-concept that supports array
# subsections (Intel compiler only)
# b) compiler supports BIND(C) and optional arguments
# a) compiler supports BIND(C) and optional arguments
# ("good" compilers)
# c) compiler that does not support the items listed
# b) compiler that does not support the items listed
# in b) ("bad" compilers)
AC_MSG_CHECKING([which mpi_f08 implementation to build])
AS_IF([test $OMPI_BUILD_FORTRAN_F08_SUBARRAYS -eq 1],
[ # Case a) partial/prototype implementation
OMPI_FORTRAN_USEMPIF08_DIR=mpi/fortran/use-mpi-f08-desc
OMPI_FORTRAN_USEMPIF08_MOD=$OMPI_FORTRAN_USEMPIF08_DIR/mod
OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.TRUE.
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=0
AC_MSG_RESULT([array subsections (partial/experimental)])
AS_IF([test $OMPI_FORTRAN_HAVE_OPTIONAL_ARGS -eq 1],
[ # Case a) "good compiler"
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=0
AC_MSG_RESULT(["good" compiler, no array subsections])
],
[ # Both cases b) and c)
OMPI_FORTRAN_USEMPIF08_DIR=mpi/fortran/use-mpi-f08
OMPI_FORTRAN_USEMPIF08_MOD=$OMPI_FORTRAN_USEMPIF08_DIR/mod
OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.FALSE.
AS_IF([test $OMPI_FORTRAN_HAVE_OPTIONAL_ARGS -eq 1],
[ # Case b) "good compiler"
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=0
AC_MSG_RESULT(["good" compiler, no array subsections])
],
[ # Case c) "bad compiler"
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1
AC_MSG_RESULT(["bad" compiler, no array subsections])
])
[ # Case b) "bad compiler"
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1
AC_MSG_RESULT(["bad" compiler, no array subsections])
])
])
@ -702,9 +684,6 @@ end type test_mpi_handle],
# use mpi_f08 final setup
# -------------------
# This goes into ompi/Makefile.am
AC_SUBST(OMPI_FORTRAN_USEMPIF08_DIR)
AC_SUBST(OMPI_FORTRAN_USEMPIF08_MOD)
# This goes into mpifort-wrapper-data.txt
AC_SUBST(OMPI_FORTRAN_USEMPIF08_LIB)
@ -718,12 +697,6 @@ end type test_mpi_handle],
AC_SUBST(OMPI_F08_SUFFIX)
AC_SUBST(OMPI_F_SUFFIX)
# This goes into ompi/mpi/fortran/configure-fortran-output.h
AC_SUBST(OMPI_FORTRAN_SUBARRAYS_SUPPORTED)
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_SUBARRAYS_SUPPORTED,
[$OMPI_FORTRAN_SUBARRAYS_SUPPORTED],
[Value to load to the MPI_SUBARRAYS_SUPPORTED compile-time constant])
# This is used to generate weak symbols (or not) in
# ompi/mpi/fortran/mpif-h/<foo>_f.c, and
# ompi/mpi/fortran/configure-fortran-output.h.

Просмотреть файл

@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008-2017 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2010-2011 Sandia National Laboratories. All rights reserved.
# Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
@ -90,9 +90,9 @@ SUBDIRS = \
mpi/fortran/mpif-h \
$(OMPI_MPIEXT_USEMPI_DIR) \
$(OMPI_FORTRAN_USEMPI_DIR) \
$(OMPI_FORTRAN_USEMPIF08_MOD) \
mpi/fortran/use-mpi-f08/mod \
$(OMPI_MPIEXT_USEMPIF08_DIRS) \
$(OMPI_FORTRAN_USEMPIF08_DIR) \
mpi/fortran/use-mpi-f08 \
mpi/fortran/mpiext \
$(MCA_ompi_FRAMEWORK_COMPONENT_DSO_SUBDIRS) \
$(OMPI_CONTRIB_SUBDIRS)
@ -121,8 +121,6 @@ DIST_SUBDIRS = \
mpi/fortran/use-mpi-ignore-tkr \
mpi/fortran/use-mpi-f08 \
mpi/fortran/use-mpi-f08/mod \
mpi/fortran/use-mpi-f08-desc \
mpi/fortran/use-mpi-f08-desc/mod \
mpi/fortran/mpiext \
mpi/java \
$(OMPI_MPIEXT_ALL_SUBDIRS) \

Просмотреть файл

@ -10,7 +10,7 @@
! University of Stuttgart. All rights reserved.
! Copyright (c) 2004-2005 The Regents of the University of California.
! All rights reserved.
! Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
! Copyright (c) 2013 Los Alamos National Security, LLC. All rights
! reserved.
! $COPYRIGHT$
@ -74,7 +74,8 @@
!
logical MPI_SUBARRAYS_SUPPORTED
logical MPI_ASYNC_PROTECTS_NONBLOCKING
parameter (MPI_SUBARRAYS_SUPPORTED=@OMPI_FORTRAN_SUBARRAYS_SUPPORTED@)
! Hard-coded for .false. for now
parameter (MPI_SUBARRAYS_SUPPORTED= .false.)
! Hard-coded for .false. for now
parameter (MPI_ASYNC_PROTECTS_NONBLOCKING = .false.)

Просмотреть файл

@ -1,98 +0,0 @@
/************** Example ISO_Fortran_binding.h ********************/
#include <stdint.h>
#include <stddef.h>
/* Struct CFI_dim_t for triples of bound, extent and stride information */
typedef struct {
intptr_t lower_bound,
extent,
sm;
} CFI_dim_t;
typedef struct {
intptr_t lower_bound,
upper_bound,
stride;
} CFI_bounds_t;
/* Maximum rank supported by the companion Fortran processor */
/* Changed from 15 to F2003 value of 7 (CER) */
#define CFI_MAX_RANK 7
/* Struct CFI_cdesc_t for holding all the information about a
descriptor-based Fortran object */
typedef struct {
void * base_addr; /* base address of object */
size_t elem_len; /* length of one element, in bytes */
int rank; /* object rank, 0 .. CF_MAX_RANK */
int type; /* identifier for type of object */
int attribute; /* object attribute: 0..2, or -1 */
int state; /* allocation/association state: 0 or 1 */
//Removed (CER)
//void * fdesc; /* pointer to corresponding Fortran descriptor */
CFI_dim_t dim[CFI_MAX_RANK]; /* dimension triples */
} CFI_cdesc_t;
/* function prototypes */
int CFI_update_cdesc ( CFI_cdesc_t * );
int CFI_update_fdesc ( CFI_cdesc_t * );
int CFI_allocate ( CFI_cdesc_t *, const CFI_bounds_t bounds[] );
int CFI_deallocate ( CFI_cdesc_t * );
int CFI_is_contiguous ( const CFI_cdesc_t *, _Bool * );
int CFI_bounds_to_cdesc ( const CFI_bounds_t bounds[] , CFI_cdesc_t * );
int CFI_cdesc_to_bounds ( const CFI_cdesc_t * , CFI_bounds_t bounds[] );
/* Sympolic names for attributes of objects */
#define CFI_attribute_assumed 0
#define CFI_attribute_allocatable 1
#define CFI_attribute_pointer 2
/* Symbolic names for type identifiers */
#define CFI_type_unknown 0
#define CFI_type_struct 100
#define CFI_type_signed_char 1
#define CFI_type_short 3
#define CFI_type_int 5
#define CFI_type_long 7
#define CFI_type_long_long 9
#define CFI_type_size_t 11
#define CFI_type_int8_t 12
#define CFI_type_int16_t 14
#define CFI_type_int32_t 16
#define CFI_type_int64_t 18
#define CFI_type_int_least8_t 20
#define CFI_type_int_least16_t 22
#define CFI_type_int_least32_t 24
#define CFI_type_int_least64_t 26
#define CFI_type_int_fast8_t 28
#define CFI_type_int_fast16_t 30
#define CFI_type_int_fast32_t 32
#define CFI_type_int_fast64_t 34
#define CFI_type_intmax_t 36
#define CFI_type_intptr_t 37
#define CFI_type_float 38
#define CFI_type_double 39
#define CFI_type_long_double 40
#define CFI_type_float_Complex 41
#define CFI_type_double_Complex 42
#define CFI_type_long_double_Complex 43
#define CFI_type_Bool 44
#define CFI_type_char 45
/* End of Example ISO_Fortran_binding.h */

Просмотреть файл

@ -1,103 +0,0 @@
# -*- makefile -*-
#
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015-2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This Makefile is only relevant if we're building the "use mpi_f08"
# MPI bindings.
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
-I$(top_srcdir) -Imod $(FCFLAGS)
lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08.la
module_sentinel_file = \
mod/libforce_usempif08_internal_modules_to_be_built.la
#
# This list is a subset of the full MPI API used for testing Fortran
# descriptors usage in MPI-3
#
mpi_api_files = \
comm_rank_f08.f90 \
comm_size_f08.f90 \
finalize_f08.f90 \
init_f08.f90 \
recv_f08_desc.f90 \
send_f08_desc.f90 \
type_commit_f08.f90 \
type_contiguous_f08.f90 \
type_vector_f08.f90
lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \
$(mpi_api_files) \
mpi-f-interfaces-bind.h \
mpi-f08.f90 \
ISO_Fortran_binding.h \
OMPI_Fortran_binding.f90 \
OMPI_Fortran_binding_c.c \
constants.h \
constants.c
#
# Clean up all F90 module files
#
MOSTLYCLEANFILES = *.mod
#
# Automake doesn't do Fortran dependency analysis, so must list them
# manually here. Bummer!
#
OMPI_Fortran_binding.lo: OMPI_Fortran_binding.f90 mod/mpi-f08-types.lo
#
# Automake doesn't do Fortran dependency analysis, so must list them
# manually here. Bummer!
#
mpi_api_lo_files = $(mpi_api_files:.f90=.lo)
$(mpi_api_lo_files): mpi-f08.lo
mpi-f08.lo: $(module_sentinel_file)
mpi-f08.lo: OMPI_Fortran_binding.lo
mpi-f08.lo: mpi-f-interfaces-bind.h
mpi-f08.lo: mpi-f08.f90
# Install the generated .mod files. Unfortunately, each F90 compiler
# may generate different filenames, so we have to use a glob. :-(
install-exec-hook:
@ for file in `ls *.mod`; do \
echo $(INSTALL) $$file $(DESTDIR)$(libdir); \
$(INSTALL) $$file $(DESTDIR)$(libdir); \
done
uninstall-local:
@ for file in `ls *.mod`; do \
echo rm -f $(DESTDIR)$(libdir)/$$file; \
rm -f $(DESTDIR)$(libdir)/$$file; \
done
else
# Need to have empty targets because AM can't handle having an
# AM_CONDITIONAL was targets in the "if" statement but not in the
# "else". :-(
install-exec-hook:
uninstall-local:
endif

Просмотреть файл

@ -1,142 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! $COPYRIGHT$
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Fortran equivalent of ISO_Fortran_binding.h
! - this is used temporarily until compilers support the TR
!
module OMPI_Fortran_binding
use mpi_f08_types
use, intrinsic :: ISO_C_BINDING
!
! The following types and procedures are here temporarily,
! for testing purposes only
!
integer, parameter :: INTPTR_T_KIND = C_INTPTR_T
integer, parameter :: CFI_MAX_RANK = 7 ! until F2008 compilers
type, bind(C) :: CFI_dim_t
integer(INTPTR_T_KIND) :: lower_bound, extent, sm;
end type CFI_dim_t
type, bind(C) :: CFI_cdesc_t
type(C_PTR) :: base_addr ! base address of object
integer(C_SIZE_T) :: elem_len ! length of one element, in bytes
integer(C_INT) :: rank ! object rank, 0 .. CF_MAX_RANK
integer(C_INT) :: type ! identifier for type of object
integer(C_INT) :: attribute ! object attribute: 0..2, or -1
integer(C_INT) :: state ! allocation/association state: 0 or 1
type(CFI_dim_t) :: dim(CFI_MAX_RANK) ! dimension triples
end type CFI_cdesc_t
interface
subroutine ompi_recv_f08_desc_f(desc,count,datatype,dest,tag,comm,status,ierror) &
BIND(C, name="ompi_recv_f08_desc_f")
use mpi_f08_types, only : MPI_Status
import CFI_cdesc_t
implicit none
type(CFI_cdesc_t) :: desc
INTEGER, INTENT(IN) :: count, dest, tag
INTEGER, INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: comm
TYPE(MPI_Status), INTENT(OUT) :: status
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_recv_f08_desc_f
subroutine ompi_send_f08_desc_f(desc,count,datatype,dest,tag,comm,ierror) &
BIND(C, name="ompi_send_f08_desc_f")
import CFI_cdesc_t
implicit none
type(CFI_cdesc_t) :: desc
INTEGER, INTENT(IN) :: count, dest, tag
INTEGER, INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_send_f08_desc_f
function ompi_f08_addr(buf) &
BIND(C, name="ompi_f08_addr")
import :: C_PTR
type(C_PTR), value :: buf
type(C_PTR) :: ompi_f08_addr
end function ompi_f08_addr
subroutine ompi_f08_print_addr(buf) &
BIND(C, name="ompi_f08_print_addr")
import :: C_PTR
type(C_PTR), value :: buf
end subroutine ompi_f08_print_addr
function ompi_f08_addr_diff(buf1, buf2) &
BIND(C, name="ompi_f08_addr_diff")
import :: C_PTR, C_SIZE_T
type(C_PTR), value :: buf1, buf2
integer(C_SIZE_T) :: ompi_f08_addr_diff
end function ompi_f08_addr_diff
end interface
contains
subroutine print_desc(desc)
implicit none
type(CFI_cdesc_t), intent(in) :: desc
type(C_PTR) :: cptr
integer :: i
print *, "print_desc:"
call ompi_f08_print_addr(desc%base_addr)
print *, " rank =", desc%rank
print *, " elem_len =", desc%elem_len
print *, " type =", desc%type
print *, " attribute=", desc%attribute
print *, " state =", desc%attribute
print *, " dims ="
do i = 1, desc%rank
print *, desc%dim(i)%lower_bound, desc%dim(i)%extent, desc%dim(i)%sm
end do
end subroutine print_desc
subroutine make_desc_f(buf, desc)
use mpi_f08_types
use, intrinsic :: ISO_C_BINDING
implicit none
integer, target :: buf(:,:)
type(CFI_cdesc_t), intent(inout) :: desc
integer :: i, shp(2)
! print *, "row1"
! print *, buf(1,1:18)
! print *, "col1"
! print *, buf(1:18,1)
! print *, "size=", size(buf)
! print *, "shape=", shape(buf)
! print *, "lb=", lbound(buf)
! print *, "ub=", ubound(buf)
shp = shape(buf)
desc%base_addr = ompi_f08_addr(C_LOC(buf(1,1)))
desc%elem_len = 4 ! C_SIZEOF(buf(1,1)) ?Intel compiler doesn't have this function?
desc%rank = 2
desc%type = 0; ! no type info for now
desc%attribute = 2; ! assumed shape
desc%state = 1; ! always 1 for assumed shape
do i = 1, desc%rank
desc%dim(i)%lower_bound = 1
desc%dim(i)%extent = shp(i)
end do
desc%dim(1)%sm = ompi_f08_addr_diff(C_LOC(buf(1,1)), C_LOC(buf(2,1)))
desc%dim(2)%sm = ompi_f08_addr_diff(C_LOC(buf(1,1)), C_LOC(buf(1,2)))
end subroutine
end module OMPI_Fortran_binding

Просмотреть файл

@ -1,195 +0,0 @@
/*
* Temporary file to test MPI-3 interfaces with descriptors
*/
#include "ompi_config.h"
#include "ISO_Fortran_binding.h"
#include <malloc.h>
#include <stdio.h>
#define DEBUG_PRINT 0
void * ompi_f08_addr(void * buf)
{
#if DEBUG_PRINT
printf("ompi_f08_addr = %p val=%d\n", buf, ((int*)buf)[0]);
#endif
return buf;
}
void * ompi_f08_print_addr(void * buf)
{
printf(" ompi_f08_addr = %p val=%d\n", buf, ((int*)buf)[0]);
return buf;
}
size_t ompi_f08_addr_diff(void * buf1, void * buf2)
{
size_t diff = (char*) buf2 - (char*) buf1;
#if DEBUG_PRINT
printf("ompi_f08_addr_diff buf1 = %p val=%d\n", buf1, ((int*)buf1)[0]);
printf("ompi_f08_addr_diff buf2 = %p val=%d\n", buf2, ((int*)buf2)[0]);
printf("ompi_f08_addr_diff diff = %ld\n", diff);
#endif
return diff;
}
/*
* Returns true if the array described by desc is contiguous
*/
int isContiguous(CFI_cdesc_t * desc)
{
int r;
size_t sm = desc->elem_len;
for (r = 0; r < desc->rank; r++) {
if (sm == desc->dim[r].sm) {
sm *= desc->dim[r].extent;
} else {
return 0;
}
}
return 1;
}
/*
* Returns the number of elements in the array described by desc.
* The array may be non-contiguous.
*/
size_t numElements(CFI_cdesc_t * desc)
{
int r;
size_t num = 1;
/* TODO - can have 0 size arrays? */
for (r = 0; r < desc->rank; r++) {
num *= desc->dim[r].extent;
}
return num;
}
/*
* General routine to copy the elements from the array described by desc
* to cont_buf. The array itself may be non-contiguous. For an array
* of specific rank and type there exists more efficient methods to
* copy the buffer. Returns number of bytes copied.
*/
void * copyToContiguous(CFI_cdesc_t * desc, void * cont_buf, size_t offset, int rank)
{
size_t b, e, num_copied;
char * next_out;
char * in = (char *) desc->base_addr + offset;
char * out = (char *) cont_buf;
if (rank == 0) {
/* copy scalar element */
for (b = 0; b < desc->elem_len; b++) {
*out++ = *in++;
}
cont_buf = out;
}
else {
rank -= 1;
for (e = 0; e < desc->dim[rank].extent; e++) {
/* recur on subarrays of lesser rank */
cont_buf = copyToContiguous(desc, cont_buf, offset, rank);
offset += desc->dim[rank].sm;
}
}
return cont_buf;
}
/*
* General routine to copy the elements to the array described by desc
* from cont_buf. The array itself may be non-contiguous. For an array
* of specific rank and type there exists more efficient methods to
* copy the buffer. Returns number of bytes copied.
*/
void * copyFromContiguous(CFI_cdesc_t * desc, void * cont_buf, size_t offset, int rank)
{
size_t b, e, num_copied;
char * next_out;
char * out = (char *) desc->base_addr + offset;
char * in = (char *) cont_buf;
if (rank == 0) {
/* copy scalar element */
for (b = 0; b < desc->elem_len; b++) {
*out++ = *in++;
}
cont_buf = in;
}
else {
rank -= 1;
for (e = 0; e < desc->dim[rank].extent; e++) {
/* recur on subarrays of lesser rank */
cont_buf = copyFromContiguous(desc, cont_buf, offset, rank);
offset += desc->dim[rank].sm;
}
}
return cont_buf;
}
/* From ../mpif-h/send_f.c
*/
void ompi_recv_f(char *buf, MPI_Fint *count, MPI_Fint *datatype,
MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
MPI_Fint *status, MPI_Fint *ierr);
void ompi_recv_f08_desc_f(CFI_cdesc_t *desc, MPI_Fint *count, MPI_Fint *datatype,
MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
MPI_Fint *status, MPI_Fint *ierr)
{
size_t num_bytes = 0;
if (isContiguous(desc)) {
//printf("ompi_recv_f08_desc_f: buf is contiguous\n");
ompi_recv_f(desc->base_addr, count, datatype, source, tag, comm, status, ierr);
} else {
size_t cont_size = desc->elem_len * numElements(desc);
void * cont_buf = malloc(cont_size);
//assert(cont_buf);
//printf("ompi_recv_f08_desc_f: buf not contiguous, # elements==%ld, receiving %ld bytes\n", numElements(desc), cont_size);
ompi_recv_f(cont_buf, count, datatype, source, tag, comm, status, ierr);
num_bytes = (char*) copyFromContiguous(desc, cont_buf, 0, desc->rank) - (char*) cont_buf;
//printf("ompi_recv_f08_desc_f: received %d bytes\n", num_bytes);
free(cont_buf);
}
}
/* From ../mpif-h/send_f.c
*/
void ompi_send_f(char *buf, MPI_Fint *count, MPI_Fint *datatype,
MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *ierr);
void ompi_send_f08_desc_f(CFI_cdesc_t *desc, MPI_Fint *count, MPI_Fint *datatype,
MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *ierr)
{
size_t num_bytes = 0;
if (isContiguous(desc)) {
//printf("ompi_send_f08_desc_f: buf is contiguous\n");
ompi_send_f(desc->base_addr, count, datatype, dest, tag, comm, ierr);
} else {
size_t cont_size = desc->elem_len * numElements(desc);
void * cont_buf = malloc(cont_size);
//assert(cont_buf);
num_bytes = (char*) copyToContiguous(desc, cont_buf, 0, desc->rank) - (char*) cont_buf;
//printf("ompi_send_f08_desc_f: buf not contiguous, # elements==%ld, sending %ld bytes\n", numElements(desc), num_bytes);
ompi_send_f(cont_buf, count, datatype, dest, tag, comm, ierr);
free(cont_buf);
}
}

Просмотреть файл

@ -1,20 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Comm_rank_f08(comm,rank,ierror)
use :: mpi_f08_types, only : MPI_Comm
use :: mpi_f08, only : ompi_comm_rank_f
implicit none
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: rank
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_comm_rank_f(comm%MPI_VAL,rank,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Comm_rank_f08

Просмотреть файл

@ -1,20 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Comm_size_f08(comm,size,ierror)
use :: mpi_f08_types, only : MPI_Comm
use :: mpi_f08, only : ompi_comm_size_f
implicit none
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: size
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_comm_size_f(comm%MPI_VAL,size,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Comm_size_f08

Просмотреть файл

@ -1,64 +0,0 @@
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
*
* This file provides symbols for the derived type values needed
* in mpi3_types.f90.
*/
#include "ompi_config.h"
#include "constants.h"
OMPI_DECLSPEC int ompi_f08_mpi_comm_world = OMPI_MPI_COMM_WORLD;
OMPI_DECLSPEC int ompi_f08_mpi_comm_self = OMPI_MPI_COMM_SELF;
OMPI_DECLSPEC int ompi_f08_mpi_group_empty = OMPI_MPI_GROUP_EMPTY;
OMPI_DECLSPEC int ompi_f08_mpi_errors_are_fatal = OMPI_MPI_ERRORS_ARE_FATAL;
OMPI_DECLSPEC int ompi_f08_mpi_errors_return = OMPI_MPI_ERRORS_RETURN;
/*
* NULL "handles" (indices)
*/
OMPI_DECLSPEC int ompi_f08_mpi_group_null = OMPI_MPI_GROUP_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_comm_null = OMPI_MPI_COMM_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_datatype_null = OMPI_MPI_DATATYPE_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_request_null = OMPI_MPI_REQUEST_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_op_null = OMPI_MPI_OP_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_errhandler_null = OMPI_MPI_ERRHANDLER_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_info_null = OMPI_MPI_INFO_NULL;
OMPI_DECLSPEC int ompi_f08_mpi_win_null = OMPI_MPI_WIN_NULL;
/*
* common block items from ompi/include/mpif-common.h
*/
OMPI_DECLSPEC int ompi_f08_mpi_byte = OMPI_MPI_BYTE;
OMPI_DECLSPEC int ompi_f08_mpi_packed = OMPI_MPI_PACKED;
OMPI_DECLSPEC int ompi_f08_mpi_ub = OMPI_MPI_UB;
OMPI_DECLSPEC int ompi_f08_mpi_lb = OMPI_MPI_LB;
OMPI_DECLSPEC int ompi_f08_mpi_character = OMPI_MPI_CHARACTER;
OMPI_DECLSPEC int ompi_f08_mpi_logical = OMPI_MPI_LOGICAL;
OMPI_DECLSPEC int ompi_f08_mpi_integer = OMPI_MPI_INTEGER;
OMPI_DECLSPEC int ompi_f08_mpi_integer1 = OMPI_MPI_INTEGER1;
OMPI_DECLSPEC int ompi_f08_mpi_integer2 = OMPI_MPI_INTEGER2;
OMPI_DECLSPEC int ompi_f08_mpi_integer4 = OMPI_MPI_INTEGER4;
OMPI_DECLSPEC int ompi_f08_mpi_integer8 = OMPI_MPI_INTEGER8;
OMPI_DECLSPEC int ompi_f08_mpi_integer16 = OMPI_MPI_INTEGER16;
OMPI_DECLSPEC int ompi_f08_mpi_real = OMPI_MPI_REAL;
OMPI_DECLSPEC int ompi_f08_mpi_real4 = OMPI_MPI_REAL4;
OMPI_DECLSPEC int ompi_f08_mpi_real8 = OMPI_MPI_REAL8;
OMPI_DECLSPEC int ompi_f08_mpi_real16 = OMPI_MPI_REAL16;
OMPI_DECLSPEC int ompi_f08_mpi_double_precision = OMPI_MPI_DOUBLE_PRECISION;
OMPI_DECLSPEC int ompi_f08_mpi_complex = OMPI_MPI_COMPLEX;
OMPI_DECLSPEC int ompi_f08_mpi_complex8 = OMPI_MPI_COMPLEX8;
OMPI_DECLSPEC int ompi_f08_mpi_complex16 = OMPI_MPI_COMPLEX16;
OMPI_DECLSPEC int ompi_f08_mpi_complex32 = OMPI_MPI_COMPLEX32;
OMPI_DECLSPEC int ompi_f08_mpi_double_complex = OMPI_MPI_DOUBLE_COMPLEX;
OMPI_DECLSPEC int ompi_f08_mpi_2real = OMPI_MPI_2REAL;
OMPI_DECLSPEC int ompi_f08_mpi_2double_precision = OMPI_MPI_2DOUBLE_PRECISION;
OMPI_DECLSPEC int ompi_f08_mpi_2integer = OMPI_MPI_2INTEGER;
OMPI_DECLSPEC int ompi_f08_mpi_2complex = OMPI_MPI_2COMPLEX;
OMPI_DECLSPEC int ompi_f08_mpi_2double_complex = OMPI_MPI_2DOUBLE_COMPLEX;
OMPI_DECLSPEC int ompi_f08_mpi_real2 = OMPI_MPI_REAL2;
OMPI_DECLSPEC int ompi_f08_mpi_logical1 = OMPI_MPI_LOGICAL1;
OMPI_DECLSPEC int ompi_f08_mpi_logical2 = OMPI_MPI_LOGICAL2;
OMPI_DECLSPEC int ompi_f08_mpi_logical4 = OMPI_MPI_LOGICAL4;
OMPI_DECLSPEC int ompi_f08_mpi_logical8 = OMPI_MPI_LOGICAL8;

Просмотреть файл

@ -1,84 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2007 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) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef USE_MPI_F08_CONSTANTS_H
#define USE_MPI_F08_CONSTANTS_H
/*
* This file contains macro definitions for parameter values used in the
* MPI_F08 Fortran bindings. The values are the same as those in
* ompi/include/mpif-common.h and are generated by the script
* TODO FIXME ompi/xxx/mpif-common.pl.
*/
#define OMPI_MPI_COMM_WORLD 0
#define OMPI_MPI_COMM_SELF 1
#define OMPI_MPI_GROUP_EMPTY 1
#define OMPI_MPI_ERRORS_ARE_FATAL 1
#define OMPI_MPI_ERRORS_RETURN 2
/*
* NULL 'handles' (indices)
*/
#define OMPI_MPI_GROUP_NULL 0
#define OMPI_MPI_COMM_NULL 2
#define OMPI_MPI_DATATYPE_NULL 0
#define OMPI_MPI_REQUEST_NULL 0
#define OMPI_MPI_OP_NULL 0
#define OMPI_MPI_ERRHANDLER_NULL 0
#define OMPI_MPI_INFO_NULL 0
#define OMPI_MPI_WIN_NULL 0
#define OMPI_MPI_BYTE 1
#define OMPI_MPI_PACKED 2
#define OMPI_MPI_UB 3
#define OMPI_MPI_LB 4
#define OMPI_MPI_CHARACTER 5
#define OMPI_MPI_LOGICAL 6
#define OMPI_MPI_INTEGER 7
#define OMPI_MPI_INTEGER1 8
#define OMPI_MPI_INTEGER2 9
#define OMPI_MPI_INTEGER4 10
#define OMPI_MPI_INTEGER8 11
#define OMPI_MPI_INTEGER16 12
#define OMPI_MPI_REAL 13
#define OMPI_MPI_REAL4 14
#define OMPI_MPI_REAL8 15
#define OMPI_MPI_REAL16 16
#define OMPI_MPI_DOUBLE_PRECISION 17
#define OMPI_MPI_COMPLEX 18
#define OMPI_MPI_COMPLEX8 19
#define OMPI_MPI_COMPLEX16 20
#define OMPI_MPI_COMPLEX32 21
#define OMPI_MPI_DOUBLE_COMPLEX 22
#define OMPI_MPI_2REAL 23
#define OMPI_MPI_2DOUBLE_PRECISION 24
#define OMPI_MPI_2INTEGER 25
#define OMPI_MPI_2COMPLEX 26
#define OMPI_MPI_2DOUBLE_COMPLEX 27
#define OMPI_MPI_REAL2 28
#define OMPI_MPI_LOGICAL1 29
#define OMPI_MPI_LOGICAL2 30
#define OMPI_MPI_LOGICAL4 31
#define OMPI_MPI_LOGICAL8 32
#endif /* USE_MPI_F08_CONSTANTS_H */

Просмотреть файл

@ -1,33 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2007 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) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2009-2012 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef USE_MPI_F08_CONSTANTS_H
#define USE_MPI_F08_CONSTANTS_H
/*
* This file contains macro definitions for parameter values used in the
* MPI_F08 Fortran bindings. The values are the same as those in
* ompi/include/mpif-common.h and are generated by the script
* ompi/include/mpif-common.pl.
*/

Просмотреть файл

@ -1,17 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Finalize_f08(ierror)
use :: mpi_f08, only : ompi_finalize_f
implicit none
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_finalize_f(c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Finalize_f08

Просмотреть файл

@ -1,17 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Init_f08(ierror)
use :: mpi_f08, only : ompi_init_f
implicit none
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_init_f(c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Init_f08

Просмотреть файл

@ -1,69 +0,0 @@
# -*- makefile -*-
#
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This Makefile is only relevant if we're building the "use mpi_f08"
# MPI bindings.
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
-I$(top_srcdir) $(FCFLAGS)
module_sentinel_file = \
libforce_usempif08_internal_modules_to_be_built.la
noinst_LTLIBRARIES = $(module_sentinel_file)
# f08 support modules
libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \
mpi-f08-types.f90 \
mpi-f08-interfaces.F90
#
# Clean up all F90 module files
#
MOSTLYCLEANFILES = *.mod
#
# Automake doesn't do Fortran dependency analysis, so must list them
# manually here. Bummer!
#
mpi-f08-types.lo: mpi-f08-types.f90
mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 mpi-f08-types.lo
install-exec-hook:
@ for file in `ls *.mod`; do \
echo $(INSTALL) $$file $(DESTDIR)$(libdir); \
$(INSTALL) $$file $(DESTDIR)$(libdir); \
done
uninstall-local:
@ for file in `ls *.mod`; do \
echo rm -f $(DESTDIR)$(libdir)/$$file; \
rm -f $(DESTDIR)$(libdir)/$$file; \
done
else
# Need to have empty targets because AM can't handle having an
# AM_CONDITIONAL was targets in the "if" statement but not in the
# "else". :-(
install-exec-hook:
uninstall-local:
endif

Просмотреть файл

@ -1,150 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
!
! This file provides the interface specifications for the MPI Fortran
! API bindings. It effectively maps between public names ("MPI_Init")
! and the name for tools ("MPI_Init_f08") and the back-end implementation
! name (e.g., "MPI_Init_f08").
module mpi_f08_interfaces
interface MPI_Comm_rank
subroutine MPI_Comm_rank_f08(comm,rank,ierror)
use :: mpi_f08_types
implicit none
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: rank
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Comm_rank_f08
end interface MPI_Comm_rank
interface MPI_Comm_size
subroutine MPI_Comm_size_f08(comm,size,ierror)
use :: mpi_f08_types
implicit none
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: size
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Comm_size_f08
end interface MPI_Comm_size
interface MPI_Finalize
subroutine MPI_Finalize_f08(ierror)
use :: mpi_f08_types
implicit none
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Finalize_f08
end interface MPI_Finalize
interface MPI_Init
subroutine MPI_Init_f08(ierror)
use :: mpi_f08_types
implicit none
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Init_f08
end interface MPI_Init
! Note that send/recv only works with specific types for buffers (2D integers)
! Double precision is not implemented at this time but allows compiler to do
! type checking so that MPI_SUBARRAYS_SUPPORTED flag can be utilized in
! test_send_recv.f90.
!
interface MPI_Recv
subroutine MPI_Recv_f08_desc_int_2d(buf,count,datatype,source,tag,comm,status,ierror)
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN), target :: buf(:,:)
INTEGER, INTENT(IN) :: count, source, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Status) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f08_desc_int_2d
subroutine MPI_Recv_f08_desc_dbl_1d(buf,count,datatype,source,tag,comm,status,ierror)
use :: mpi_f08_types
implicit none
DOUBLE PRECISION, INTENT(IN), target :: buf(:)
INTEGER, INTENT(IN) :: count, source, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Status) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f08_desc_dbl_1d
subroutine MPI_Recv_f08_desc_dbl_0d(buf,count,datatype,source,tag,comm,status,ierror)
use :: mpi_f08_types
implicit none
DOUBLE PRECISION, INTENT(IN), target :: buf
INTEGER, INTENT(IN) :: count, source, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Status) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f08_desc_dbl_0d
end interface MPI_Recv
interface MPI_Send
subroutine MPI_Send_f08_desc_int_2d(buf,count,datatype,dest,tag,comm,ierror)
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN), target :: buf(:,:)
INTEGER, INTENT(IN) :: count, dest, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Send_f08_desc_int_2d
subroutine MPI_Send_f08_desc_dbl_1d(buf,count,datatype,dest,tag,comm,ierror)
use :: mpi_f08_types
implicit none
DOUBLE PRECISION, INTENT(IN), target :: buf(:)
INTEGER, INTENT(IN) :: count, dest, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Send_f08_desc_dbl_1d
subroutine MPI_Send_f08_desc_dbl_0d(buf,count,datatype,dest,tag,comm,ierror)
use :: mpi_f08_types
implicit none
DOUBLE PRECISION, INTENT(IN), target :: buf
INTEGER, INTENT(IN) :: count, dest, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Send_f08_desc_dbl_0d
end interface MPI_Send
interface MPI_Type_commit
subroutine MPI_Type_commit_f08(datatype,ierror)
use :: mpi_f08_types
implicit none
TYPE(MPI_Datatype), INTENT(INOUT) :: datatype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Type_commit_f08
end interface MPI_Type_commit
interface MPI_Type_contiguous
subroutine MPI_Type_contiguous_f08(count,oldtype,newtype,ierror)
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN) :: count
TYPE(MPI_Datatype), INTENT(IN) :: oldtype
TYPE(MPI_Datatype), INTENT(OUT) :: newtype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Type_contiguous_f08
end interface MPI_Type_contiguous
interface MPI_Type_vector
subroutine MPI_Type_vector_f08(count,blocklength,stride,oldtype,newtype,ierror)
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN) :: count, blocklength, stride
TYPE(MPI_Datatype), INTENT(IN) :: oldtype
TYPE(MPI_Datatype), INTENT(OUT) :: newtype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Type_vector_f08
end interface MPI_Type_vector
end module mpi_f08_interfaces

Просмотреть файл

@ -1,158 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! Copyright (c) 2015-2017 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
!
! This file creates mappings between MPI C types (e.g., MPI_Comm) and
! variables (e.g., MPI_COMM_WORLD) and corresponding Fortran names
! (type(MPI_Comm_world) and MPI_COMM_WORLD, respectively).
module mpi_f08_types
use, intrinsic :: ISO_C_BINDING
include "mpif-config.h"
!
! constants (these must agree with those in mpif-common.h, mpif-config.h)
!
integer, parameter :: MPI_SUCCESS = 0
!
! kind parameters
!
integer, parameter :: MPI_DOUBLE_KIND = C_DOUBLE
!
! derived types
!
type, BIND(C) :: MPI_Comm
integer :: MPI_VAL
end type MPI_Comm
type, BIND(C) :: MPI_Datatype
integer :: MPI_VAL
end type MPI_Datatype
type, BIND(C) :: MPI_Errhandler
integer :: MPI_VAL
end type MPI_Errhandler
type, BIND(C) :: MPI_File
integer :: MPI_VAL
end type MPI_File
type, BIND(C) :: MPI_Group
integer :: MPI_VAL
end type MPI_Group
type, BIND(C) :: MPI_Info
integer :: MPI_VAL
end type MPI_Info
type, BIND(C) :: MPI_Message
integer :: MPI_VAL
end type MPI_Message
type, BIND(C) :: MPI_Op
integer :: MPI_VAL
end type MPI_Op
type, BIND(C) :: MPI_Request
integer :: MPI_VAL
end type MPI_Request
type, BIND(C) :: MPI_Win
integer :: MPI_VAL
end type MPI_Win
type, BIND(C) :: MPI_Status
integer :: MPI_SOURCE
integer :: MPI_TAG
integer :: MPI_ERROR
integer(C_INT), private :: c_cancelled
integer(C_SIZE_T), private :: c_count
end type MPI_Status
!
! Typedefs from C
!
! MPI_Aint
! MPI_Offset
!
! Pre-defined communicator bindings
!
type(MPI_Comm), protected, bind(C, name="ompi_f08_mpi_comm_world") :: MPI_COMM_WORLD
type(MPI_Comm), protected, bind(C, name="ompi_f08_mpi_comm_self") :: MPI_COMM_SELF
type(MPI_Group), protected, bind(C, name="ompi_f08_mpi_group_empty") :: MPI_GROUP_EMPTY
type(MPI_Errhandler), protected, bind(C, name="ompi_f08_mpi_errors_are_fatal") :: MPI_ERRORS_ARE_FATAL
type(MPI_Errhandler), protected, bind(C, name="ompi_f08_mpi_errors_return") :: MPI_ERRORS_RETURN
!
! NULL "handles" (indices)
!
type(MPI_Comm), protected, bind(C, name="ompi_f08_mpi_comm_null") :: MPI_COMM_NULL;
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_datatype_null") :: MPI_DATATYPE_NULL;
type(MPI_Errhandler), protected, bind(C, name="ompi_f08_mpi_errhandler_null") :: MPI_ERRHANDLER_NULL;
type(MPI_Group), protected, bind(C, name="ompi_f08_mpi_group_null") :: MPI_GROUP_NULL;
type(MPI_Info), protected, bind(C, name="ompi_f08_mpi_info_null") :: MPI_INFO_NULL;
type(MPI_Message), protected, bind(C, name="ompi_f08_mpi_message_null") :: MPI_MESSAGE_NULL;
type(MPI_Op), protected, bind(C, name="ompi_f08_mpi_op_null") :: MPI_OP_NULL;
type(MPI_Request), protected, bind(C, name="ompi_f08_mpi_request_null") :: MPI_REQUEST_NULL;
type(MPI_Win), protected, bind(C, name="ompi_f08_mpi_win_null") :: MPI_WIN_NULL;
!
! Pre-defined datatype bindings
!
! These definitions should match those in ompi/include/mpif-common.h.
! They are defined in ompi/runtime/ompi_mpi_init.c
!
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_byte") :: MPI_BYTE
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_packed") :: MPI_PACKED
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_ub") :: MPI_UB
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_lb") :: MPI_LB
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_character") :: MPI_CHARACTER
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_logical") :: MPI_LOGICAL
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_integer") :: MPI_INTEGER
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_integer1") :: MPI_INTEGER1
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_integer2") :: MPI_INTEGER2
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_integer4") :: MPI_INTEGER4
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_integer8") :: MPI_INTEGER8
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_integer16") :: MPI_INTEGER16
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_real") :: MPI_REAL
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_real4") :: MPI_REAL4
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_real8") :: MPI_REAL8
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_real16") :: MPI_REAL16
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_double_precision") :: MPI_DOUBLE_PRECISION
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_complex") :: MPI_COMPLEX
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_complex8") :: MPI_COMPLEX8
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_complex16") :: MPI_COMPLEX16
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_complex32") :: MPI_COMPLEX32
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_double_complex") :: MPI_DOUBLE_COMPLEX
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_2real") :: MPI_2REAL
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_2double_precision") :: MPI_2DOUBLE_PRECISION
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_2integer") :: MPI_2INTEGER
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_2complex") :: MPI_2COMPLEX
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_2double_complex") :: MPI_2DOUBLE_COMPLEX
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_real2") :: MPI_REAL2
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_logical1") :: MPI_LOGICAL1
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_logical2") :: MPI_LOGICAL2
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_logical4") :: MPI_LOGICAL4
type(MPI_Datatype), protected, bind(C, name="ompi_f08_mpi_logical8") :: MPI_LOGICAL8
!
! STATUS/STATUSES_IGNORE
!
include 'mpif-f08-types.h'
end module mpi_f08_types

Просмотреть файл

@ -1,78 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! $COPYRIGHT$
!
! This file provides the interface specifications for the MPI Fortran
! API bindings. It effectively maps between public names ("MPI_Init")
! and the back-end implementation subroutine name (e.g., "ompi_init_f").
interface
subroutine ompi_comm_rank_f(comm,rank,ierror) &
BIND(C, name="ompi_comm_rank_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: rank
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_comm_rank_f
subroutine ompi_comm_size_f(comm,size,ierror) &
BIND(C, name="ompi_comm_size_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: size
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_comm_size_f
subroutine ompi_finalize_f(ierror) &
BIND(C, name="ompi_finalize_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_finalize_f
subroutine ompi_init_f(ierror) &
BIND(C, name="ompi_init_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_init_f
! ompi_send_f/ompi_recv_f interfaces not needed as they are called from C
!
subroutine ompi_type_commit_f(datatype,ierror) &
BIND(C, name="ompi_type_commit_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(INOUT) :: datatype
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_commit_f
subroutine ompi_type_contiguous_f(count,oldtype,newtype,ierror) &
BIND(C, name="ompi_type_contiguous_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN) :: count
INTEGER, INTENT(IN) :: oldtype
INTEGER, INTENT(OUT) :: newtype
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_contiguous_f
subroutine ompi_type_vector_f(count,blocklength,stride,oldtype,newtype,ierror) &
BIND(C, name="ompi_type_vector_f")
use :: mpi_f08_types
implicit none
INTEGER, INTENT(IN) :: count, blocklength, stride
INTEGER, INTENT(IN) :: oldtype
INTEGER, INTENT(OUT) :: newtype
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_vector_f
end interface

Просмотреть файл

@ -1,35 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2004-2005 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-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! $COPYRIGHT$
!
! Additional copyrights may follow
!
! $HEADER$
!
module mpi_f08
use mpi_f08_types
use mpi_f08_interfaces ! this module contains the mpi_f08 interface declarations
use ompi_fortran_binding ! this module provides support for building descriptors
!
! Declaration of the interfaces to the ompi impl files
! e.g., send_f.c
!
include "mpi-f-interfaces-bind.h"
end module mpi_f08

Просмотреть файл

@ -1,84 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
! This wrapper mimics how the MPI_Recv_wrapper will eventually work.
! Eventually buf will be typed, TYPE(*), DIMENSION(..)
! Now can only mimic with explicit type and rank for assumed-shape dummy
! arguments.
!
subroutine MPI_Recv_f08_desc_int_2d(buf,count,datatype,source,tag,comm,status,ierror)
use :: OMPI_Fortran_binding
implicit none
integer, INTENT(IN), target :: buf(:,:)
INTEGER, INTENT(IN) :: count, source, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Status), INTENT(OUT) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(CFI_cdesc_t) :: buf_desc
call make_desc_f(buf, buf_desc)
!call print_desc(buf_desc)
call ompi_recv_f08_desc_f(buf_desc, count, datatype%MPI_VAL, source, tag, comm%MPI_VAL, status, c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Recv_f08_desc_int_2d
! WARNING, not yet implemented, stub used to test MPI_SUBARRAYS_SUPPORTED usage
!
subroutine MPI_Recv_f08_desc_dbl_1d(buf,count,datatype,source,tag,comm,status,ierror)
use :: OMPI_Fortran_binding
implicit none
double precision, INTENT(IN), target :: buf(:)
INTEGER, INTENT(IN) :: count, source, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Status), INTENT(OUT) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
! this hack is to remove compiler warning about no change to out variable
status = MPI_STATUS_IGNORE
c_ierror = 1
print *, "WARNING, testing of double precision arrays not yet supported with subarrays"
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Recv_f08_desc_dbl_1d
! WARNING, not yet implemented, stub used to test MPI_SUBARRAYS_SUPPORTED usage
!
subroutine MPI_Recv_f08_desc_dbl_0d(buf,count,datatype,source,tag,comm,status,ierror)
use :: OMPI_Fortran_binding
implicit none
double precision, INTENT(IN), target :: buf
INTEGER, INTENT(IN) :: count, source, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Status), INTENT(OUT) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
! this hack is to remove compiler warning about no change to out variable
status = MPI_STATUS_IGNORE
c_ierror = 1
print *, "WARNING, testing of double precision arrays not yet supported with subarrays"
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Recv_f08_desc_dbl_0d

Просмотреть файл

@ -1,73 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
! This wrapper mimics how the MPI_Send_wrapper will eventually work.
! Eventually buf will be typed, TYPE(*), DIMENSION(..)
! Now can only mimic with explicit type and rank for assumed-shape dummy
! arguments.
!
subroutine MPI_Send_f08_desc_int_2d(buf, count, datatype, dest, tag, comm, ierror)
use OMPI_Fortran_binding
implicit none
integer, intent(in), target :: buf(:,:)
integer, intent(in) :: count, dest, tag
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Comm), intent(in) :: comm
integer, optional, intent(out) :: ierror
integer :: err
type(CFI_cdesc_t) :: buf_desc
call make_desc_f(buf, buf_desc)
!call print_desc(buf_desc)
call ompi_send_f08_desc_f(buf_desc, count, datatype%MPI_VAL, dest, tag, comm%MPI_VAL, err)
if (present(ierror)) ierror = err
end subroutine MPI_Send_f08_desc_int_2d
! WARNING, not yet implemented, stub used to test MPI_SUBARRAYS_SUPPORTED usage
!
subroutine MPI_Send_f08_desc_dbl_1d(buf, count, datatype, dest, tag, comm, ierror)
use OMPI_Fortran_binding
implicit none
double precision, intent(in), target :: buf(:)
integer, intent(in) :: count, dest, tag
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Comm), intent(in) :: comm
integer, optional, intent(out) :: ierror
integer :: err
print *, "WARNING, testing of double precision arrays not yet supported with subarrays"
err = 1
if (present(ierror)) ierror = err
end subroutine MPI_Send_f08_desc_dbl_1d
! WARNING, not yet implemented, stub used to test MPI_SUBARRAYS_SUPPORTED usage
!
subroutine MPI_Send_f08_desc_dbl_0d(buf, count, datatype, dest, tag, comm, ierror)
use OMPI_Fortran_binding
implicit none
double precision, intent(in), target :: buf
integer, intent(in) :: count, dest, tag
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Comm), intent(in) :: comm
integer, optional, intent(out) :: ierror
integer :: err
print *, "WARNING, testing of double precision arrays not yet supported with subarrays"
err = 1
if (present(ierror)) ierror = err
end subroutine MPI_Send_f08_desc_dbl_0d

Просмотреть файл

@ -1,19 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Type_commit_f08(datatype,ierror)
use :: mpi_f08_types, only : MPI_Datatype
use :: mpi_f08, only : ompi_type_commit_f
implicit none
TYPE(MPI_Datatype), INTENT(INOUT) :: datatype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_type_commit_f(datatype%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Type_commit_f08

Просмотреть файл

@ -1,21 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Type_contiguous_f08(count,oldtype,newtype,ierror)
use :: mpi_f08_types, only : MPI_Datatype
use :: mpi_f08, only : ompi_type_contiguous_f
implicit none
INTEGER, INTENT(IN) :: count
TYPE(MPI_Datatype), INTENT(IN) :: oldtype
TYPE(MPI_Datatype), INTENT(OUT) :: newtype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_type_contiguous_f(count,oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Type_contiguous_f08

Просмотреть файл

@ -1,22 +0,0 @@
! -*- f90 -*-
!
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! $COPYRIGHT$
subroutine MPI_Type_vector_f08(count,blocklength,stride,oldtype,newtype,ierror)
use :: mpi_f08_types, only : MPI_Datatype
use :: mpi_f08, only : ompi_type_vector_f
implicit none
INTEGER, INTENT(IN) :: count, blocklength, stride
TYPE(MPI_Datatype), INTENT(IN) :: oldtype
TYPE(MPI_Datatype), INTENT(OUT) :: newtype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
call ompi_type_vector_f(count,blocklength,stride, &
oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Type_vector_f08

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
@ -157,6 +157,16 @@ void ompi_info_do_config(bool want_all)
paramcheck = "runtime";
#endif
/* The current mpi_f08 implementation does not support Fortran
subarrays. However, someday it may/will. Hence, I'm leaving
in all the logic that checks to see whether subarrays are
supported, but I'm just hard-coding
OMPI_BUILD_FORTRAN_F08_SUBARRAYS to 0 (we used to have a
prototype mpi_f08 module that implemented a handful of
descriptor-based interfaces and supported subarrays, but that
has been removed). */
const int OMPI_BUILD_FORTRAN_F08_SUBARRAYS = 0;
/* setup the strings that don't require allocations*/
cxx = OMPI_BUILD_CXX_BINDINGS ? "yes" : "no";
if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPI_BINDINGS) {
@ -218,7 +228,7 @@ void ompi_info_do_config(bool want_all)
} else {
int first = 1;
snprintf(f08_msg, sizeof(f08_msg),
"The mpi_f08 module is available, but due to limitations in the %s compiler, does not support the following: ",
"The mpi_f08 module is available, but due to limitations in the %s compiler and/or Open MPI, does not support the following: ",
OMPI_FC);
if (!OMPI_BUILD_FORTRAN_F08_SUBARRAYS) {
append(f08_msg, sizeof(f08_msg), &first, "array subsections");

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2013 Mellanox Technologies, Inc.
* All rights reserved.
*
* Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
@ -146,6 +146,16 @@ void oshmem_info_do_config(bool want_all)
paramcheck = "runtime";
#endif
/* The current mpi_f08 implementation does not support Fortran
subarrays. However, someday it may/will. Hence, I'm leaving
in all the logic that checks to see whether subarrays are
supported, but I'm just hard-coding
OMPI_BUILD_FORTRAN_F08_SUBARRAYS to 0 (we used to have a
prototype mpi_f08 module that implemented a handful of
descriptor-based interfaces and supported subarrays, but that
has been removed). */
const int OMPI_BUILD_FORTRAN_F08_SUBARRAYS = 0;
/* setup the strings that don't require allocations*/
cxx = OMPI_BUILD_CXX_BINDINGS ? "yes" : "no";
if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPI_BINDINGS) {
@ -190,7 +200,7 @@ void oshmem_info_do_config(bool want_all)
} else {
int first = 1;
snprintf(f08_msg, sizeof(f08_msg),
"The mpi_f08 module is available, but due to limitations in the %s compiler, does not support the following: ",
"The mpi_f08 module is available, but due to limitations in the %s compiler and/or Open MPI, does not support the following: ",
OMPI_FC);
if (!OMPI_BUILD_FORTRAN_F08_SUBARRAYS) {
append(f08_msg, sizeof(f08_msg), &first, "array subsections");