- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Given the following fortran code:
integer, parameter :: double = kind(1.0d0) integer :: integerTest real(double) :: doubleTest complex(double) :: complexTest integer :: testSize integer :: ierr integerTest = 0 doubleTest = real(0.d0, kind=double) complexTest = cmplx(0.d0, 0.d0, kind=double) call MPI_SIZEOF(integerTest, testSize, ierr) ! ... call MPI_SIZEOF(doubleTest, testSize, ierr) ! ... call MPI_SIZEOF(complexTest, testSize, ierr)
I get the error:
error #6285: There is no matching specific subroutine for this generic subroutine call. [MPI_SIZEOF]
on the line
call MPI_SIZEOF(complexTest, testSize, ierr)
This code compiles and executes with no issue using openmpi. What is the cause of this error? It seems like it's looking for a specific match for the type of complexTest, but the whole point of MPI_SIZEOF is to work generically with nearly any type.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nothing? My code seems to work in MPICH, too. It's Intel MPI that stands out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I should also mention that the code works if I declare complexTest as complex without a kind, but that doesn't help much, since I need double precision complex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And it fails if I declare complexTest as plain double complex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This appears to be a bug in Intel MPI. It looks like the double complex overload is missing. However, with credit to Vladimir F. at StackOverflow, the following solution works:
use iso_fortran_env ! ... testSize = storage_size(complexTest) / character_storage_size
Incidentally, this whole exercise was to properly select the MPI data type to use. In all cases, test size was used in a call to
call MPI_TYPE_MATCH_SIZE(MPI_TYPECLASS_COMPLEX, mpiType, testSize, ierr)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page