Open ghost opened 6 years ago
@dobrecht Sorry, am I understanding you correctly that you are compiling with GCC/GFortran trunk? Or at least the latest commit on the 8.x branch? Or are you using the 8.1.0 official release?
CC: @scrasmussen
From my own testing: the get_team intrinsic function does not seem to be implemented yet and using it gives error messages at multiple levels (I did use gfortran 9.0.0 20180506 (experimental); on my system, the error messages are in german):
sync team (get_team())
generates the same compile time error as yours above.
sync team (get_team(1))
generates compile time error: Error: Argument »level« of the intrinsic »get_team« at (1) is not supported yet
sync team (get_team(initial_team))
generates compile time error: Error: Symbol »initial_team« at (1) has no IMPLICIT-Typ (this error is also with the constants parent_team and current_team, they are missing in iso_fortran_env)
The full test case:
program Main
! please compile and run with 15 coarray images
!
use,intrinsic :: ISO_FORTRAN_ENV
implicit none
!
integer :: intTeamNumber
type (team_type) :: MainTeam
type (team_type) :: SubTeam
!
!
!************************************************
! MainTeam **************************************
!************************************************
!
! split the 15 images of the initial team into 3 child teams consisting of 5 images each:
if (this_image() <= 5) then
intTeamNumber = 1
else if (this_image() >= 6 .and. this_image() <= 10) then
intTeamNumber = 2
else if (this_image() >= 11) then
intTeamNumber = 3
end if
!
form team (intTeamNumber, MainTeam) ! this creates the 3 child teams in MainTeam
!
change team (MainTeam)
!
! important: the following gets executed on the images of all the 3 newly created child teams:
!
!************************************************
! SubTeam ***************************************
!************************************************
!
! split the 5 images of the MainTeam's child teams into two distinct teams resp.:
if (this_image() < 3) then
intTeamNumber = 1
else
intTeamNumber = 2
end if
!
form team (intTeamNumber, SubTeam) ! this generates 6 teams (2 new sub teams in the 3 main teams resp.)
! within the change team (MainTeam) construct
change team (SubTeam)
!
sync team (get_team()) ! generates compile time error
!sync team (get_team(1)) ! generates compile time error
!sync team (get_team(initial_team)) ! generates compile time error
!
SubTeam_select: select case (team_number())
!
case (1) SubTeam_select
! codes for child team 1 of SubTeam:
write(*,*) 'image number: ', this_image(), ' of team number: ', team_number(), &
' in SubTeam, of MainTeam''s child team number:' !, team_number(MainTeam)
!Fortran runtime error on image 1: team_number does not yet support the optional team argument
!
!*******************
case (2) SubTeam_select
! codes for child team 2 of SubTeam:
write(*,*) 'image number: ', this_image(), ' of team number: ', team_number(), &
' in SubTeam, of MainTeam''s child team number:' !, team_number(MainTeam)
!Fortran runtime error on image 1: team_number does not yet support the optional team argument
!
end select SubTeam_select
!
end team !(SubTeam)
!
!*************
!*************
!*************
!
end team !(MainTeam)
!
end program Main
Best Regards
@zbeekman I am using the updated branch of 8.1.X (gcc 8.1.1 20180528) ; the 2018-05-28 build
@scrasmussen is Fortran 8.2 and OpenCoarrays 2.2.0 supposed to support get_team()
and sync team
?
$ cat testteam.f90
sync team(get_team()) ; end
$ caf testteam.f90
f951: internal compiler error: Intrinsic function '_gfortran_caf_get_team' (118) not recognized
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/Homebrew/homebrew-core/issues> for instructions.
Error: comand:
`/usr/local/bin/gfortran-8 -I/usr/local/include/OpenCoarrays-2.2.0-4-gc536225_GNU-8.2.0 -fcoarray=lib -Wl,-flat_namespace -Wl,-commons,use_dylibs -L/usr/local/Cellar/libevent/2.1.8/lib testteam.f90 /usr/local/lib/libcaf_mpi.a /usr/local/Cellar/open-mpi/3.1.2/lib/libmpi_usempif08.dylib /usr/local/Cellar/open-mpi/3.1.2/lib/libmpi_usempi_ignore_tkr.dylib /usr/local/Cellar/open-mpi/3.1.2/lib/libmpi_mpifh.dylib /usr/local/Cellar/open-mpi/3.1.2/lib/libmpi.dylib`
failed to compile.
In case it helps: My first successful test of using the SYNC TEAM statement as standalone was with gfortran 8.0.1 and OpenCoarrays 2.0.0, like this: sync team (new_team) . The effect of SYNC TEAM was only on the images with the same team number (within the SELECT CASE for code execution with that team number). Using SYNC ALL, on the other hand, did effect all images within the CHANGE TEAM construct. That is exactly the desired runtime behavior, everything was perfect with my testing. (My above test case was only to show, that GET_TEAM() does not seem to be implemented yet. Instead, you can use the test case to test the SYNC TEAM statement by simply putting a SYNC TEAM(SubTeam) within the CASE(1) block, for example.)
cheers
@zbeekman Fortran 8.2 is supposed to support get_team()
, I've started looking into this issue and will work on solving it. Thanks for pinging me and that short reproducer
Thanks @MichaelSiehl for your work and comments on this, they are helpful
Any updates @scrasmussen ?
After doing some code spelunking, it seems clear that get_team()
just is not implemented, whatsoever on the library (OpenCoarrays) side.
Just FYI, the missing intrinsic function get_team() can easily be circumvented by the programmer for the team variable of the parent and the current team (just by maintaining the values of these team variables locally). Only the team value of the initial team is not accessible to the programmer without the get_team() function.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I did just newly check using OpenCoarrays 2.6.1 and the most recent gfortran 9.0.1 (experimental). My above test case does still generate the same compile time errors. Therefore, I would recommend to leave this issue open yet.
These error messages remain:
Yes, I agree... I needed to fix something in the configuration of the stalebot. This issue should stay open until it is resolved.
This has also been reported in the gfortran front end: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88154
This bug happens with -fcoarray=single
so it appears changes are needed on the compiler side too.
I read through this thread and understand that implementation of get_team()
is a TODO.
Posting here for the next person who lands here: get_team
is not implemented as of gcc-9.2.0 and OpenCoarrays-2.8.0.
It be extremely helpful to maintain a doc that lists the status of features (not implemented/in progress/implemented) so that people know what they can expect. Is there any such doc?
I'm not part of the OpenCoarrays team but, regarding coarray teams, did maintain such a list myself. The good news: this open issue here was the last unresolved issue on my (old) list.
Among the already solved (more important) issues on my list are: https://github.com/sourceryinstitute/OpenCoarrays/issues/533 https://github.com/sourceryinstitute/OpenCoarrays/issues/610 https://github.com/sourceryinstitute/OpenCoarrays/issues/524
But I did not too many new coding with coarray teams in the last few month, since my recent main focus is on object-oriented parallel programming through coarray components using OpenCoarrays/gfortran.
cheers
I think this would be more straightforward to implement if OpenCoarrays (at least when compiled with MPI support) used the underlying MPI communicator to directly represent the team object. I had a branch of an older version of OpenCoarrays that implemented this (as well as the optional TEAM argument to TEAM_NUMBER()): https://github.com/nathanweeks/OpenCoarrays/commit/31e39f29ac2197981fda8ccf21fb7c9e9f4bb701
If there's interest, I could update this branch for OpenCoarrays 2.8.0 and submit a PR for more formal review.
Defect/Bug Report
uname -a
: Linux dune 4.16.12-1-ARCH #1 SMP PREEMPT Fri May 25 23:30:31 UTC 2018 x86_64 GNU/Linux (running under VirtualBox on an iMac)Observed Behavior
I get a compile error when trying to use the get_team() intrinsic:
Compiling the above, I get:
So, it appears that get_team() returns an integer.
FURTHER...
I then changed the return type to an integer:
I then get a internal compiler error:
Expected Behavior
get_team() should compile and link. get_team should return a TEAM_TYPE variable.
NOTE: This could be a bug in both gfortran and opencoarrays.
Steps to Reproduce
In Observed Behavior.