Static Analysis Problem Type Reference
A FORTRAN COMMON block mixes TREADPRIVATE and non-THREADPRIVATE data.
If a THREADPRIVATE directive specifying a COMMON block name appears in one program unit, then such a directive must also appear in every other program unit that contains a COMMON statement specifying the same name. It must appear after the last such COMMON statement in the program unit. This diagnostic indicates that a COMMON block was declared THREADPRIVATE in one routine and not in another.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Definition |
The place where the COMMON block was declared not THREADPRIVATE |
|
2 |
Definition |
The place where the COMMON block was declared THREADPRIVATE |
! Example adapted from A.25.4f from OpenMP 3.0 Specification
! Copyright (C) 1997-2008 OpenMP Architecture Review Board
SUBROUTINE A25_4_GOOD()
COMMON /T/ A
!$OMP THREADPRIVATE(/T/)
CONTAINS
SUBROUTINE A25_4S_GOOD()
COMMON /T/ A
!$OMP THREADPRIVATE(/T/)
!$OMP PARALLEL COPYIN(/T/)
!$OMP END PARALLEL
END SUBROUTINE A25_4S_GOOD
END SUBROUTINE A25_4_GOOD
SUBROUTINE A25_4_BAD()
COMMON /T/ A
CONTAINS
SUBROUTINE A25_4S_BAD()
COMMON /T/ A
!$OMP PARALLEL COPYIN(/T/)
!$OMP END PARALLEL
END SUBROUTINE A25_4S_BAD
END SUBROUTINE A25_4_BAD
Copyright © 1997-2008 OpenMP Architecture Review Board.
Permission to copy without fee all or part of this material is granted, provided the OpenMP Architecture Review Board copyright notice and the title of this document appear. Notice is given that copying is by permission of OpenMP Architecture Review Board.