1 |
#!/bin/bash |
2 |
# |
3 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_ifort+mpi2_aces,v 1.1 2009/06/23 22:54:32 jmc Exp $ |
4 |
# |
5 |
# build options used with the Intel compiler, version 8 and 9, |
6 |
# for the daily testing on ACES (which are initiated by cron jobs |
7 |
# on the "ao" head node). |
8 |
# |
9 |
# Needs the appropriate module commands, |
10 |
# and DON'T FORGET to set environment variable MPI_INC_DIR to the include |
11 |
# directory of the selected MPI implementation |
12 |
# |
13 |
#-- using default intel (v8.1) and default mpich/intel: |
14 |
# module add mpich/intel |
15 |
# module add netcdf/3.6.1/icc |
16 |
# e.g.(sh,bash): |
17 |
# export MPI_INC_DIR='/usr/local/pkg/mpich/mpich-intel/include/' |
18 |
# (and run using mpirun -machinefile my_list_of_nodes) |
19 |
# |
20 |
#-- using intel v9.0 and mpich2-intel, in this order: |
21 |
# module add ifc/9.0.021 icc/9.0.021 intel/9.0 |
22 |
# module add mpich2/1.0.3/intel |
23 |
# module add netcdf/3.6.1/icc |
24 |
# module add mpiexec (<-- to run with mpiexec) |
25 |
# e.g.(sh,bash): |
26 |
# export MPI_INC_DIR='/usr/local/pkg/mpich2/mpich2-1.0.3/intel/include/' |
27 |
# (and run using mpiexec) |
28 |
# |
29 |
#-- Multi-Threading with OpenMP: |
30 |
# -several problems with earlier version of ifort (including some version 8) |
31 |
# -with version 9 and more recent one: |
32 |
# 1) compile with genmake2 -omp option ; |
33 |
# 2) needs to set environment variable OMP_NUM_THREADS, and generally, |
34 |
# needs also to increase the thread stack-size: |
35 |
# (sh, bash) > export OMP_NUM_THREADS=2 |
36 |
# > export KMP_STACKSIZE=400m |
37 |
# (csh,tcsh) > setenv OMP_NUM_THREADS 2 |
38 |
# > setenv KMP_STACKSIZE 400m |
39 |
# NOTE: set KMP_STACKSIZE in .bashrc/.profile/.cshrc/.tcshrc is the easiest |
40 |
# way (I found) to set it for all proc; not an issue (?) for OMP_NUM_THREADS |
41 |
|
42 |
# Notes: the PBS -V option for exporting environment variables does not work |
43 |
# => need to set all env var on compute nodes |
44 |
|
45 |
FC='mpif77' |
46 |
CC='mpicc' |
47 |
F90C='mpif90 -fixed -c ' |
48 |
LINK='mpif77' |
49 |
|
50 |
#-- for NetCDF: |
51 |
INCLUDES="-I$NETCDF_INCDIR" |
52 |
INCLUDEDIRS=$NETCDF_INCDIR |
53 |
LIBS="-L$NETCDF_LIBDIR" |
54 |
|
55 |
#- for MPI: |
56 |
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
57 |
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
58 |
MPIINCLUDEDIR="$MPI_INC_DIR" |
59 |
MPI_HEADER_FILES='mpif.h mpiof.h' |
60 |
MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |
61 |
|
62 |
DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4' |
63 |
CPP='cpp -traditional -P' |
64 |
EXTENDED_SRC_FLAG='-132' |
65 |
OMPFLAG='-openmp' |
66 |
|
67 |
NOOPTFLAGS='-O0' |
68 |
NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F' |
69 |
|
70 |
# Note that the -mp switch is for ieee "maintain precision" and is |
71 |
# roughly equivalent to -ieee |
72 |
if test "x$IEEE" = x ; then |
73 |
FOPTIM='-O3 -align' |
74 |
#P3 FOPTIM=$FOPTIM' -tpp6 -xWKM' |
75 |
#P4 FOPTIM=$FOPTIM' -tpp7 -xWKM' |
76 |
FFLAGS='-r8 -i4 -w95 -W0 -WB -assume byterecl -convert big_endian' |
77 |
else |
78 |
# FOPTIM='-O0 -noalign -CA -CB -CU -CV -CS' |
79 |
FOPTIM='-O0 -noalign -CB -CU -CV' |
80 |
FFLAGS='-r8 -i4 -w95 -W0 -WB -pc64 -xW -assume byterecl -convert big_endian' |
81 |
# FLAGS='-mp -r8 -i4 -w95 -W0 -WB -assume byterecl -convert big_endian' |
82 |
fi |
83 |
F90FLAGS=$FFLAGS |
84 |
F90OPTIM=$FOPTIM |
85 |
|
86 |
NOOPTFILES=$NOOPTFILES' mitcplr_char2real.F mitcplr_real2char.F' |
87 |
NOOPTFILES=$NOOPTFILES' mitcplr_char2int.F mitcplr_int2char.F mds_byteswap.F' |