Commit 0c5e0287 authored by Henderson, Shane's avatar Henderson, Shane
Browse files

Adds a script and runner for vm

Squash branch 'vm_runner' into 'master'

* Clarify job names

* Update job specs

* Add some workflow rules

* Fix broken test

* Add rest of truncated command

* Update .gitlab-ci.yml file

* Adds a script and runner for vm

<!-- Replace this a detailed description of changes -->

<!-- Include a link to VERA development issues if appropriate, or delete this line -->

**Developer Checklist:**
- [x] Have you done a self-review after creating the merge request?
- [x] Have you filled in the Merge Request information (title, description) thoroughly?
- [x] Have you updated the relevant tickets (if this MR is linked to any VERA-dev tickets)?
- [x] Have you addressed all suggested feedback and commented on it to let the reviewer know? (Do not resolve discussions that the reviewer started)

**Reviewer Checklist:**
- [x] Have you confirmed all discussions were adequately addressed and resolved them all?
- [x] Does it conform to formatting guidelines?
- [x] Are there adequate and clear comments?
- [x] Is the design clean and sensible?
- [x] Are the changes optimal/efficient?
- [x] Were sufficient DBC checks added?
- [x] Are there unit tests? (if necessary)
- [x] Is the MR description clear, including a link to the VERA-Dev issue if appropriate?

**PSM Checklist**
- [x] Have you confirmed that all discussions were addressed, or that follow-on issues have been created for them?
- [x] Have you confirmed sufficient testing was conducted?
- [x] Does this impact other repositories?
- [x] Does the MR have an adequate description?
- [x] If the MR has multiple commits, did you set the MR to squash merge?

See merge request https://code.ornl.gov/futility/Futility/-/merge_requests/401
parent 75ba5a18
Loading
Loading
Loading
Loading
+88 −31
Original line number Diff line number Diff line
before_script:
  - source /opt/casl-tools/gcc-8.3.0/load_dev_env.sh
  - BASE_DIR=/localhome/gitlab-runner
  - ENV_BASE=/opt/casl-tools/gcc-8.3.0
  - which gcc
  - echo $ENV_BASE
  - echo $BASE_DIR
workflow:
  rules:
    - if: $CI_MERGE_REQUEST_IID
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
      when: never
    - if: $CI_COMMIT_BRANCH
stages:
  - build

