public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Possible bug: array-coarray of derived type with allocatable component
@ 2021-10-05 16:13 Harris Snyder
  0 siblings, 0 replies; only message in thread
From: Harris Snyder @ 2021-10-05 16:13 UTC (permalink / raw)
  To: fortran; +Cc: Damian Rouson, Brad Richardson, robert.c.singleterry

Hi everyone,

The following program produces incorrect results (GCC 11.2.0,
OpenCoarrays 2.9.2). The line marked `! NOTE` should print 1, 2, 3, 4,
but instead I get "OpenCoarrays internal error on image 2:
libcaf_mpi::caf_sendget_by_ref(): can not allocate 0 bytes of memory."

This may be an OpenCoarrays bug, rather than a GFortran bug (we're
reporting it there too), but if any of the gfortran developers are
able to confirm this or provide any insight that would be greatly
appreciated. Thank you!

program bug
    type :: container
        integer, allocatable :: stuff(:)
    end type

    type(container) :: co_containers(10)[*]

    if (this_image() == 1) then
        allocate(co_containers(2)%stuff(4))
        co_containers(2)%stuff = [1,2,3,4]
    end if

    sync all

    if (this_image() == 2) then
        print *, co_containers(2)[1]%stuff  ! NOTE
    end if
end program

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-05 16:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 16:13 Possible bug: array-coarray of derived type with allocatable component Harris Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).