Bugfix for access of unallocated variable

IntelMPI seems to access sendbuf for root!=0 in MPI_Scatterv
This commit is contained in:
Martin Diehl 2021-02-17 17:56:39 +01:00
parent b6146a8cc6
commit 6c7201610e
1 changed files with 5 additions and 2 deletions

View File

@ -68,8 +68,11 @@ subroutine discretization_grid_init(restart)
print'(/,a)', ' <<<+- discretization_grid init -+>>>'; flush(IO_STDOUT)
if(worldrank == 0) call readVTR(grid,geomSize,origin,materialAt_global)
if(worldrank == 0) then
call readVTR(grid,geomSize,origin,materialAt_global)
else
allocate(materialAt_global(0)) ! needed for IntelMPI
endif
call MPI_Bcast(grid,3,MPI_INTEGER,0,PETSC_COMM_WORLD, ierr)
if (ierr /= 0) error stop 'MPI error'