next up previous contents index
Next: Running CPMD Up: Compiling CPMD Previous: Optimizing CPMD   Contents   Index

Preprocessor Flags

Even though CPMD is (mostly) written in FORTRAN 77, which by design is fairly portable, there are some features and functionality in the code that are optional or platform dependent and thus the code is first run through the C-preprocessor before compiling. This allows to adapt the code for different environments through pre-processor directives rather than having to change parts manually or providing different files for different versions. Below is a list of several important preprocessor flags and their impact.

-DPARALLEL
enables parallel compilation (requires MPI, default is serial.).
-DMYRINET
avoids using CALL SYSTEM() for certain operations that are not available in FORTRAN (e.g. copying/renaming files, determining the process id, memory usage etc.), and use C-wrappers instead. The name is historical, as early versions of Myrinet libraries would not allow using CALL SYSTEM() and hang the machine instead; some current InfiniBand implementations have similar limitations, and machines with lightweight kernels like BG/L or Cray XT$ x$ do not implement it at all. Not using CALL SYSTEM() altogether is a good idea anyways.
-D__VECTOR
selects alternate code for vector machines (default is scalar). The main difference is in loop ordering: putting the longest loops innermost leads to better vectorization, and putting the smallest loops innermost leads to better CPU cache utilization on scalar machines. This flag also affects OpenMP parallelization strategies in some areas.
-D__GROMOS
includes support for GROMOS based QM/MM. Needs additional code and other changes to the makefile.
-DFFT_XXX
selects XXX as the FFT implementation to be used. Ex. -DFFT_DEFAULT selects the internal, platform neutral FFT, -DFFT_ESSL the corresponding functions from IBM's ESSL library. See fftmain.F for details and additional options.
-DPOINTER8
pointers are 8-byte integers, i.e. machine is 64-bit addresses. default integer is 32-byte. special case: Cray vector machines with default real and integer being 64-bit already.
-DMALLOC8
calling malloc() requires an 8-byte integer as size argument.
-D__DERF
declare DERF() and DERFC() explicitly as external functions. Needed for (older) compilers that don't provide them as intrinsics.
-DINTEL_MKL
don't compile the CPMD internal definition of ERFC(). Needed when linking with Intel MKL or other scientific libraries that also contain ERFC(). Alternatively use a linker flag like -Wl,-allow-multiple-definition.


next up previous contents index
Next: Running CPMD Up: Compiling CPMD Previous: Optimizing CPMD   Contents   Index
Costas Bekas 2008-09-04