IRIX and Software

How to link shpalloc?

I was trying to run a model (first time) on my IRIS system and getting the below error. After going through the file, it is something related to shpalloc. Does anyone know this type of error?

***********************************************************************************************
f90 -C -mp -i4 -r8 -LIST -I/application/netcdf-3.5.0/include -I/usr/include -I./ -Duse_comm_MPI1 -Duse_libMPI -Duse_netCDF -DNC_DOUBLE -I../../../../src/lib/psmile/include -I../../../../src/lib/mpp_io/include -c ../../../../src/lib/mpp_io/src/mpp_mod.F90

integer(INT_KIND), private :: word(1)
^
f90-868 f90: ERROR MPP_MOD, File = ../../../../src/lib/mpp_io/src/mpp_mod.F90, Line = 68, Column = 11
"INT_KIND" is used in a constant expression, therefore it must be a constant.
***************************************************************************************************************

Around Line No.68, these are the few lines
**********************************************************************************
!various lengths (see shpalloc) are estimated in "words" which are 32bit on SGI, 64bit on Cray
!these are also the expected sizeof of args to MPI/shmem libraries
#ifdef _CRAY
integer(LONG_KIND), private :: word(1)
#endif
#ifdef sgi_mipspro
integer(INT_KIND), private :: word(1)
#endif
**********************************************************************************

Kindly Help

Regards,
Phani
rphanim wrote: I was trying to run a model (first time) on my IRIS system and getting the below error. After going through the file, it is something related to shpalloc. Does anyone know this type of error?

***********************************************************************************************
f90 -C -mp -i4 -r8 -LIST -I/application/netcdf-3.5.0/include -I/usr/include -I./ -Duse_comm_MPI1 -Duse_libMPI -Duse_netCDF -DNC_DOUBLE -I../../../../src/lib/psmile/include -I../../../../src/lib/mpp_io/include -c ../../../../src/lib/mpp_io/src/mpp_mod.F90

integer(INT_KIND), private :: word(1)
^
f90-868 f90: ERROR MPP_MOD, File = ../../../../src/lib/mpp_io/src/mpp_mod.F90, Line = 68, Column = 11
"INT_KIND" is used in a constant expression, therefore it must be a constant.
***************************************************************************************************************

Around Line No.68, these are the few lines
**********************************************************************************
!various lengths (see shpalloc) are estimated in "words" which are 32bit on SGI, 64bit on Cray
!these are also the expected sizeof of args to MPI/shmem libraries
#ifdef _CRAY
integer(LONG_KIND), private :: word(1)
#endif
#ifdef sgi_mipspro
integer(INT_KIND), private :: word(1)
#endif
**********************************************************************************

Kindly Help

Regards,
Phani


Where can I download this code..?

You might want to try putting -Dsgi_mipspro just before or after -Duse_libMPI


Regan
死の神はりんごだけ食べる

開いた括弧は必ず閉じる -- あるプログラマー

:Tezro: :Tezro: :Onyx2R: :Onyx2RE: :Onyx2: :O3x04R: :O3x0: :O200: :Octane: :Octane2: :O2: :O2: :Indigo2IMP: :PI: :PI: :1600SW: :1600SW: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x Mac, 3 x SUN, Alpha DS20E, Alpha 800 5/550, 3 x RS/6000, Amiga 4000 VideoToaster, Amiga4000 -030, 733MHz Sam440 AmigaOS 4.1 update 1.

Sold: :Indy: :Indy: :Indy: :Indigo: Tandem Himalaya S-Series Nonstop S72000 ServerNet.

Twitter @PymbleSoftware
Current Apps (iOS) -> https://itunes.apple.com/au/artist/pymb ... d553990081
(Android) https://play.google.com/store/apps/deve ... +Ltd&hl=en
(Onyx2) Cortex ---> http://www.facebook.com/pages/Cortex-th ... 11?sk=info
(0300s) Minnie ---> http://www.facebook.com/pages/Minnie-th ... 02?sk=info
Github ---> https://github.com/pymblesoftware
Thank you for your prompt reply.

I have tried with -Dsgi_mipspro but getting the same error.
*********************************************************************************
f90 -C -mp -i4 -r8 -LIST -I/application/netcdf-3.5.0/include -I/usr/include -I./ -Duse_comm_MPI1 -Dsgi_mipspro -Duse_libMPI -Duse_netCDF -DNC_DOUBLE -I../../../../src/lib/psmile/include -I../../../../src/lib/mpp_io/include -c ../../../../src/lib/mpp_io/src/mpp_mod.F90

integer(INT_KIND), private :: word(1)
^
f90-868 f90: ERROR MPP_MOD, File = ../../../../src/lib/mpp_io/src/mpp_mod.F90, Line = 68, Column = 11
"INT_KIND" is used in a constant expression, therefore it must be a constant.
*********************************************************************************

