- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
The behavior of the following code (compiled with ifx 2025.2.0) is incorrect:
PROGRAM P
USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : TEAM_TYPE
IMPLICIT NONE
TYPE (TEAM_TYPE) :: T
FORM TEAM(1, T)
WRITE(*, FMT = 100) 'Before CT block:', 'n = ', NUM_IMAGES(), '; i = ', &
THIS_IMAGE(), '; t = ', TEAM_NUMBER()
CT : CHANGE TEAM (T)
WRITE(*, FMT = 100) 'Inside CT block:', 'n = ', NUM_IMAGES(), '; i = ', &
THIS_IMAGE(), '; t = ', TEAM_NUMBER()
BLOCK
EXIT CT ! Commenting this statement leads to the expected behavior.
END BLOCK
END TEAM CT
WRITE(*, FMT = 100) 'After CT block:', 'n = ', NUM_IMAGES(), '; i = ', &
THIS_IMAGE(), '; t = ', TEAM_NUMBER()
100 FORMAT(A20, 4X, 3(A, I4))
END PROGRAM P
The program was run with 4 coarray images (/Qcoarray-num-images:4) and the output is the following:
Before CT block: n = 4; i = 1; t = -1
Before CT block: n = 4; i = 4; t = -1
Inside CT block: n = 4; i = 4; t = 1
Before CT block: n = 4; i = 3; t = -1
Inside CT block: n = 4; i = 3; t = 1
After CT block: n = 4; i = 3; t = 1
Before CT block: n = 4; i = 2; t = -1
Inside CT block: n = 4; i = 2; t = 1
After CT block: n = 4; i = 2; t = 1
Inside CT block: n = 4; i = 1; t = 1
After CT block: n = 4; i = 1; t = 1
After CT block: n = 4; i = 4; t = 1
As you can see, the team number reported by each image AFTER they exit the CHANGE TEAM construct is invalid: it should be back to the default team (-1) since "The current team of each image executing an END TEAM statement becomes the team that was current prior to execution of the corresponding CHANGE TEAM statement."
Note that if you comment out the EXIT statement in the inner block (on line 12), then the code behaves as expected.
Essentially, it looks as if the END TEAM statement is not properly executed.
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Your code example is not conforming. EXIT from within a CHANGE TEAM construct is not allowed. The END TEAM statement is an image control statement and must be executed to end a team.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
From the Intel documentation:
An EXIT statement in a CHANGE TEAM construct is effectively the same as a branch to the END TEAM statement of the construct. Within a CHANGE TEAM construct, a CYCLE or EXIT statement is not allowed if it belongs to an outer construct. A RETURN statement may not appear in a CHANGE TEAM construct.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
PROGRAM MAIN
USE ISO_FORTRAN_ENV
INTEGER,PARAMETER :: top_left = 11, bot_left = 21, top_right = 12, bot_right = 22
INTEGER,DIMENSION(16) :: quads = [top_left, top_left, bot_left, bot_left, &
top_left, top_left, bot_left, bot_left, &
top_right, top_right, bot_right, bot_right, &
top_right, top_right, bot_right, bot_right]
INTEGER,DIMENSION(16) :: images = [1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 1, 2, 3, 4, 3, 4]
TYPE (TEAM_TYPE) :: quadrants, original_team
REAL :: co_array1[4,*], co_array2 [4, *]
INTEGER :: me
original_team = GET_TEAM(INITIAL_TEAM) ! Create variable describing initial team
me = THIS_IMAGE()
FORM TEAM (quads(me), quadrants, NEW_INDEX=images(me))
CHANGE TEAM (quadrants, ca[2, *] => co_array1)
x = ca[3, TEAM_NUMBER=top_right]
END TEAM
END PROGRAM
if I attempt to compile the sample from the page I get the following error:
Severity Code Description Project File Line Suppression State Details
Error error #8366: The number of cosubscripts is incorrect. [CA] B:\Users\macne\Documents\Visual Studio 2017\Projects\Program129-Heimdallr\HeatSolve\Console1\Console1\Console1.f90 17
I do not know enough about coarrays to see the error and he #8366 does not show up on a search.
Any ideas?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
My mistake, you are correct. This was really new to me. EXIT does not act as an image control statement but it does branch to the image control statement. So your code example should really work. It should be a compiler bug.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I confirm that the standard says, in 11.1.12 (EXIT statement): "If the EXIT statement belongs to a CHANGE TEAM construct, the effect is the same as transferring control to the END TEAM statement"
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Bug ID is CMPLRLLVM-68880
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
we have a fix for this bug. It should make the next Update release.

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora