You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The transcript below demonstrates the runtime error message that the OpenCoarrays function libcaf_mpi::caf_get_by_ref() produces in a simple scenario wherein a derived-type coarray has an allocatable, derived-type array component. A cumbersome workaround is to flatten such coarray data structures so that the components of derived type coarrays are intrinsic types. Even with this workaround, a source allocation will fail. A workaround for the lack of source allocation is to use mold allocation followed by element-by-element copying of the component array.
The following are the results of compiling the code below with the gfortran versions cited in bold:
8.3.0: the final allocation generates the runtime error message below.
9.2.0: the allocation completes without error but the subsequent component access generates a segmentation fault - invalid memory reference.
10.0.0: same as 8.3.0.
$ cat opencoarrays-missing-feature.f90
implicit none
type package
integer, allocatable :: surface_fluxes(:)
end type
type outbox
type(package), allocatable :: block_surfaces(:)
end type
type(outbox), save:: halo[*]
integer, parameter:: source_image =1integer, parameter:: message(1)=[99]
if (this_image() == source_image) then
allocate(halo%block_surfaces(1))
allocate(halo%block_surfaces(1)%surface_fluxes, source = message)
end if
sync all
if (this_image() /= source_image) then
allocate(halo%block_surfaces(1))
allocate(halo%block_surfaces(1)%surface_fluxes, mold = halo[source_image]%block_surfaces(1)%surface_fluxes)
halo%block_surfaces(1)%surface_fluxes(1) = halo[source_image]%block_surfaces(1)%surface_fluxes(1)
end if
end
$ caf opencoarrays-missing-feature.f90
$ cafrun -n 2 ./a.out
Fortran runtime error on image 2: libcaf_mpi::caf_get_by_ref(): two or more array part references are not supported.
Error: Command:
`/usr/local/Cellar/mpich-3.2-gnu-8.3.0/bin/mpiexec -n 2 ./a.out`
failed to run.
The text was updated successfully, but these errors were encountered:
Adding a link to the 76-line example that motivated this issue. It seg faults without producing the useful error message above, but captures more detail from the relevant class hierarchy in the ultimate application (Morfeus).
@neok-m4700 I'm adding the "help wanted" label to this issue. Thanks for your great contribution to fixing issue #511. The example in this issue is one step closer to what we want to do and the link to the 76-line example in my earlier comment is even closer to what the full application does. If you have any interest in looking this, let us know. As it stands, any OpenCoarrays contributor is at least several weeks away from working on it so any community contributions are welcome.
The transcript below demonstrates the runtime error message that the OpenCoarrays function
libcaf_mpi::caf_get_by_ref()
produces in a simple scenario wherein a derived-type coarray has anallocatable
, derived-type array component. A cumbersome workaround is to flatten such coarray data structures so that the components of derived type coarrays are intrinsic types. Even with this workaround, asource
allocation will fail. A workaround for the lack ofsource
allocation is to usemold
allocation followed by element-by-element copying of the component array.The following are the results of compiling the code below with the
gfortran
versions cited in bold:segmentation fault - invalid memory reference
.The text was updated successfully, but these errors were encountered: