Skip to content

Defect: MPI_Type_extent, type of 2nd argument is pointer to MPI_Aint #435

@jbmaggard

Description

@jbmaggard

Defect/Bug Report

Defect: MPI_Type_extent, type of 2nd argument is pointer to MPI_Aint

  • OpenCoarrays Version: 1.9.1
  • Fortran Compiler: GNU Fortran (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 7.1.0
  • C compiler used for building lib: gcc (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 7.1.0
  • Installation method: Manual, Win7-64
  • Output of ver: Microsoft Windows [Version 6.1.7601]
  • MPI library being used: Intel(R) MPI Library for Windows* OS, Version 2017 Update 3 Build 20170405
  • Machine architecture and number of physical cores: Intel Haswell i7, 4 cores, 8 threads
  • Version of CMake: N/A

Observed Behavior

C:\TEMP\oca\src_1.9.1\mpi>gcc --version
gcc (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 7.1.0
  • -I.. used to find libcaf.h
  • -I../.. used to find mpi.h
  • -D_POSIX used to find SIGKILL in signal.h
  • -DALLOCA_MISSING because it is missing
  • -DUSE_GCC for correct typedef of MPI_Aint in mpi.h (long long int)
  • -g -Og for debugging with gdb
  • -m64 to give an error message if compile attempted with Win32 version of mingw-w64 gcc
C:\TEMP\oca\src_1.9.1\mpi>gcc -g -m64 -DGCC_GE_7 -DPREFIX_NAME=_gfortran_caf_ -DUSE_FAILED_IMAGES -DALLOCA_MISSING -D_POSIX -DUSE_GCC -Og -c mpi_caf.c -I .. -I ../..
mpi_caf.c: In function 'redux_char_by_reference_adapter':
mpi_caf.c:4140:30: warning: passing argument 2 of 'MPI_Type_extent' from incompatible pointer type [-Wincompatible-pointer-types]
   MPI_Type_extent(*datatype, &string_len);
                              ^
In file included from mpi_caf.c:44:0:
../../mpi.h:1121:5: note: expected 'MPI_Aint * {aka long long int *}' but argument is of type 'long int *'
 int MPI_Type_extent(MPI_Datatype datatype, MPI_Aint *extent);
     ^~~~~~~~~~~~~~~

In linux (which is LP64), the correct typedef of MPI_Aint is long int (see mpi.h from MPICH 3.2). For Windows (which is LLP64), the mpi.h from the Intel MPI Windows SDK defines -DUSE_GCC to implement the correct typedef of long long int for MPI_Aint with GCC.

Intel MPI Windows SDK, mpi.h:  int MPI_Type_extent(MPI_Datatype datatype, MPI_Aint *extent);

C:\TEMP\oca\src_1.9.1\mpi>fc /L /N mpi_caf.c mpi_caf.c.original
Comparing files mpi_caf.c and MPI_CAF.C.ORIGINAL
***** mpi_caf.c
 4142:  {
 4143:    MPI_Aint string_len;
 4144:    MPI_Type_extent(*datatype, &string_len);
***** MPI_CAF.C.ORIGINAL
 4142:  {
 4143:    long int string_len;
 4144:    MPI_Type_extent(*datatype, &string_len);
*****

Question

I posted details of my build (including build of import library for impi.dll) and results at people.tamu.edu/~bmaggard, in case anyone is interested in a native Win64 CAF solution (Win7-64; mingw-w64 gfortran 7.1.0.rev2; Intel MPI Runtime 2017 Update 3; OpenCoarrays-1.9.1). Execution results are equivalent to building 1.9.1 on linux with install.sh (Fedora 26; gcc-gfortran 7.1.1-3, MPICH 3.2, OpenCoarrays-1.9.1).

For GCC 7.1.0, my question at this time is whether I should be using any/all of the defines: COMPILER_SUPPORTS_CAF_INTRINSICS, STRIDED, and COMPILER_SUPPORTS_ATOMICS. Feedback appreciated on this question.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions