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

STOP normal termination: missing OUTPUT_UNIT output #160

Closed
mexas opened this issue Mar 11, 2016 · 14 comments
Closed

STOP normal termination: missing OUTPUT_UNIT output #160

mexas opened this issue Mar 11, 2016 · 14 comments
Assignees

Comments

@mexas
Copy link

mexas commented Mar 11, 2016

$ cat term.f90
integer :: i[*], j, img
  img = this_image()
  i = img
  if ( img .eq. 1 ) stop "img 1 cannot continue"
  do j = 1 , 100000000
    i = int( atan( real( j ) ) )
  end do
  write (*,*) "img=", img, "i=", i
end

$ caf -o term.ox -Werror -O2 term.f90

$ cafrun -np 5 term.ox
STOP img 1 cannot continue

The output from other images is missing.
Should be something like this:

img 1 cannot continue
 img=           3 i=           1
 img=           2 i=           1
 img=           4 i=           1
 img=           5 i=           1

This has been confirmed as incorrect behaviour at:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=comp-fortran-90;f35859ec.1603

Anton

@afanfa afanfa self-assigned this Mar 11, 2016
@afanfa
Copy link
Contributor

afanfa commented Mar 11, 2016

Anton, thanks for reporting this. I'll fix it during the weekend.

Alessandro

@afanfa afanfa added the waiting label Mar 13, 2016
@afanfa
Copy link
Contributor

afanfa commented Mar 13, 2016

Hi,
I've noticed that the STOP statement is translated into an invocation to a function not implemented in OpenCoarrays. This function is commonly used for serial execution and does not have any knowledge about coarrays.
I need to modify GFortran to distinguish coarray and non-coarray cases and invoke the right function accordingly. Obviously, in the coarray case, the program will invoke the function implemented into OpenCoarrays (to do).

@afanfa
Copy link
Contributor

afanfa commented Mar 26, 2016

Hi,

I've got a working patch for GFortran and OpenCoarrays about this bug. I'll submit them tomorrow.

Cheers,
Alessandro

@rouson
Copy link
Member

rouson commented Mar 26, 2016

👏

afanfa pushed a commit that referenced this issue Mar 27, 2016
@afanfa afanfa mentioned this issue Mar 27, 2016
@afanfa
Copy link
Contributor

afanfa commented Mar 28, 2016

The GFortran patch has been applied to trunk and gcc-5-branch.

@afanfa afanfa removed the waiting label Mar 28, 2016
@afanfa
Copy link
Contributor

afanfa commented Mar 30, 2016

Fixed

@zbeekman
Copy link
Collaborator

@mexas I just wanted to confirm that this has solved your problem. We are issuing a new release today with these changes---since builds of OpenCoarrays with gcc-trunk or gcc-5-branch (GCC > 5.3) will have a build failure with previous releases of OpenCoarrays ( <= 1.3.8)

@mexas
Copy link
Author

mexas commented Apr 11, 2016

I don't see any change.

$ which caf
/panfs/panasas01/mech/mexas/OpenCoarrays-1.4.0/opencoarrays-installation/bin/caf
$ which cafrun
/panfs/panasas01/mech/mexas/OpenCoarrays-1.4.0/opencoarrays-installation/bin/cafrun
$ caf -o term.ox -Werror -O2 term.f90
$ cafrun -np 8 term.ox
STOP img 1 cannot continue
$ cat term.f90
implicit none
integer :: i[], j, img
img = this_image()
i = img
if ( img .eq. 1 ) stop "img 1 cannot continue"
do j = 1 , 100000000
i = int( atan( real( j ) ) )
end do
write (
,*) "img=", img, "i=", i
end
$ ldd term.ox
linux-vdso.so.1 => (0x00002aaaaaacb000)
libmpifort.so.12 => /panfs/panasas01/mech/mexas/mpich3.2-install/lib/libmpifort.so.12 (0x00002aaaaaccd000)
libmpi.so.12 => /panfs/panasas01/mech/mexas/mpich3.2-install/lib/libmpi.so.12 (0x00002aaaaaf03000)
libgfortran.so.3 => /cm/shared/languages/GCC-5.3/lib64/libgfortran.so.3 (0x00002aaaab391000)
libm.so.6 => /lib64/libm.so.6 (0x00002aaaab6ce000)
libgcc_s.so.1 => /cm/shared/languages/GCC-5.3/lib64/libgcc_s.so.1 (0x00002aaaab953000)
libquadmath.so.0 => /cm/shared/languages/GCC-5.3/lib64/libquadmath.so.0 (0x00002aaaabb69000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaaabda7000)
librt.so.1 => /lib64/librt.so.1 (0x00002aaaac13c000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaac344000)
/lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000)
$ caf -v

