I am developing some parallel CFD code using Fortran 90 and OpenMPI. The processes are structured into two groups such that half perform a certain type of calculations (let's say Velocity, Pressure and Temperature) while the other half performs a different type of calculations (let's say Turbulence modelling using K-omega). As a result the program splits itself arbitrarily into two communicators, let's call them Comm1 and Comm2.
I'm trying to use Process of local rank 0 in Comm 1 to read some parameters from Namelist files and Broadcast them to all processes in Comm1. For some reason, even though it is just a scalar, I get MPI_ERR_TRUNCATE: message truncated as an error message. I'm wondering if anybody's experienced anything similar.
Code is below.
module myModule use mpi double precision, public :: KOMEGA_CMU, KOMEGA_ELOG, KOMEGA_CTRANS, TED_INITIAL, UD_INITIAL ! Other Variable declarations ! ... contains subroutine readParameters(MPI_COMMUNICATOR, PROC_RANK_LOCAL, NUM_PROCESSES) implicit none integer, intent(in) :: MPI_COMMUNICATOR, PROC_RANK_LOCAL, NUM_PROCESSES integer :: ierr if(PROC_RANK_LOCAL == 0) then ! Read variables end if call MPI_Bcast(UD_INITIAL,1, MPI_DOUBLE_PRECISION,0, MPI_COMMUNICATOR, ierr) end subroutine ReadParameters end module MyModule
this for some reason results in MPI_ERR_TRUNCATE in all processes but the root process (Rank 0), even though the variable is declared for double precision and message buffer is for double precision as well. This happens with integers too.
Thank you for your help.