Skip to content

OC 1.9.0: allocatable component in derived type coarray can't be allocated #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MichaelSiehl opened this issue Jun 3, 2017 · 9 comments
Assignees

Comments

@MichaelSiehl
Copy link

MichaelSiehl commented Jun 3, 2017

Defect/Bug Report: OpenCoarrays 1.9.0: allocatable component in derived type coarray can't be allocated#

Are allocatable components in derived type coarrays are really supported with the current OpenCoarrays 1.9.0 master download? I tried it out but the allocate statement itself does (seem to) crash the application. I have a small example program here: https://github.com/MichaelSiehl/Coarray-with-Allocatable-Component-Example
The following ALLOCATE statements did crash my example program:
ALLOCATE (Coarray_Object % reaDataArray (LBOUND (reaDataArray, DIM=1) : UBOUND (reaDataArray, DIM=1)))
and also the simpler form
ALLOCATE (Coarray_Object % reaDataArray (1 : 2))
did crash my example program. Therefore, it must be the ALLOCATE statement itself that makes the program hang.

  • OpenCoarrays Version: 1.9.0, the current master
  • Fortran Compiler: gfortran 8.0.0
  • C compiler used for building lib: gcc 8.0.0
  • Installation method: make
  • MPI library being used: MPICH 3.2
  • Machine architecture and number of physical cores: Linux Ubuntu 14.04 on an intel icore, 4 cores
@zbeekman
Copy link
Collaborator

zbeekman commented Jun 5, 2017

Hi Michael,

OpenCoarrays Version: 1.9.0, the current master
Sorry... which is it master or 1.9.0?

  • Fortran Compiler: gfortran 8.0.0
  • C compiler used for building lib: gcc 8.0.0

Does this mean you're building GCC and GFortran from source using the current GCC trunk? I ask, because the latest stable release is 7.1.0 not 8.0.0. Using OpenCoarrays with GCC trunk is not officially supported.

  • Installation method: make

So you're not using CMake, you're just typing make? Can you try using either the "Advanced CMake based installation" or the installer script?

I'm tempted to completely remove the Makefiles from the src tree, since I think they are used almost exclusively by Alessandro (@afanfa) and are not really intended for end users.

@zbeekman
Copy link
Collaborator

zbeekman commented Jun 5, 2017

Hi @MichaelSiehl,

When I try to run your code locally using MPICH and OpenCoarrays (master) with GFortran/GCC 7.1 on MacOS, the program hangs. I'm still digging around a bit, but this does look like it's either a bug, or due to some yet to be implemented feature. @vehre any chance you could take a look at Michael's code? (https://github.com/MichaelSiehl/Coarray-with-Allocatable-Component-Example)

@zbeekman zbeekman added this to the 2.0.0 milestone milestone Jun 5, 2017
@zbeekman
Copy link
Collaborator

zbeekman commented Jun 5, 2017

@vehre Here is a minimalistic reproducer:

program main

  implicit none
  type :: nonsymmetric
     real, dimension(:), allocatable :: arr
  end type

  type(nonsymmetric), codimension[*] :: parent_obj

  sync all

  if (this_image() == 2) then
     allocate(parent_obj%arr(3))
  end if

  sync all

  if (this_image() == 1) then
     print*, 'Image 2 has size ', size(parent_obj[2]%arr), ' asymmetric allocation'
  end if
end program

Any ideas why this hangs? Tested with master @ 232d234

@afanfa
Copy link
Contributor

afanfa commented Jun 6, 2017

@zbeekman please do not remove the Makefile. I know several users that rely on that and they would not be happy to deal with CMake.

@zbeekman
Copy link
Collaborator

zbeekman commented Jun 6, 2017

I've confirmed this bug happens using CMake too, so it's not the Makefile's fault 😄

@zbeekman
Copy link
Collaborator

zbeekman commented Jun 6, 2017

@afanfa would it be acceptable to keep the Makefiles in the git repo, but exclude them from release archives? That way most users who get official releases won't be tempted into running make?

@MichaelSiehl
Copy link
Author

MichaelSiehl commented Jun 6, 2017

Hi Zaak,
thanks for investigating on this. Also with your short example, it seems to be the ALLOCATE statement that causes the failure.
I did download the master directly and did assume it was 1.9.0. Also, I was using the GGC 8 trunk (which is, apart from this, well working with OpenCoarrays). Until now, I did just use make to compile OpenCoarrays (because it worked well and was simple to use -one can easily compile and use different versions of the OpenCoarrays library on the same system, even with the same terminal window-). Nevertheless, it's no problem to use cmake instead. So, for me it would be just fine if the make file would be in the git repo only and not in the release.
cheers

@vehre
Copy link
Collaborator

vehre commented Aug 6, 2017

There is a branch now issue-399 which addresses the issue for gcc 7+ unfortunately does is break some things on gcc 6.x. Still investigating.

@rouson
Copy link
Member

rouson commented Aug 6, 2017

I have found that there are almost as many preferred installation methods as there are users. While we can't provide every installation method to every user, keeping the Makefile in the repository but out of releases seems like a good compromise. Thanks for the suggestion, @afanfa. We might need to hang a sign on the Makefile that says, "Abandon all hope, ye who enter here." ;)

@zbeekman zbeekman mentioned this issue Aug 8, 2017
4 tasks
zbeekman pushed a commit that referenced this issue Aug 9, 2017
 - New: unlimited depth of references
 - Changed: internal token and introduced sub-token
 - No optimization yet
 - Fixes #399

 Original commit, 722fba3, authored by
 @vehre, splite into whitespace changes (previous commit) and substantive
 changes (this commit) by @zbeekman
@zbeekman zbeekman mentioned this issue Aug 9, 2017
4 tasks
zbeekman pushed a commit that referenced this issue Aug 9, 2017
 - New: unlimited depth of references
 - Changed: internal token and introduced sub-token
 - No optimization yet
 - Fixes #399

 Original commit, 722fba3, authored by
 @vehre, split into white space changes (previous commit) and substantive
 changes (this commit) by @zbeekman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants