COMMON block is partly OpenMP* THREADPRIVATE

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

Observation

Description

1

Definition

The place the COMMON block was declared not THREADPRIVATE

2

Definition

The place the COMMON block was declared THREADPRIVATE

Examples


! 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
        

Note iconNote

This example, adapted from OpenMP 3.0 Specification, is covered by the following:

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.

Copyright © 2010, Intel Corporation. All rights reserved.