Problem with large static (module) variable

Hi

The following code takes a very long time (~ 6 minutes) to compile :

MODULE BATOR_MODULE


IMPLICIT NONE

INTEGER(KIND=4),PARAMETER :: NMxFov  =  1000  ! nombre maximum de Fov / scanline
INTEGER(KIND=4),PARAMETER :: NMxChan = 10000  ! nombre maximum de canaux
INTEGER(KIND=4),PARAMETER :: NMxSat  =  1024  ! nombre maximum de satellites (limite OMM)
INTEGER(KIND=4),PARAMETER :: NMxPro  =   256  ! nombre maximum de producteurs
INTEGER(KIND=4),PARAMETER :: NMxCan  =    16  ! nombre maximum de canaux (geowind)
INTEGER(KIND=4),PARAMETER :: NMxSur  =    10  ! nombre maximum de type de surface

TYPE SATOBSSEL
  INTEGER(KIND=4)                      :: SclStart          ! Scl de depart
  INTEGER(KIND=4)                      :: SclJump           ! saut en Scl
  INTEGER(KIND=4),DIMENSION(1:NMxFov)  :: TabFov            ! tableau des Fov
  INTEGER(KIND=4),DIMENSION(1:NMxFov)  :: TabFovInterlace   ! tableau des Fov entrelaces
  LOGICAL                              :: FovInterlace      ! active/desactive l'entrelacement
  INTEGER(KIND=4)                      :: NbChannels        ! nombre de canaux dans le fichier
  INTEGER(KIND=4),DIMENSION(1:NMxChan) :: ChannelsList      ! liste des canaux a recuperer
  LOGICAL                              :: LPrint            ! impression de la structure
  LOGICAL                              :: BAYRAD=.FALSE.    ! create extended base (with T and Q)
  INTEGER(KIND=4),DIMENSION(90)        :: VARNOLIST=-1      ! list of varno to consider (2 for T, 29 for RH, 7 for Q)
  REAL(KIND=8),DIMENSION(90)           :: BAYRADPRES=-1.0   ! pressure levels (pseudo obs.)
  LOGICAL                              :: BAYRADEXP=.FALSE. ! create experimental extended base
  INTEGER(KIND=4)                      :: NLEVEXP=90        ! number of levels used in exp data
END TYPE SATOBSSEL

TYPE S_CRIS
  TYPE(SATOBSSEL)                      :: t_select
END TYPE S_CRIS

TYPE(S_CRIS), DIMENSION(-1:NMxSat)     :: TS_CRIS

END MODULE BATOR_MODULE

6 minutes might look acceptable, but the problem is that we have several variables like TS_CRIS in our code. gfortran compiles this code in less than 1s, same for ifort.

Regards,

Philippe

Hi Philippe,

Can you post what version of the compiler and what options you use to compile? On my machine here, not the latest and greatest hardware, it takes about 26 seconds. Not great, but better than 6 minutes. I want to get the details correct.

  • Brent

Hi Brent,

Here are the details you requested :

[CNC tmp]$ pgf90 --version

pgf90 (aka nvfortran) 21.7-0 64-bit target on x86-64 Linux -tp zen 
PGI Compilers and Tools
Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.
[CNC tmp]$ cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.8 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.8"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.8 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.8:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.8
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.8"
[CNC tmp]$ time pgf90 -c bator_module.F90 

real    6m35.894s
user    6m30.166s
sys     0m1.234s

Regards,

Philippe