Skip to content
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

Defect: wrong value for this_image() in array constructor #681

Open
1 task done
reinh-bader opened this issue Sep 14, 2019 · 2 comments
Open
1 task done

Defect: wrong value for this_image() in array constructor #681

reinh-bader opened this issue Sep 14, 2019 · 2 comments
Assignees
Labels
bug Hacktoberfest Hacktoberfest issues easy for new contributors help-wanted in progress unconfirmed

Comments

@reinh-bader
Copy link

reinh-bader commented Sep 14, 2019

  • 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: 2.7.1
  • Fortran Compiler: gfortran 9.2.0
  • C compiler used for building lib: gcc 9.2.0
  • Installation method: cmake
  • All flags & options passed to the installer
    CC=gcc FC="gfortran -I$MPI_BASE/include/gfortran/9.1.0" cmake /dss/dsshome1/lrz/noarch/src/compilers/gcc/opencoarrays/OpenCoarrays-2.7.1 -DCMAKE_INSTALL_PREFIX=${PWD}
  • Output of uname -a:
    Linux mpp2-login5 4.4.180-94.100-default tests dis_transpose: test passed  #1 SMP Tue Jul 9 19:57:20 UTC 2019 (1569ffb) x86_64 x86_64 x86_64 GNU/Linux
  • MPI library being used: Intel MPI 2019 update 5
  • Machine architecture and number of physical cores: Haswell 28 core
  • Version of CMake: 3.10 (self-installed)

To help us debug your issue please explain:

What you were trying to do (and why)

assign to an array constructor:

a = (/ this_image(), 5*this_image() /)

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

resulting value of a after the statement is [ 0,0 ]

What you expected to happen

resulting value of a after statement is [ 1,5 ] on image 1

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

Use the following code:

program test_constr
  use, intrinsic :: iso_fortran_env
  implicit none

  real :: a(2), temp

  a = (/ this_image(), 5*this_image() /)
  write(output_unit,*) "first a is: ", a

  sync all
  a =  this_image()
  write(output_unit,*) "second a is: ", a

end program

build it with
caf tu.f90
execute with
cafrun -n 1 ./a.out

Notes:

  • more than 1 image also gives wrong results on the other images.
  • building with -fcoarray=single produces the expected result.
  • assigning a scalar that is broadcast to the array works as expected.
@zbeekman
Copy link
Collaborator

zbeekman commented Oct 8, 2019

Thanks for reporting this. This smells like a GFortran front-end/IR problem to me. I'll try to investigate and if I confirm that to be the case we should open an issue upstream.

@zbeekman zbeekman self-assigned this Oct 8, 2019
@zbeekman zbeekman added bug in progress unconfirmed Hacktoberfest Hacktoberfest issues easy for new contributors help-wanted labels Oct 8, 2019
@vehre
Copy link
Collaborator

vehre commented Oct 15, 2024

Retesting with gfortran 15 (current development) and mpich and intel mpi. In both cases I see no issues. Can you retest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Hacktoberfest Hacktoberfest issues easy for new contributors help-wanted in progress unconfirmed
Projects
None yet
Development

No branches or pull requests

3 participants