From 8b6d84d4c99e6fbc52806ab5db237695d799e591 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 14 Feb 2017 12:55:09 +0100
Subject: [PATCH] [Jenkins] Test OGS_USE_MPI on envinf1.

---
 scripts/env/envinf1/gui.sh         |  2 +-
 scripts/env/envinf1/mpi.sh         |  4 ++++
 scripts/jenkins/gcc-dynamic.groovy | 27 +++++++++++++++++++--------
 3 files changed, 24 insertions(+), 9 deletions(-)
 create mode 100644 scripts/env/envinf1/mpi.sh

diff --git a/scripts/env/envinf1/gui.sh b/scripts/env/envinf1/gui.sh
index 511e7fbd1ee..90138e08c8a 100644
--- a/scripts/env/envinf1/gui.sh
+++ b/scripts/env/envinf1/gui.sh
@@ -1,3 +1,3 @@
-DIR="$( cd "$( dirname $(readlink -f $0 ))" && pwd )"
+DIR=$( cd $(dirname $0) ; pwd -P )
 source $DIR/cli.sh
 module load shapelib/1.3.0_gcc_4.8.1
diff --git a/scripts/env/envinf1/mpi.sh b/scripts/env/envinf1/mpi.sh
new file mode 100644
index 00000000000..5c99bf4abe3
--- /dev/null
+++ b/scripts/env/envinf1/mpi.sh
@@ -0,0 +1,4 @@
+DIR=$( cd $(dirname "${BASH_SOURCE[0]}") ; pwd -P )
+source $DIR/cli.sh
+export CC=`which mpicc`
+export CXX=`which mpicxx`
diff --git a/scripts/jenkins/gcc-dynamic.groovy b/scripts/jenkins/gcc-dynamic.groovy
index d213d050951..7031fc7fe33 100644
--- a/scripts/jenkins/gcc-dynamic.groovy
+++ b/scripts/jenkins/gcc-dynamic.groovy
@@ -3,27 +3,38 @@ def defaultCMakeOptions =
     '-DOGS_LIB_BOOST=System ' +
     '-DOGS_LIB_VTK=System ' +
     '-DBUILD_SHARED_LIBS=ON ' +
-    '-DOGS_BUILD_UTILS=ON'
+    '-DOGS_BUILD_UTILS=ON '
 
 def configure = new ogs.configure()
 def build = new ogs.build()
 def post = new ogs.post()
 def helper = new ogs.helper()
 
-stage('Configure (Linux-Docker-Dynamic)') {
+stage('Configure (envinf1)') {
     configure.linux(cmakeOptions: defaultCMakeOptions, env: 'envinf1/cli.sh', script: this)
+    configure.linux(cmakeOptions: defaultCMakeOptions + '-DOGS_USE_MPI=ON',
+        dir: 'build-mpi', env: 'envinf1/mpi.sh', script: this)
 }
 
-stage('CLI (Linux-Docker-Dynamic)') {
-    build.linux(env: 'envinf1/cli.sh', script: this)
+stage('CLI (envinf1)') {
+    parallel serial: {
+        build.linux(env: 'envinf1/cli.sh', script: this)
+    }, mpi: {
+        build.linux(dir: 'build-mpi', env: 'envinf1/mpi.sh', script: this)
+    }
 }
 
-stage('Test (Linux-Docker-Dynamic)') {
-    build.linux(env: 'envinf1/cli.sh', script: this, target: 'tests ctest')
+stage('Test (envinf1)') {
+    parallel serial: {
+        build.linux(env: 'envinf1/cli.sh', script: this, target: 'tests ctest')
+    }, mpi: {
+        build.linux(dir: 'build-mpi', env: 'envinf1/mpi.sh', script: this,
+            target: 'tests ctest')
+    }
 }
 
-stage('Post (Linux-Docker-Dynamic)') {
-    post.publishTestReports 'build/Testing/**/*.xml', 'build/Tests/testrunner.xml',
+stage('Post (envinf1)') {
+    post.publishTestReports 'build*/Testing/**/*.xml', 'build*/Tests/testrunner.xml',
         'ogs/scripts/jenkins/clang-log-parser.rules'
     post.cleanup()
 }
-- 
GitLab