I'm trying to simplify an MPI_BROADCAST of a derived type to all mpi
ranks.
I have a derived type containing a set of real and integer values.
Because of the way the code is developed, I don't have a lot of access
to the variables, just the super-structure, if you will. Let's say I
have "something" typed like this:
module something_mod
integer, parameter :: dp = selected_real_kind(12)
type something_type
include 'something_contents.inc'
!! include file contains items like this:
! real(dp) :: a = 0.0_dp
! real(dp) :: b = 0.0_dp
! real(dp) :: c = 0.0_dp
!! but could contain integers as well.
end type something_type
type(something_type) :: something
end module something_mod
Basically, I want to "use something_mod" in a routine, allocate an
integer array with
integer :: something_array(size(transfer(something,(/0/))))
, TRANSFER the current something contents into the array in the master
rank, broadcast, then transfer back into the "something" variable on
the child ranks.
However, my recent intel fortran compiler does not allow this:
error #6812: The size of this object cannot be evaluated to a
constant. [SIZE]
If the derived type is composed merely of scalars and static arrays,
why is the size not a constant? Is there another way to get this size
other than doing a compilation to check it?
Ted
--
Frango ut patefaciam -- I break so that I may reveal
|