release:
build_serial_debug:
  stage: build
  tags:
    - linux
  variables:
    BLD_NAME: "gnu_release_debug"
    BLD_DIR: "/tmp/$BLD_NAME"
    - vm
  script:
    - . /data/spack/share/spack/setup-env.sh
    - spack env activate vera44
    - build_scripts/build_with_spack.sh
      -DPYTHON_EXECUTABLE=/usr/bin/python2.7
      -DCMAKE_BUILD_TYPE:STRING="DEBUG"
      -DTPL_ENABLE_MPI:BOOL=OFF
      -S $CI_PROJECT_DIR -B $CI_PROJECT_DIR/build
    - cmake --build build -j4 |& tee make.out
    - ctest --test-dir build -j4 --output-on-failure
    - (exit `grep -B 4 'Unused \(PRIVATE module \)*variable' make.out | grep 'f90' | wc -l`)
    - (exit `grep "Unused parameter" make.out | grep -vc "mpi_"`)
    - chmod -R a=u build/Testing
    - cp build/Testing/Temporary/* .

  artifacts:
    paths:
      - LastTestsFailed.log
@@ -20,24 +36,65 @@ release:
      - make.out
    expire_in: 1 week
    when: always

build_mpi_debug:
  stage: build
  tags:
    - linux
    - vm
  script:
    - TPL_DIR="${TRIBITS_DEV_ENV_COMPILER_BASE}/tpls/opt"
    - HDF5_LIBRARY_NAMES="hdf5_hl;hdf5;hdf5_cpp;hdf5_fortran"
    - HDF5_INCLUDE_DIRS="${TPL_DIR}/hdf5-1.10.1/include"
    - HDF5_LIBRARY_DIRS="${TPL_DIR}/hdf5-1.10.1/lib"
    - which gcc
    - SRC_DIR=`pwd`
    - mkdir -p $BLD_DIR
    - cd $BLD_DIR
    - rm -rf *
    - cmake -DFutility_ENABLE_DBC:BOOL=ON -DCMAKE_Fortran_COMPILER=`which gfortran` -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++` -DTPL_ENABLE_HDF5=ON -DHDF5_LIBRARY_DIRS:FILEPATH=${HDF5_LIBRARY_DIRS} -DHDF5_INCLUDE_DIRS:FILEPATH=${HDF5_INCLUDE_DIRS} -DHDF5_LIBRARY_NAMES:STRING=${HDF5_LIBRARY_NAMES} $SRC_DIR
    - make -j28 |& tee make.out
    - ctest -j28
    - (exit `grep -B 4 'Unused \(PRIVATE module \)*variable' make.out | grep 'f90' | wc -l`)
    - (exit `grep "Unused parameter" make.out | grep -vc "mpi_"`)
  after_script:
    - SRC_DIR=`pwd`
    - chmod -R a=u $BLD_DIR
    - cd $BLD_DIR
    - cp $BLD_DIR/Testing/Temporary/* $SRC_DIR/
    - cp $BLD_DIR/make.out $SRC_DIR/
    - . /data/spack/share/spack/setup-env.sh
    - spack env activate vera44
    - build_scripts/build_with_spack.sh
      -DPYTHON_EXECUTABLE=/usr/bin/python2.7
      -DCMAKE_BUILD_TYPE:STRING="DEBUG"
      -DTPL_ENABLE_MPI:BOOL=ON
      -DCMAKE_Fortran_COMPILER=`which mpif90`
      -DCMAKE_C_COMPILER=`which mpicc`
      -DCMAKE_CXX_COMPILER=`which mpicxx`
      -S $CI_PROJECT_DIR -B $CI_PROJECT_DIR/build
    - cmake --build build -j4 |& tee make.out
    - ctest --test-dir build -j4 --output-on-failure
    - chmod -R a=u build/Testing
    - cp build/Testing/Temporary/* .

  artifacts:
    paths:
      - LastTestsFailed.log
      - LastTest.log
      - CTestCostData.txt
      - make.out
    expire_in: 1 week
    when: always

build_mpi_release:
  stage: build
  tags:
    - linux
    - vm
  rules:
    - when: manual
  script:
    - . /data/spack/share/spack/setup-env.sh
    - spack env activate vera44
    - build_scripts/build_with_spack.sh
      -DPYTHON_EXECUTABLE=/usr/bin/python2.7
      -DCMAKE_BUILD_TYPE:STRING="RELEASE"
      -DTPL_ENABLE_MPI:BOOL=ON
      -DCMAKE_Fortran_COMPILER=`which mpif90`
      -DCMAKE_C_COMPILER=`which mpicc`
      -DCMAKE_CXX_COMPILER=`which mpicxx`
      -S $CI_PROJECT_DIR -B $CI_PROJECT_DIR/build
    - cmake --build build -j4 |& tee make.out
    - ctest --test-dir build -j4 --output-on-failure
    - chmod -R a=u build/Testing
    - cp build/Testing/Temporary/* .

  artifacts:
    paths:
      - LastTestsFailed.log
      - LastTest.log
      - CTestCostData.txt
      - make.out
    expire_in: 1 week
    when: always
+26 −0
Original line number Diff line number Diff line
HDF5_DIR=`spack location -i hdf5`
HDF5_LIBRARY_NAMES="hdf5;hdf5_cpp;hdf5_fortran;hdf5_hl;hdf5_hl_cpp;hdf5_hl_fortran;z"
HDF5_INCLUDE_DIRS=${HDF5_DIR}/include
HDF5_LIBRARY_DIRS=${HDF5_DIR}/lib

cmake -Wno-dev \
    -DFutility_ENABLE_TESTS:BOOL=ON                \
    -DTPL_ENABLE_HDF5=ON \
        -DHDF5_LIBRARY_DIRS:FILEPATH=${HDF5_LIBRARY_DIRS}      \
        -DHDF5_INCLUDE_DIRS:FILEPATH="${HDF5_INCLUDE_DIRS};${HDF5_INCLUDE_DIRS}/shared;${HDF5_INCLUDE_DIRS}/static"      \
        -DTPL_HDF5_INCLUDE_DIRS:FILEPATH="${HDF5_INCLUDE_DIRS};${HDF5_INCLUDE_DIRS}/shared;${HDF5_INCLUDE_DIRS}/static"      \
        -DHDF5_LIBRARY_NAMES:STRING=${HDF5_LIBRARY_NAMES}      \
    -DFutility_BUILD_STANDARD=OFF                  \
    -DTPL_ENABLE_BLAS=ON \
    -DTPL_ENABLE_LAPACK=ON \
    -DTPL_ENABLE_Boost=ON \
    -DTPL_ENABLE_Netcdf=OFF \
    -DTPL_ENABLE_X11=OFF \
    -DFutility_ASSERT_DEFINED_DEPENDENCIES=IGNORE \
    -DFutility__ENABLE_Tpetra:BOOL=ON \
    -DFutility__ENABLE_Ifpack2:BOOL=ON \
    -DFutility__ENABLE_MueLu:BOOL=ON \
    -DFutility__ENABLE_Belos:BOOL=ON \
    -DFutility__ENABLE_Anasazi:BOOL=ON \
    -DFutility__ENABLE_ForTeuchos:BOOL=ON \
     $@
+11 −11
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest01
  TEST_0
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest01/ --ext inp
  TEST_1
    CMND diff
@@ -63,7 +63,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest02
  TEST_2
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest02/ --ext .inp --output outputman
  TEST_3
    CMND diff
@@ -72,7 +72,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest03
  TEST_4
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest03/ --ext .inp --ext .f90
  TEST_5
    CMND diff
@@ -80,7 +80,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest04
  TEST_6
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest04/ --ext .inp --ext .f90 --ext .txt
  TEST_7
    CMND diff
@@ -88,7 +88,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest05
  TEST_8
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest05/ --ext .inp --ext .f90 --ext .txt --skip-no-require
  TEST_9
    CMND diff
@@ -96,7 +96,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest06
  TEST_10
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest06/ --ext .inp
  TEST_11
    CMND diff
@@ -105,7 +105,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest07
  TEST_12
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest07/ --ext .inp
  TEST_13
    CMND diff
@@ -113,7 +113,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest08
  TEST_14
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest08/ --ext .inp
  TEST_15
    CMND diff
@@ -121,7 +121,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest9
  TEST_16
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest09/ --ext .inp --ext .f90
  TEST_17
    CMND diff
@@ -129,7 +129,7 @@ TRIBITS_ADD_ADVANCED_TEST(${TESTNAME}

  #Subtest10
  TEST_18
    CMND python
    CMND ${PYTHON_EXECUTABLE}
    ARGS ${UTILPATH} --path subtest10/ --ext .inp
    PASS_REGULAR_EXPRESSION "@beginreq was found but @endreq was not found in file"
)