0

I am trying to enable 64 bit integer size for a sample hello world kind of Fortran test code, in an MPI setup. OS: Windows 10 Compilers used: Intel OneAPI 2021.4.0 MPI: Intel MPI

There are 2 scenarios I tried to test,

  1. using a single line command to compile an executable directly, mpiifort -o test.exe -i8 test.f90
  2. using a CmakeLists file to compile the test with necessary Fortran 64 bit "-i8" option and find_package(MPI). I made sure MPI libraries are picked (impi.lib, libmpi_ilp64.lib) and MPI_Fortran_Compiler points to mpiifort

I use a test of determining the size of MPI_INTEGER using an API MPI_Type_size( ) to check if 64 bit environment is enabled for Fortran/MPI setup.

call MPI_Type_size(MPI_INTEGER, sz, ierrsiz)
print *, 'sizeof(MPI_INTEGER) ', sz

Scenario 1 prints correct size of 8 bytes (64 bit) Scenario 2 prints incorrect size of 4 bytes ( 32 bit)

I do use "-i8" option in Cmake build system to enable 64 bit environment. But MPI still seems to be 32 bit.

Kindly help.

Vishy
  • 1
  • 2
  • Do I understand correctly? The desired result is achieved when using direct command-line invocation of the Intel compiler (scenario 1), but the result is not as desired when doing a build via Cmake (scenario 2). If so, this appears to be a *Cmake configuration issue*, and should be described and tagged accordingly. As a first step, you may want to extract the exact compiler invocation that is being created by Cmake. It might specify conflicting command-line switches, for example. – njuffa Oct 23 '21 at 02:22
  • Yes. You are right. I shall update the tags and descriptions. – Vishy Oct 23 '21 at 02:24
  • Cmake configuration identifies IntelLLVM 2021.4.0 with MSVC-like command-line for Fortran compilers. During the cmake build, cmake.exe invokes Intel's ifx.exe" – Vishy Oct 23 '21 at 02:30

1 Answers1

0

Scenario 1: I think you should additionally adding flag "-ilp64" to mpiifort for linkage, and mpiifort will enable the ILP64 support expilcitly. Make sure you have passed "-ilp64" to mpiexec, so that MPI will call the correct ilp64 wrapper library.

Scenario 2: CMake find_package(MPI) may not correctly find the ilp64 MPI module/header directory on Windows, although "-i8" and "-ilp64" have been passed to mpiifort. The module directory should be:"${YOUR_MPI_ROOT}/include/ilp64", but CMake returns "${YOUR_MPI_ROOT}/include". That is why you got 32-bits MPI_INTEGER in Scenario 2.

Kitty
  • 1