Do you have any guides for compiling the Navy’s COAMPS mesoscale met model using PGI on a single processor Linux box?
Hi,
Unfortunately we don’t have the source. Can you point us to the source? Is it open source?
Hongyon
Hi,
The code is available to the public after registering at the following site:
http://www.nrlmry.navy.mil/coamps-web/web/home
Pete
I got it to build. I don’t know about running it, though, that seems pretty complicated. Here is what I did:
The code comes with pretty good instructions for building it with PGI compilers. They do seem a little bit out of date, though. And they are building for 32 bit architectures, using the -tp p6 flag. So, that is the first thing to look out for. I would suggest you set your path to the PGI compilers external to this build procedure.
The other thing to look out for is hardcoded paths to mpi libraries and
include files. In our 7.1 Workstation product, we ship a version of MPICH1 which I am using here. But your paths will have to change according to your setup.
I edited config.user to look like this:
to run single precision, uncomment below
PGI_SINGLE = -DSINGLE
PGI_DOUBLE = -Mr8
PGI_PRECISION = $(PGI_SINGLE)
#PGI_PRECISION = $(PGI_DOUBLE)
PGI_FFLAGSM = -fastsse $(PGI_PRECISION) -byteswapio -DPGF -DLINUX -DDTGNL
PGI_FFLAGSA = -fastsse $(PGI_PRECISION) -byteswapio -DPGF -DLINUX -DDTGNL
PGI_FFLAGS_OI = -fastsse $(PGI_PRECISION) -DPGF -DLINUX -DDTGNL
Debug settings
PGI_FFLAGSM = -g -tp p6 $(PGI_PRECISION) -byteswapio -DPGF -DLINUX
PGI_FFLAGSA = -g -tp p6 $(PGI_PRECISION) -byteswapio -DPGF -DLINUX
PGI_FFLAGS_OI = -g -tp p6 $(PGI_PRECISION) -DPGF -DLINUX
PGI_MPI_HOME =/opt/pgi/linux86-64/7.1/mpi/mpich
PGI_COMP_HOME =/opt/pgi
Note: MPI_INCLUDE_DIR is the directory where the mpif.h and mpiof.h files
reside. For MPICH this will be PGI_MPI_HOME, and for LAM this will be the
coamps3 include directory.
To switch from LAM to MPICH you need to do three things, uncomment the
appropriate lines for PGI_MPI_INCLUDE_DIR and EXTRALIBS. Also fill in the
correct values for PGI_MPI_HOME and PGI_COMP_HOME for your installation.
With MPICH, uncomment this
PGI_MPI_INCLUDE_DIR =$(PGI_MPI_HOME)/include
With LAM, uncomment and edit this:
#PGI_MPI_INCLUDE_DIR =/home/lowder/coamps3/include
linux_pgi:
${MAKE} target
“OS=linux”
“COMP_VENDOR=pgi”
“TYPE=ONE”
"FC=pgf90 "
"FFLAGSM= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) "
"FFLAGSA= $(PGI_FFLAGSA) -I$(PGI_MPI_INCLUDE_DIR) "
"FFLAGS_OI= $(PGI_FFLAGS_OI) -I$(PGI_MPI_INCLUDE_DIR) "
“FFLAGSC= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) -D_OPENMP”
"FFLAGSG= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) "
"FFLAGSO= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) "
"CC=pgcc "
“CFLAGS= -O1 -DLINUX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE”
"LD=pgf90 "
"LDFLAGSA= "
"LDFLAGS= -Bstatic "
“CPP=cpp”
“CPPFLAGS=”
"ISISLIBS= "
“AR=ar rv”
“WFCOMMA=”
“EXTRALIBS= -L$(PGI_MPI_HOME)/lib -lmpichf90 -lmpich -lacml”
Note that I have simplified the compiler names, removed some libraries that are unnecessary when using pgf90 to link, and changed the blas libraries to use acml instead.
Using these changes, it seemed to build correctly for me by typing
“make linux_pgi”