Skip to content

Defect: co_broadcast derived type with allocatable components #727

Closed
@everythingfunctional

Description

@everythingfunctional
  • I am reporting a bug others will be able to reproduce and not asking a question or requesting a new feature.

System information including:

  • OpenCoarrays Version: OpenCoarrays Coarray Fortran Compiler Wrapper (caf version 2.9.2)
  • Fortran Compiler: GNU Fortran (Homebrew GCC 10.2.0_2) 10.2.0
  • C compiler used for building lib: unknown
  • Installation method: homebrew
  • All flags & options passed to the installer
  • Output of uname -a: Darwin Brads-MBP.lan 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
  • MPI library being used: openmp ?
  • Machine architecture and number of physical cores: Intel x86-64, 8 cores
  • Version of CMake: N/A

To help us debug your issue please explain:

What you were trying to do (and why)

Attempting to use co_broadcast with a derived type.

What happened (include command output, screenshots, logs, etc.)

Not all components are copied correctly.

What you expected to happen

All components should be broadcast to all images.

Step-by-step reproduction instructions to reproduce the error/bug

A minimal reproducer that might serve as a regression test is below:

  implicit none

  type foo_t
    integer i
    integer, allocatable :: j
  end type

  type(foo_t) foo
  integer, parameter :: source_image = 1

  if (this_image() == source_image)  then
    foo = foo_t(2,3)
  else
    allocate(foo%j)
  end if
  call co_broadcast(foo, source_image)

  if ((foo%i /= 2) .or. (foo%j /= 3))  error stop "Test failed."
  sync all
  print *, "Test passed."

end

With 11.2.0, the above code prints, "Test failed."

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions