Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions config/ompi_setup_mpi_fortran.m4
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,16 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[

OMPI_FORTRAN_CHECK([LOGICAL], [yes],
[char, int32_t, int, int64_t, long long, long], [-1], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*1], [yes],
OMPI_FORTRAN_CHECK([LOGICAL*1], [no],
[char, int8_t, short, int32_t, int, int64_t, long long, long], [1], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*2], [yes],
OMPI_FORTRAN_CHECK([LOGICAL*2], [no],
[short, int16_t, int32_t, int, int64_t, long long, long], [2], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*4], [yes],
OMPI_FORTRAN_CHECK([LOGICAL*4], [no],
[int32_t, int, int64_t, long long, long], [4], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*8], [yes],
OMPI_FORTRAN_CHECK([LOGICAL*8], [no],
[int, int64_t, long long, long], [8], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*16], [no],
[int, int64_t, long long, long], [16], [yes])

OMPI_FORTRAN_CHECK([INTEGER], [yes],
[int32_t, int, int64_t, long long, long], [-1], [yes])
Expand Down
14 changes: 14 additions & 0 deletions ompi/datatype/ompi_datatype_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,20 @@
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif

#if OMPI_SIZEOF_FORTRAN_LOGICAL16 == OMPI_SIZEOF_FORTRAN_LOGICAL
# define OMPI_DATATYPE_MPI_LOGICAL16 OMPI_DATATYPE_MPI_LOGICAL
#elif OMPI_SIZEOF_FORTRAN_LOGICAL16 == 1
# define OMPI_DATATYPE_MPI_LOGICAL16 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL16 == 2
# define OMPI_DATATYPE_MPI_LOGICAL16 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL16 == 4
# define OMPI_DATATYPE_MPI_LOGICAL16 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL16 == 8
# define OMPI_DATATYPE_MPI_LOGICAL16 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_LOGICAL16 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif

/* INTEGER */
#if OMPI_SIZEOF_FORTRAN_INTEGER1 == OMPI_SIZEOF_FORTRAN_INTEGER
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_INTEGER
Expand Down
8 changes: 8 additions & 0 deletions ompi/datatype/ompi_datatype_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ ompi_predefined_datatype_t ompi_mpi_logical8 = OMPI_DATATYPE_INIT_PREDEFIN
#else
ompi_predefined_datatype_t ompi_mpi_logical8 = OMPI_DATATYPE_INIT_UNAVAILABLE (LOGICAL8, OMPI_DATATYPE_FLAG_DATA_FORTRAN );
#endif
#if OMPI_HAVE_FORTRAN_LOGICAL16
ompi_predefined_datatype_t ompi_mpi_logical16 = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (INT, LOGICAL16, OMPI_SIZEOF_FORTRAN_LOGICAL16, OMPI_ALIGNMENT_FORTRAN_LOGICAL16, 0);
#else
ompi_predefined_datatype_t ompi_mpi_logical16 = OMPI_DATATYPE_INIT_UNAVAILABLE (LOGICAL16, OMPI_DATATYPE_FLAG_DATA_FORTRAN );
#endif
#if OMPI_HAVE_FORTRAN_REAL2
ompi_predefined_datatype_t ompi_mpi_real2 = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (FLOAT, REAL2, OMPI_SIZEOF_FORTRAN_REAL2, OMPI_ALIGNMENT_FORTRAN_REAL2, OMPI_DATATYPE_FLAG_DATA_FLOAT);
#else
Expand Down Expand Up @@ -673,6 +678,9 @@ int32_t ompi_datatype_init( void )
MOOG(c_short_float_complex, 75);
MOOG(cxx_sfltcplex, 76);

/* Datatype added in MPI 5.0 */
MOOG(logical16, 77);

/**
* Now make sure all non-contiguous types are marked as such.
*/
Expand Down
7 changes: 7 additions & 0 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
/* Whether we have FORTRAN LOGICAL*8 or not */
#undef OMPI_HAVE_FORTRAN_LOGICAL8

/* Whether we have FORTRAN LOGICAL*16 or not */
#undef OMPI_HAVE_FORTRAN_LOGICAL16

