]> https://gitweb.dealii.org/ - candi.git/commitdiff
add optimization option
authorTimo Heister <timo.heister@gmail.com>
Wed, 25 Apr 2018 15:39:17 +0000 (11:39 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 8 Apr 2019 14:46:29 +0000 (08:46 -0600)
Introduce a new settings to allow native optimizations. This currently
affects PETSc and deal.II (basically setting march=native).

candi.cfg
deal.II-toolchain/packages/dealii.package
deal.II-toolchain/packages/petsc.package

index e36fdd5e2c1ba83368d13ee7f44009d06658d037..7eb20811807f8c9a56048c4586211906da0b3ea9 100644 (file)
--- a/candi.cfg
+++ b/candi.cfg
@@ -28,6 +28,9 @@ MIRROR="https://tjhei.info/candi-mirror/ https://cecas.clemson.edu/dealii/mirror
 #Choose configuration and components of deal.II
 DEAL_CONFOPTS=""
 
+# enable machine-specific optimizations (implies -march=native etc.)?
+#NATIVE_OPTIMIZATIONS=true
+
 PACKAGES="load:dealii-prepare"
 
 # These are system dependencies that are often pre-installed:
index fe42bb7adc519b9afb3dffcbfacddee5057680e4..c69b614e2d2b7b394f24a5a207a724d504cb17de 100644 (file)
@@ -26,7 +26,16 @@ CONFOPTS=" \
 -D DEAL_II_FORCE_BUNDLED_UMFPACK:BOOL=OFF \
 -D DEAL_II_WITH_BOOST:BOOL=ON \
 -D DEAL_II_FORCE_BUNDLED_BOOST:BOOL=OFF \
--D DEAL_II_WITH_ZLIB:BOOL=ON \
+-D DEAL_II_WITH_ZLIB:BOOL=ON"
+
+if [ "${NATIVE_OPTIMIZATIONS}" = "true" ]; then
+    CONFOPTS="${CONFOPTS} \
+      -D CMAKE_CXX_FLAGS='-march=native'
+    "
+fi
+
+# add the user-specified flags at the end (so things can be overriden):
+CONFOPTS="${CONFOPTS} \
 ${DEAL_CONFOPTS}"
 
 
index 0fab51f242724959bee9f525d03d86eda38a6596..0821a752bf31da3f26b8d9fa67ab487ba892ffab 100644 (file)
@@ -37,6 +37,15 @@ CONFOPTS="
   --with-64-bit-indices=0
 "
 
+if [ "${NATIVE_OPTIMIZATIONS}" = "true" ]; then
+    CONFOPTS="${CONFOPTS}
+      COPTFLAGS='-O3 -march=native -mtune=native'
+      CXXOPTFLAGS='-O3 -march=native -mtune=native'
+      FOPTFLAGS='-O3 -march=native -mtune=native'
+    "
+fi
+
+
 for external_pkg in hypre; do
     CONFOPTS="${CONFOPTS} --download-${external_pkg}=1"
 done

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.