I was trying to attach the file which is giving problem but saying "the extension is not allowed"

Basically, I was trying to run an atmospheric model and this many sub-models are included and in that one is "PRISM" which has "psmile" subroutines.
One of the subroutine is giving this error.
**********************************************************************
!-----------------------------------------------------------------------
! Communication for message-passing codes
!
! AUTHOR: V. Balaji ( [email protected] )
! Princeton University/GFDL
!
! MODIFICATIONS: Reiner Vogelsang ( [email protected] )
!
! This program is free software; The author agrees that you can
! redistribute and/or modify this version of the program under the
! terms of the Lesser GNU General Public License as published
! by the Free Software Foundation.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! Lesser GNU General Public License for more details
! ( http://www.gnu.org/copyleft/lesser.html ).
!-----------------------------------------------------------------------

!these are used to determine hardware/OS/compiler
!#include <os.h>

!onlysgi_mipspro one of SMA or MPI can be used
!(though mixing calls is allowed, this module will not)
#ifdef use_libSMA
#undef use_libMPI
#endif
!
#if defined(_CRAYT3E) || defined(_CRAYT3D) || defined(sgi_mipspro)
#define SGICRAY_MPP
#endif
!
!shmalloc is used on MPP SGI/Cray systems for shmem
#if defined(use_libSMA) && defined(SGICRAY_MPP)
#define use_shmalloc
#endif

module mpp_mod
use mod_kinds_model
#include <os.h>
!string BWA is used to tag lines that are bug workarounds and will disappear
!when offending compiler bug is fixed
!a generalized communication package for use with shmem and MPI
!will add: co_array_fortran, MPI2
!Balaji ( [email protected] ) 11 May 1998
#ifdef sgi_mipspro
#ifdef use_libSMA
use shmem_interface
#endif
!#ifdef use_libMPI
! use mpi
!#endif
#endif
implicit none
private
character(len=128), private :: version= &
'$Id: mpp_mod.F90,v 1.1.1.1 2005/03/23 16:01:11 adm Exp $'
character(len=128), private :: tagname= &
'$Name: $'

!various lengths (see shpalloc) are estimated in "words" which are 32bit on SGI, 64bit on Cray
!these are also the expected sizeof of args to MPI/shmem libraries
#ifdef _CRAY
integer(LONG_KIND), private :: word(1)
#endif
#ifdef sgi_mipspro
integer(INT_KIND), private :: word(1)
#endif

#ifdef SGICRAY
!see intro_io(3F): to see why these values are used rather than 5,6,0
integer, private :: in_unit=100, out_unit=101, err_unit=102
#else
integer, private :: in_unit=5, out_unit=6, err_unit=0
#endif
integer :: log_unit, etc_unit
logical, private :: module_is_initialized=.FALSE.
integer, private :: pe=0, node=0, npes=1, root_pe=0
integer, private :: error
integer, parameter, private :: MAXPES=2048 !used for dimensioning stuff that might be indexed by pe
character(len=32) :: configfile='logfile.out'
character(len=32) :: etcfile='._mpp.nonrootpe.stdout'
logical,save::logfile_defined=.false.,opened
integer::io_num

!initialization flags
integer, parameter, public :: MPP_VERBOSE=1, MPP_DEBUG=2
logical, private :: verbose=.FALSE., debug=.FALSE.

!flags to transmit routines
integer, parameter, public :: ALL_PES=-1, ANY_PE=-2, NULL_PE=-3

!errortype flags
integer, parameter, public :: NOTE=0, WARNING=1, FATAL=2
logical, private :: warnings_are_fatal = .FALSE.
integer, private :: error_state=0

integer(LONG_KIND), parameter, private :: MPP_WAIT=-1, MPP_READY=-2
#ifdef use_libSMA
#include <mpp/shmem.fh>
integer :: sync(SHMEM_REDUCE_SYNC_SIZE+SHMEM_BCAST_SYNC_SIZE+SHMEM_BARRIER_SYNC_SIZE)
!status and remote_data_loc are used to synchronize communication is MPP_TRANSMIT
#ifdef use_shmalloc
integer(LONG_KIND), private, dimension(0:MAXPES) :: status, remote_data_loc
#else
integer(LONG_KIND), private, allocatable, dimension(:) :: status, remote_data_loc
#endif
integer, private :: mpp_from_pe !used to announce from where data is coming from
#ifdef use_shmalloc
!we call shpalloc in mpp_init() to ensure all these are remotely accessible
!on PVP where shpalloc doesn't exist, module variables are automatically
!guaranteed to be remotely accessible
pointer( ptr_sync, sync )
pointer( ptr_status, status )
pointer( ptr_from, mpp_from_pe )
pointer( ptr_remote, remote_data_loc )
#endif
#endif /* use_libSMA */
#ifdef use_libMPI
!#ifndef sgi_mipspro
!sgi_mipspro gets this from 'use mpi'
#include <mpif.h>
!#endif
!tag is never used, but must be initialized to non-negative integer
integer, private :: tag=1, stat(MPI_STATUS_SIZE)
! integer, private, allocatable :: request(:)
integer, public, allocatable :: request(:)
#ifdef _CRAYT3E
!BWA: mpif.h on t3e currently does not contain MPI_INTEGER8 datatype
!(O2k and t90 do)
!(t3e: fixed on 3.3 I believe)
integer, parameter :: MPI_INTEGER8=MPI_INTEGER
#endif
#endif /* use_libMPI */

!mpp_stack is used by SHMEM collective ops
!must be SHPALLOC'd on SGICRAY_MPP, but is allocatable on PVP
#ifdef use_shmalloc
real(DOUBLE_KIND), private :: mpp_stack(1)
pointer( ptr_stack, mpp_stack )
#else
real(DOUBLE_KIND), private, allocatable :: mpp_stack(:)
#endif
integer, private :: mpp_stack_size=0, mpp_stack_hwm=0

!peset hold communicators as SHMEM-compatible triads (start, log2(stride), num)
type, private :: communicator
character(len=32) :: name
integer, pointer :: list(:)
integer :: count
#ifdef use_libSMA
integer :: start, log2stride
#elif use_libMPI
integer :: id, group !MPI communicator and group id for this PE set
#endif
end type
integer, parameter :: PESET_MAX=32 !should be .LE. max num of MPI communicators
type(communicator) :: peset(0:PESET_MAX) !0 is a dummy used to hold single-PE
"self" communicator
integer :: peset_num=0, current_peset_num=0
integer :: world_peset_num !the world communicator

!performance profiling
! This profiles every type of MPI/SHMEM call within
! a specified region of high-level code
! Initialize or retrieve a clock with
! id = mpp_clock_id( 'Region identifier name' )
! Then set caliper points around the region using:
! call mpp_clock_begin(id)
! ...
! call mpp_clock_end(id)
! mpp_exit will print out the results.
#ifdef __sgi
#define SYSTEM_CLOCK system_clock_sgi
#endif

#ifdef use_libMPI
#define SYSTEM_CLOCK system_clock_mpi
#endif

#************************************************************************************



Regards,
Phani
That Fortran code looks newer than the style of Fortran I have written.
I have Fortran books older than I am, and I've been in Software development more than 20 years..

I have started a wiki topic on Fortran if anyone is interested they can update it..
http://www.nekochan.net/wiki/Fortran


Regan
死の神はりんごだけ食べる

開いた括弧は必ず閉じる -- あるプログラマー

:Tezro: :Tezro: :Onyx2R: :Onyx2RE: :Onyx2: :O3x04R: :O3x0: :O200: :Octane: :Octane2: :O2: :O2: :Indigo2IMP: :PI: :PI: :1600SW: :1600SW: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x Mac, 3 x SUN, Alpha DS20E, Alpha 800 5/550, 3 x RS/6000, Amiga 4000 VideoToaster, Amiga4000 -030, 733MHz Sam440 AmigaOS 4.1 update 1.

Sold: :Indy: :Indy: :Indy: :Indigo: Tandem Himalaya S-Series Nonstop S72000 ServerNet.

Twitter @PymbleSoftware
Current Apps (iOS) -> https://itunes.apple.com/au/artist/pymb ... d553990081
(Android) https://play.google.com/store/apps/deve ... +Ltd&hl=en
(Onyx2) Cortex ---> http://www.facebook.com/pages/Cortex-th ... 11?sk=info
(0300s) Minnie ---> http://www.facebook.com/pages/Minnie-th ... 02?sk=info
Github ---> https://github.com/pymblesoftware
I got it solved though the person who wrote it...but would like to post as it could be useful for someone else.

The error says as "INT_KIND" is used in a constant expression, therefore it must be a constant." which imples that INT_KIND is taking it as FOrtran 90 parameter.

It seems that it is missing some cpp preprocessing macros.

For that I have added a Flag "-cpp" but some warning came saying that
*************************************************
"../../../../src/lib/mpp_io/src/mpp_mod.F90", line 180: warning(1047): macro
redefined differently
#define SYSTEM_CLOCK system_clock_mpi
^

"../../../../src/lib/mpp_io/src/mpp_mod.F90", line 1687: warning(1047): macro
redefined differently
#define MPP_TRANSMIT_ mpp_transmit_real4
^

"../../../../src/lib/mpp_io/src/mpp_mod.F90", line 1688: warning(1047): macro
redefined differently
#define MPP_TRANSMIT_SCALAR_ mpp_transmit_real4_scalar
**********************************************

In fact we cannot neglect his warning.

So I have modified the command like by removing the flag "-cpp" and adding "-ftpp -macro_expand" and it worked without any warning, creating the requried .mod file.

Regards,
Phani