aboutsummaryrefslogtreecommitdiff
path: root/Regression/prepare_file_travis.py
diff options
context:
space:
mode:
Diffstat (limited to 'Regression/prepare_file_travis.py')
-rw-r--r--Regression/prepare_file_travis.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/Regression/prepare_file_travis.py b/Regression/prepare_file_travis.py
index 6d0e0dfc8..82b3c8e0e 100644
--- a/Regression/prepare_file_travis.py
+++ b/Regression/prepare_file_travis.py
@@ -1,22 +1,35 @@
# This script modifies `WarpX-test.ini` (which is used for nightly builds)
# and creates the file `travis-test.ini` (which is used for continous
# integration on TravisCI (https://travis-ci.org/)
-# The subtests that are selected are controlled by the environement WARPX_DIM
+# The subtests that are selected are controlled by WARPX_TEST_DIM
+# The architecture (CPU/GPU) is selected by WARPX_TEST_ARCH
import re
import os
# Get relevant environment variables
-dim = os.environ.get('WARPX_DIM', None)
+dim = os.environ.get('WARPX_TEST_DIM', None)
+arch = os.environ.get('WARPX_TEST_ARCH', 'CPU')
+
+# Find the directory in which the tests should be run
+current_dir = os.getcwd()
+test_dir = re.sub('warpx/Regression', '', current_dir )
with open('WarpX-tests.ini') as f:
text = f.read()
# Replace default folder name
-text = re.sub('/home/regtester/AMReX_RegTesting/', '/home/travis/', text)
+text = re.sub('/home/regtester/AMReX_RegTesting', test_dir, text)
# Add doComparison = 0 for each test
text = re.sub( '\[(?P<name>.*)\]\nbuildDir = ',
'[\g<name>]\ndoComparison = 0\nbuildDir = ', text )
+# Change compile options when running on GPU
+if arch == 'GPU':
+ text = re.sub( 'addToCompileString =',
+ 'addToCompileString = USE_GPU=TRUE USE_OMP=FALSE USE_ACC=TRUE', text)
+ text = re.sub( 'COMP\s*=.*', 'COMP = pgi', text )
+print('Compiling for %s' %arch)
+
# Use only 2 cores for compiling
text = re.sub( 'numMakeJobs = \d+', 'numMakeJobs = 2', text )