Platform | Compiler | Status |
---|---|---|
Linux | ifort 19.0.5.281 | Supported |
Linux | ifort 18.0.5 | Supported |
Linux | ifort 17.0.4 | Supported |
Linux | ifort 15.0.0 and similar builds | Supported
|
Linux | ifort 13.0.079 and similar builds | Supported |
Linux | ifort 12 | Supported
|
Linux | ifort 11.1.069 and similar builds | Supported |
Variable | Expected setting | Description |
---|---|---|
FC | ifort | Name of the Intel Fortran compiler |
CC | icc | Name of the Intel C compiler |
CXX | icpc | Name of the Intel C++ compiler |
NETCDF_HOME | System-dependent | Path to the root netCDF folder |
NETCDF_INCLUDE | System-dependent | Path to the netCDF include folder (e.g. $NETCDF_HOME/include) |
NETCDF_LIB | System-dependent | Path to the netCDF library folder (e.g. $NETCDF_HOME/lib or $NETCDF_HOME/lib64) |
NETCDF_FORTRAN_HOME | System-dependent | Path to the root netCDF Fortran folder |
NETCDF_FORTRAN_INCLUDE | System-dependent | Path to the netCDF Fortran include folder (e.g. $NETCDF_FORTRAN_HOME/include) |
NETCDF_FORTRAN_LIB | System-dependent | Path to the netCDF Fortran library folder (e.g. $NETCDF_FORTRAN_HOME/lib or $NETCDF_FORTRAN_HOME/lib64) |
Option | Description | How invoked in GEOS-Chem? |
---|---|---|
-O0 | Turns off all optimizations. Math expressions will be evaluated in the same order in which they are written, which is necessary for debugging. If you are using a debugger (such as Totalview), compile with -g -O0. | DEBUG=yes or OPT=-O0 |
-O1 | Enables optimizations for speed and disables some optimizations that increase code size and affect speed. The -O1 option may improve performance for applications with very large code size, many branches, and execution time not dominated by code within loops. Setting -O1 automatically sets the following options:
| OPT=-O1 |
-O2 (aka -O) | Enables optimizations for speed. This is the generally recommended optimization level. This option also enables:
On Linux and Mac OS X systems, if -g is specified, -O2 is turned off and -O0 is the default unless -O2 (or -O1 or -O3) is explicitly specified in the command line together with -g. | Default setting |
-O3 | Enables -O2 optimizations plus more aggressive optimizations, such as prefetching, scalar replacement, and loop and memory access transformations. Enables optimizations for maximum speed, such as:
On Linux and Mac OS X systems, the -O3 option sets option -fomitframe-pointer. The -O3 optimizations may not cause higher performance unless loop and memory access transformations take place. The optimizations may slow down code in some cases compared to -O2 optimizations. The -O3 option is recommended for applications that have loops that heavily use floating-point calculations and process large data sets. | OPT=-O3 |
Option | Description | How invoked in GEOS-Chem? |
---|---|---|
Normal compiler settings | ||
-cpp | Turns on the C-preprocessor, to evaluate #if and #define statements in the source code. | Default setting |
-w | Suppresses all compiler warnings. This is mainly a convenience to prevent excessive output to the screen or log file. NOTE: Most compiler warnings are harmless. Execution does not stop when a warning is displayed, unlike an error message, which causes program execution to halt at the point where the error occurred. | Default setting |
-O2 | Optimizes the source code for speed, without taking too many liberties with numerical precision. For more information, please see the optimization options section above. | Default setting |
-auto | This option places local variables (scalars and arrays of all types), except those declared as SAVE , on the run-time stack. It is as if the variables were declared with the AUTOMATIC attribute. It does not affect variables that have the SAVE attribute or ALLOCATABLE attribute, or variables that appear in an EQUIVALENCE statement or in a common block. | Default setting |
-noalign | Prevents the compiler from padding bytes anywhere in common blocks and structures. Padding can affect numerical precision. | Default setting |
-convert big_endian | Specifies that the format will be big endian for integer data and big endian IEEE floating-point for real and complex data. This only affects file I/O to/from binary files (such as binary punch files) but not ASCII, netCDF, or other file formats. | Default setting |
-vec-report0 | Tells the compiler to suppress printing 'LOOP HAS BEEN VECTORIZED' messages. This reduces the amount of output that is sent to the screen and/or GEOS-Chem log file. | Default setting |
-fp-model source | Rounds intermediate results to source-defined precision and enables value-safe optimizations. Basically, this tells the compiler not to take too many liberties with how numerical expressions are evaluated. For more information about this option, please see our precision-safe optimization section below. This option can be disabled by compiling GEOS-Chem with the PRECISE=no Makefile option. | Default setting |
-traceback | This option tells the compiler to generate extra information in the object file to provide source file traceback information when a severe error occurs at run time. When the severe error occurs, source file, routine name, and line number correlation information is displayed along with call stack hexadecimal addresses (program counter trace). This option increases the size of the executable program, but has no impact on run-time execution speeds. It functions independently of the debug option. |
|
Special compiler settings | ||
-r8 | This option tells the compiler to treat variables that are declared as REAL as REAL*8 (as opposed to REAL*4 .NOTE: This option is not used globally, but is only applied to certain indidvidual files (mostly from third-party codes like ISORROPIA. Current GEOS-Chem programming practice is to use either REAL*4 or REAL*8 instead of REAL , which avoids confusion. | Used as needed |
-mcmodel=medium | This option is used to tell IFORT to use more than 2GB of static memory. This avoids a specific type of memory error that can occur if you compile GEOS-Chem for use with an extremely high-resolution grid (e.g. 0.25° x 0.3125° nested grid). | Default setting |
-shared-intel (formerly -i-dynamic) | This option needs to be used in conjunction with -mcmodel=medium. It causes Intel-provided libraries to be linked in dynamically instead of statically (which is the default). | Default setting |
-ipo | This option enables interprocedural optimization between files. This is also called multifile interprocedural optimization (multifile IPO) or Whole Program Optimization (WPO). When you specify this option, the compiler performs inline function expansion for calls to functions defined in separate files. NOTE: Yuxuan Wang found that this option was useful for certain nested-grid simulations. See the this wiki post below for more information. | IPO=yes |
-static | This option prevents linking with shared libraries. It causes the executable to link all libraries statically. NOTE: Yuxuan Wang found that this option was useful for certain nested-grid simulations. See the this wiki post below for more information. | IPO=yes |
Settings only used for debugging | ||
-debug all | Tells the compiler turn on all debug error output. | DEBUG=yes |
-g | Tells the compiler to generate full debugging information in the object file. This will cause a debugger (like Totalview) to display the actual lines of source code, instead of hexadecimal addresses (which is gibberish to anyone except hardware engineers). | DEBUG=yes |
-O0 | Turns off all optmization. Source code instructions (e.g. DO loops, IF blocks) and numerical expressions are evaluated in precisely the order in which they are listed, without being internally rewritten by the optimizer. This is necessary for using a debugger (like Totalview). | DEBUG=yes |
-check bounds (aka -CB) | Check for array-out-of-bounds errors. This is invoked when you compile GEOS-Chem with the BOUNDS=yes Makefile option. NOTE: Only use -CB for debugging, as this option will cause GEOS-Chem to execute more slowly! | DEBUG=yes |
-check arg_temp_created | Checks to see if any array temporaries are created. Depending on how you write your subroutine and function calls, the compiler may need to create a temporary array to hold the values in the array before it passes them to the subroutine. For detailed information, please see our Passing array arguments efficiently in GEOS-Chem wiki page. | DEBUG=yes |
-fpe0 | This option will cause GEOS-Chem to halt if any type of floating-point error is encountered. This can happen if an equation results in a denormal value, e.g. NaN, or +/-Infinity. Common causes of floating-point errors are divisions where the denominator becomes zero. NOTE: The default compiler setting is -fpe3, which will convert many of these denormal values to zeros and then continue execution. | FPE=yes |
-ftrapuv | This option will assign a large numeric value to all local automatic variables. This makes it easier to identify numerical errors caused by improper initialization. | FPE=yes |
Location | Problem | Solution |
---|---|---|
Makefile_header.mk | The -openmp switch has been retired in Intel Fortran 18. The new option to turn on OpenMP parallelization is now called -qopenmp. | Now issue a command to get the compiler version. This is saved into the COMPILER_VERSION variable in Makefile_header.mk. If COMPILER_VERSION is 18 or higher, use -qopenmp to activate OpenMP. Otherwise use -openmp. |
When compiling with make -j2 MET=geosfp GRID=4x5 UCX=y CHEM=benchmark there is a problem, I can't fix. The screenshots are attached.
DIAGN_UPDATE
interface in HEMCO/Core/hco_diagn_mod.F90 to remove the OPTIONAL
array arguments. This got the code to compile with GNU Fortran. Basically, instead of having only 2 subroutines contained in the DIAGN_UPDATE
module interface, I had to have 6. The arguments Scalar
, Array2D
, Array3D
cannot be OPTIONAL
arguments in this case. This syntax used to be OK in the original Fortran-90 standard but evidently not in the newer F2003 or F2008 standards. We also had to modify a similar module interface in NcdfUtil/ncdf_mod.F90 accordingly.!$OMP PARALLEL DO
loops) are not set by the stacksize limit, but instead by the OMP_STACKSIZE environment variable. If OMP_STACKSIZE is not set with a high enough value, then your GEOS-Chem simulation may think it doesn't have enough memory to proceed, and may die with a segmentation fault error.make
which triggers the system to install Xcode (if missing) and the command line tools module (basic UNIX commands including a gcc
compiler). Be sure to set up your bash_profile, ssh config, and vimrc files to make working faster and more comfortable..bash_profile
:source /opt/intel/mkl/bin/mklvars.sh intel64
source /opt/intel/bin/compilervars.sh intel64
% which ifort
/usr/local/bin/ifort
% ifort --version
ifort (IFORT) 17.0.4 20170411
./configure -prefix=/usr/local/openmpi-2.1.1 CC=icc FC=ifort F77=ifort
make
sudo make install
.bash_profile
:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/openmpi-2.1.1/lib/
export PATH=./:/usr/local/openmpi-2.1.1/bin:$PATH
export OMP_NUM_THREADS=1
% which mpif90
/usr/local/openmpi-2.1.1/bin/mpif90
% mpif90 --version
ifort (IFORT) 17.0.4 20170411
% conda install numpy scipy h5py pyyaml matplotlib openblas
% git clone https://github.com/atztogo/phonopy.git
% export CC=gcc
% cd phonopy
% python setup.py install --user
phonopy
% git clone https://github.com/atztogo/phono3py.git
% cd phono3py
% python setup.py install --user
phono3py
cp ./arch/makefile.include.linux_intel ./makefile.include
DscaLAPACK
from the pre-compiler options and set SCALAPACK =
. There is one bug to fix before you type make
: in ./src/lib/getshmem.c
add #define SHM_NORESERVE 010000
to the end of the include statements.
% mpirun -np 4 ./vasp_std
running on 4 total cores
distrk: each k-point on 4 cores, 1 groups
distr: one band on 1 cores, 4 groups
using from now: INCAR
vasp.5.4.4
pip install --user ase gpaw
ase-gui