1 |
mlosch |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
mlosch |
1.2 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia64_cray_cca,v 1.1 2015/01/27 17:02:30 mlosch Exp $ |
4 |
mlosch |
1.1 |
# $Name: $ |
5 |
|
|
|
6 |
|
|
# Tested on cca at ecmwf.int: |
7 |
|
|
# http://www.ecmwf.int/en/computing/our-facilities/supercomputer |
8 |
|
|
# |
9 |
|
|
# this requires that the PrgEnv is "cray", i.e. one needs to |
10 |
|
|
# switch out of the current PrgEnv like this: |
11 |
|
|
# module load PrgEnv-cray |
12 |
|
|
# or if something else is loaded |
13 |
|
|
# module switch PrgEnv-???? PrgEnv-cray |
14 |
|
|
# after switching the programming environment, the netcdf model needs |
15 |
|
|
# to be loaded (and unloaded if it was loaded before) |
16 |
|
|
# module unload netcdf |
17 |
|
|
# module load netcdf |
18 |
|
|
# after "module load netcdf" NETCDF_DIR should be available |
19 |
|
|
# NETCDF_ROOT = $NETCDF_DIR |
20 |
|
|
# notes on useful MPI flags (to be set at runtime): |
21 |
|
|
# export MPICH_COLL_SYNC=1 |
22 |
|
|
# Adds a barrier before collectives, use this if CrayPAT makes your code |
23 |
|
|
# run faster. |
24 |
|
|
# export MPICH_CPUMASK_DISPLAY=1 |
25 |
|
|
# Shows the binding of each MPI rank by core and hostname |
26 |
|
|
# export MPICH_ENV_DISPLAY=1 |
27 |
|
|
# Print to stderr the value of all MPI environment variables at runtime. |
28 |
|
|
# export MPICH_MPIIO_STATS=1 |
29 |
|
|
# Prints some MPI-IO stats to stderr that can be useful for optimisation |
30 |
|
|
# export MPICH_RANK_REORDER_DISPLAY=1 |
31 |
|
|
# Prints the node that each rank is residing on, useful for checking |
32 |
|
|
# MPICH_RANK_REORDER_METHOD results. |
33 |
|
|
# export MPICH_VERSION_DISPLAY=1 |
34 |
|
|
# Display library version and build information. |
35 |
|
|
|
36 |
|
|
FC=ftn |
37 |
|
|
F90C=ftn |
38 |
|
|
CC=cc |
39 |
|
|
# requires that all static libraries are available: |
40 |
|
|
#LINK='ftn -static' |
41 |
|
|
LINK='ftn -h byteswapio' |
42 |
|
|
# for adjoint runs the default makedepend often cannot handle enough files |
43 |
|
|
#MAKEDEPEND=tools_xmakedepend |
44 |
|
|
|
45 |
|
|
DEFINES='-DWORDLENGTH=4' |
46 |
|
|
CPP='cpp -traditional -P' |
47 |
|
|
#F90FIXEDFORMAT='-fixed -Tf' |
48 |
|
|
#EXTENDED_SRC_FLAG='' |
49 |
|
|
#OMPFLAG='' |
50 |
|
|
|
51 |
|
|
NOOPTFLAGS="-O0" |
52 |
|
|
# reduce floating point reordering |
53 |
|
|
#NOOPTFLAGS="-O0 -hfp1" |
54 |
|
|
NOOPTFILES='' |
55 |
|
|
|
56 |
|
|
FFLAGS="$FFLAGS" |
57 |
|
|
#- might want to use '-r8' for fizhi pkg: |
58 |
|
|
#FFLAGS="$FFLAGS -r8" ??? |
59 |
|
|
|
60 |
|
|
if test "x$IEEE" = x ; then #- with optimisation: |
61 |
mlosch |
1.2 |
# this is the default |
62 |
|
|
# FOPTIM='-O2' |
63 |
|
|
# more aggressive (and recommended in some only document) |
64 |
|
|
FOPTIM='-O3 -hfp3' |
65 |
mlosch |
1.1 |
else |
66 |
|
|
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
67 |
|
|
FOPTIM='-O0 -hfp0' |
68 |
|
|
# -fltconsistency |
69 |
|
|
else #- development/check options: |
70 |
|
|
FOPTIM='-O0 -hfp0' |
71 |
|
|
FOPTIM="$FOPTIM -g -hfp0 -Rbc -rm -hmsgs -hnegmsgs" |
72 |
|
|
fi |
73 |
|
|
fi |
74 |
|
|
|
75 |
|
|
F90FLAGS=$FFLAGS |
76 |
|
|
F90OPTIM=$FOPTIM |
77 |
|
|
CFLAGS="-O0 $MCMODEL" |
78 |
|
|
|
79 |
|
|
INCLUDEDIRS='' |
80 |
|
|
INCLUDES='' |
81 |
|
|
LIBS='' |
82 |
|
|
|
83 |
|
|
# after "module load netcdf" NETCDF_DIR should be available |
84 |
|
|
NETCDF_ROOT=$NETCDF_DIR |
85 |
|
|
INCLUDEDIRS="${NETCDF_ROOT}/include" |
86 |
|
|
INCLUDES="-I${NETCDF_ROOT}/include" |
87 |
|
|
LIBS="-L${NETCDF_ROOT}/lib" |
88 |
|
|
|
89 |
|
|
MPI_INC_DIR=$MPICH_DIR/include |
90 |
|
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
91 |
|
|
LIBS="$LIBS -lmpich" |
92 |
|
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
93 |
|
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
94 |
|
|
#- used for parallel (MPI) DIVA |
95 |
|
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
96 |
|
|
#MPI_HEADER_FILES='mpif.h mpiof.h' |
97 |
|
|
fi |
98 |
|
|
|