OpenCoarrays Coarray Fortran Compiler Wrapper (caf version 1.4.0)
Copyright (C) 2015-2016 Sourcery, Inc.

OpenCoarrays comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of OpenCoarrays under the terms of the
BSD 3-Clause License. For more information about these matters, see
the file named LICENSE.

$ caf -w
caf wraps CAFC=mpif90
$ mpif90 -v
mpifort for MPICH version 3.2
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/cm/shared/languages/GCC-5.3/libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-5.3.0/configure --prefix=/cm/shared/languages/GCC-5.3 --enable-languages=c,c++,fortran --with-gmp=/cm/shared/languages/GCC-5.3 --with-mpfr=/cm/shared/languages/GCC-5.3
Thread model: posix
gcc version 5.3.0 (GCC)

@afanfa
Copy link
Contributor

afanfa commented Apr 11, 2016

Dear Anton,
the bug was on library AND compiler. You also need to update your gcc with the latest trunk version (gcc-6) or gcc 5.4 (not yet released but available as snapshot).

Cheers,
Alessandro

@zbeekman
Copy link
Collaborator

@mexas ah yes, my apologies, I forgot to mention that you will need to try using a development version of gcc... if you're on Mac OS X and use homebrew, you can install the trunk version (GCC 6) with brew install --HEAD gcc. Currently there is a small issue with the binary suffix names: you'll need to use gcc- and gfortran- as the compiler names if you take this approach. Alternatively, you can wait for an official release of GCC 5.4 or GCC 6.1 (not sure when these will be released, but they should be in the next month or two I would guess)

@mexas
Copy link
Author

mexas commented Apr 12, 2016

Dear Anton,
the bug was on library AND compiler. You also need to update your gcc with the latest trunk version (gcc-6) or gcc 5.4 (not yet released but available as snapshot).

ok, in this case, I need more time to check.

Thank you

Anton

@mexas
Copy link
Author

mexas commented Apr 12, 2016 via email

@mexas
Copy link
Author

mexas commented Apr 12, 2016

got there finally with (GCC) 6.0.0 20160410

newblue4> cafrun -np 8 term.ox
STOP img 1 cannot continue
img= 2 i= 1
img= 7 i= 1
img= 8 i= 1
img= 4 i= 1
img= 5 i= 1
img= 6 i= 1
img= 3 i= 1
newblue4>

Thanks

Anton

@zbeekman
Copy link
Collaborator

Awesome! Happy to hear that this has resolved the issue. (or at least, once
gcc 5.4 or gcc 6 become available)

On Tue, Apr 12, 2016 at 6:33 PM mexas [email protected] wrote:

got there finally with (GCC) 6.0.0 20160410

newblue4> cafrun -np 8 term.ox

STOP img 1 cannot continue

img= 2 i= 1
img= 7 i= 1
img= 8 i= 1
img= 4 i= 1
img= 5 i= 1
img= 6 i= 1
img= 3 i= 1
newblue4>

Thanks

Anton


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#160 (comment)

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

4 participants