From 719b43e68b421ce13d653e9e2103d00a55e3d899 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Keck <jean-baptiste.keck@imag.fr> Date: Thu, 5 Oct 2017 21:14:23 +0200 Subject: [PATCH] fixed bash output errors --- .gitlab-ci.yml | 5 +---- CMakeLists.txt | 2 +- ci/scripts/build_install_clean.sh | 4 +++- ci/scripts/config.sh | 2 ++ ci/scripts/run_tests.sh | 2 ++ ci/scripts/version.sh | 3 +++ cmake/hysop_tests.cmake | 28 +--------------------------- hysop/__init__.py | 6 +++--- hysop/constants.py | 2 +- 9 files changed, 17 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 44ba6c36b..a39cfcd73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,10 +8,7 @@ stages: env:ubuntu_zesty: image: keckj/hysop:ubuntu_zesty stage: env - script: "sh ci/scripts/version.sh 2>&1 | tee /tmp/ubuntu_zesty_env" - artifacts: - paths: - - /tmp/ubuntu_zesty_env + script: "sh ci/scripts/version.sh" config:ubuntu_zesty: image: keckj/hysop:ubuntu_zesty diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c4b38fd7..2c7743cae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ option(VERBOSE "Enable verbose mode for HySoP. Default = ON" ON) option(DEBUG "Enable debug mode for HySoP. Default = OFF" OFF) option(FULL_TEST "Enable all test options (pep8, mpi ...) - Default = OFF" OFF) option(OPTIM "To allow python -OO run, some packages must be deactivated. Set this option to 'ON' to do so. Default = OFF" OFF) -option(WITH_MPI_TESTS "Enable mpi tests. Default = ON if USE_MPI is ON." ON) +option(WITH_MPI_TESTS "Enable mpi tests. Default = OFF." OFF) option(WITH_GOOGLE_TESTS "Enable google tests (c++). Default = OFF." OFF) option(FORTRAN_LAYOUT "Choose default data layout ('fortran', column-major or 'C' order, row-major) for arrays. Default = column-major." OFF) option(WITH_DOCUMENTATION "Build Documentation. Default = OFF" OFF) diff --git a/ci/scripts/build_install_clean.sh b/ci/scripts/build_install_clean.sh index a0663d04a..00f85b4ca 100644 --- a/ci/scripts/build_install_clean.sh +++ b/ci/scripts/build_install_clean.sh @@ -1,11 +1,13 @@ #!/bin/bash +set -e cd build make make install cd - python -c 'import hysop' cd build -echo $'y\n'|make uninstall +echo $'y\n' | make uninstall make clean cd - rm -rf build +exit 0 diff --git a/ci/scripts/config.sh b/ci/scripts/config.sh index fd983559c..470a35a37 100644 --- a/ci/scripts/config.sh +++ b/ci/scripts/config.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e mkdir build cd build export FC=mpif90 CC=mpicc CXX=mpic++ F77=mpif90 cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_CXX=OFF .. +exit 0 diff --git a/ci/scripts/run_tests.sh b/ci/scripts/run_tests.sh index fc5e1a792..d00b38ddb 100644 --- a/ci/scripts/run_tests.sh +++ b/ci/scripts/run_tests.sh @@ -1,7 +1,9 @@ #!/bin/bash +set -e mkdir build cd build export FC=mpif90 CC=mpicc CXX=mpic++ cmake -D CMAKE_BUILD_TYPE=Debug -DUSE_CXX=OFF .. make make test +exit 0 diff --git a/ci/scripts/version.sh b/ci/scripts/version.sh index 2e8fdc77e..6588201ce 100644 --- a/ci/scripts/version.sh +++ b/ci/scripts/version.sh @@ -1,3 +1,5 @@ +#!/bin/bash +set -e echo "HOST" uname -a echo @@ -14,3 +16,4 @@ echo echo "CL_INFO" clinfo echo +exit 0 diff --git a/cmake/hysop_tests.cmake b/cmake/hysop_tests.cmake index b32777bca..d12fbccd6 100755 --- a/cmake/hysop_tests.cmake +++ b/cmake/hysop_tests.cmake @@ -54,33 +54,7 @@ endif() # === Set the list of all directories which may contain tests === -set(py_src_dirs - core - backend - fields - domain - operator - numerics - tools - ) - -# If GPU is on, we add test_XXX.py files of hysop/gpu directory -#if(WITH_GPU) -#endif() - -# Copy the OpenCL sources files to build dir (required since only python files are copied by setup.py) -#set(clfiles) -#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/[a-z]*.cl) -#set(clfiles ${clfiles} ${clfilestmp}) -#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/kernels/[a-z]*.cl) -#set(clfiles ${clfiles} ${clfilestmp}) -#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/advection/[a-z]*.cl) -#set(clfiles ${clfiles} ${clfilestmp}) -#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/remeshing/[a-z]*.cl) -#set(clfiles ${clfiles} ${clfilestmp}) -#foreach(_F ${clfiles}) - #configure_file(${_F} ${testDir}/${_F} COPYONLY) -#endforeach() +set(py_src_dirs operator) # === Create the files list from all directories in py_src_dirs === diff --git a/hysop/__init__.py b/hysop/__init__.py index da7a5a741..d0b915762 100644 --- a/hysop/__init__.py +++ b/hysop/__init__.py @@ -16,7 +16,7 @@ __FFTW_ENABLED__ = "ON" is "ON" __SCALES_ENABLED__ = "ON" is "ON" __OPTIMIZE__ = not __debug__ -__VERBOSE__ = True +__VERBOSE__ = "ON" is "ON" __DEBUG__ = "OFF" is "ON" __PROFILE__ = "ON" is "ON" __TRACE__ = False @@ -26,8 +26,8 @@ __KERNEL_DEBUG__ = False __ENABLE_LONG_TESTS__ = "OFF" is "ON" # OpenCL -__DEFAULT_PLATFORM_ID__ = 0 -__DEFAULT_DEVICE_ID__ = 0 +__DEFAULT_PLATFORM_ID__ = 1 +__DEFAULT_DEVICE_ID__ = 1 if __MPI_ENABLED__: diff --git a/hysop/constants.py b/hysop/constants.py index f244bbf02..56eebf09d 100644 --- a/hysop/constants.py +++ b/hysop/constants.py @@ -152,7 +152,7 @@ SpaceDiscretization = EnumFactory.create('SpaceDiscretization', AutotunerFlags = EnumFactory.create('AutotunerFlags', - ['ESTIMATE', 'MEASURE', 'PATIENT', 'EXHAUSTIVE' ]) + ['ESTIMATE', 'MEASURE', 'PATIENT', 'EXHAUSTIVE']) """Configuration flags for kernel autotuner (automatic runtime parameters tuning for cuda and opencl).""" DEFAULT_AUTOTUNER_FLAG = AutotunerFlags.MEASURE -- GitLab