next up previous contents
Next: Running NEMO on HECToR Up: Compiling NEMO on HECToR Previous: PGI   Contents


PathScale

If address space in excess of 2 GB is required (i.e. using less than 96 processors) then we have to use the PathScale compiler. As mentioned earlier, NEMO uses the netCDF library. The version of netCDF in  sga/ and the version in the package account (under /usr/local/packages/netcdf) were both compiled using the PGI compiler. This means the object files are PGI specific and won't work with the PathScale compiler. Therefore, before compiling NEMO with PathScale we must also compile netCDF with the PathScale compiler to ensure that compatible object files are created. The options used to compile the netCDF library on HECToR were as follows:

module swap PrgEnv-pgi PrgEnv-pathscale

export CC='cc -DpgiFortran' 
export FC='ftn -cpp -DpgiFortran -fno-second-underscore'
export F90='ftn -DpgiFortran -cpp -fno-second-underscore' 
export CXX='CC -DpgiFortran'
./configure --prefix=/home/n01/n01/fionanem/netcdf/3.6.2 --disable-cxx

make
make check 
make install

The module swap PrgEnv-pgi PrgEnv-pathscale command swaps from the default (PGI) programming environment to the the PathScale programming environment. The -fno-second-underscore ensures only a single underscore is used when calling external library routines. The ./configure script must be run with the -disable-cxx option. This option prevents the C++ API from being built. If this option is not included then the link stage will fail when attempting to link the shared library libgcc_s.

To compile the NEMO model using the PathScale compiler the following flags are set in the Makefile:

EXEC_BIN = /work/n01/n01/fionanem/NEMO/ORCA025/bin/orca025k64_path
# netcdf library and includes
NCDF_INC = /home/n01/n01/fionanem/netcdf/3.6.2/include
NCDF_LIB = -L/home/n01/n01/fionanem/netcdf/3.6.2/lib -lnetcdf

P_C = ftn -Mcpp=comment 
P_O = 
M_K = gmake
F_C = ftn -c -P
F_L = ftn 
A_C = ar -r
F_O =  -O3 -r8  -I $(MODDIR) -I$(MODDIR)/oce  -I$(NCDF_INC) 
L_X =  -O3 -r8

As before, NCDF_INC and NCDF_LIB specify the paths to the netCDF library compiled using the PathScale compiler suite. The F_C flag needs the -P flag to ensure that the pre-processor removes lines containing # in the output. If these lines are not removed then the Fortran compiler attempts to compile these and the compilation will fail.


next up previous contents
Next: Running NEMO on HECToR Up: Compiling NEMO on HECToR Previous: PGI   Contents