/* Whether we have FORTRAN INTEGER*1 or not */
#undef OMPI_HAVE_FORTRAN_INTEGER1

Expand Down Expand Up @@ -1194,6 +1197,7 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_logical1;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_logical2;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_logical4;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_logical8;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_logical16;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_integer1;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_integer2;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_integer4;
Expand Down Expand Up @@ -1341,6 +1345,9 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
#if OMPI_HAVE_FORTRAN_LOGICAL8
#define MPI_LOGICAL8 OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_logical8)
#endif
#if OMPI_HAVE_FORTRAN_LOGICAL16
#define MPI_LOGICAL16 OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_logical16)
#endif
#define MPI_INTEGER OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_integer)
#if OMPI_HAVE_FORTRAN_INTEGER1
#define MPI_INTEGER1 OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_integer1)
Expand Down
3 changes: 3 additions & 0 deletions ompi/include/mpif-values.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
'MPI_C_LONG_DOUBLE_COMPLEX': 71,
'MPI_COUNT': 72,
'MPI_COMPLEX4': 73,
# Leave room for 16bit datatypes
# See https://github.com/mpi-forum/mpi-issues/issues/65
'MPI_LOGICAL16': 77,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to justify the gap. leave room for C/CXX specific datatypes should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added. However, this makes me thing that maybe this script is missing the 16bit floating types in the MPIX_ namespace?

From ompi/datatype/ompi_datatype_module.c

    /* Datatypes proposed to the MPI Forum in June 2017 for proposal in
     * the MPI 4.0 standard. As of February 2019, it is not accepted yet.
     * See https://github.com/mpi-forum/mpi-issues/issues/65 */
    MOOG(short_float, 74);
    MOOG(c_short_float_complex, 75);
    MOOG(cxx_sfltcplex, 76);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure they are equivalent to Fortran's REAL*2. If you want to add support for MPIX you can do it in another PR, this one looks ready.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. that's for another day.

'MPI_MESSAGE_NO_PROC': 1,
'MPI_INFO_ENV': 1,
}
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ module mpi_f08_types
type(MPI_Datatype), parameter :: MPI_LOGICAL2 = MPI_Datatype(OMPI_MPI_LOGICAL2)
type(MPI_Datatype), parameter :: MPI_LOGICAL4 = MPI_Datatype(OMPI_MPI_LOGICAL4)
type(MPI_Datatype), parameter :: MPI_LOGICAL8 = MPI_Datatype(OMPI_MPI_LOGICAL8)
type(MPI_Datatype), parameter :: MPI_LOGICAL16 = MPI_Datatype(OMPI_MPI_LOGICAL16)
type(MPI_Datatype), parameter :: MPI_C_BOOL = MPI_Datatype(OMPI_MPI_C_BOOL)
type(MPI_Datatype), parameter :: MPI_CXX_BOOL = MPI_Datatype(OMPI_MPI_CXX_BOOL)
type(MPI_Datatype), parameter :: MPI_COUNT = MPI_Datatype(OMPI_MPI_COUNT)
Expand Down
1 change: 1 addition & 0 deletions ompi/runtime/mpiruntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_logical1_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_logical2_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_logical4_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_logical8_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_logical16_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_integer_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_integer1_addr;
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t *ompi_mpi_integer2_addr;
Expand Down
1 change: 1 addition & 0 deletions ompi/runtime/ompi_mpi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ ompi_predefined_datatype_t *ompi_mpi_logical1_addr = &ompi_mpi_logical1;
ompi_predefined_datatype_t *ompi_mpi_logical2_addr = &ompi_mpi_logical2;
ompi_predefined_datatype_t *ompi_mpi_logical4_addr = &ompi_mpi_logical4;
ompi_predefined_datatype_t *ompi_mpi_logical8_addr = &ompi_mpi_logical8;
ompi_predefined_datatype_t *ompi_mpi_logical16_addr = &ompi_mpi_logical16;
ompi_predefined_datatype_t *ompi_mpi_integer_addr = &ompi_mpi_integer;
ompi_predefined_datatype_t *ompi_mpi_integer1_addr = &ompi_mpi_integer1;
ompi_predefined_datatype_t *ompi_mpi_integer2_addr = &ompi_mpi_integer2;
Expand Down