.gitlab-ci.yml 3.52 KB
Newer Older
Ron Rahaman's avatar
Ron Rahaman committed
1
stages:
Ron Rahaman's avatar
Ron Rahaman committed
2 3 4
  - build_libmesh
  - configure_giraffe
  - build_giraffe
5 6
  - run giraffe_
  - verify_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
7 8 9 10

before_script:
  - . /opt/moose/environments/moose_profile

Ron Rahaman's avatar
Ron Rahaman committed
11 12
build_libmesh_job:
  stage: build_libmesh
Ron Rahaman's avatar
Ron Rahaman committed
13 14 15 16 17 18
  script:
    - pwd
    - git clone -b master https://github.com/idaholab/moose.git
    - cd moose 
    - scripts/update_and_rebuild_libmesh.sh

Ron Rahaman's avatar
Ron Rahaman committed
19 20
configure_giraffe_job:
  stage: configure_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
21
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
22
    - build_libmesh_job
Ron Rahaman's avatar
Ron Rahaman committed
23 24 25 26 27 28 29 30 31
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
  script:
    - ./bootstrap || echo
    - cd examples/integration_example/
    - ../../configure 

Ron Rahaman's avatar
Ron Rahaman committed
32 33
build_giraffe_job:
  stage: build_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
34
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
35
    - configure_giraffe_job
Ron Rahaman's avatar
Ron Rahaman committed
36 37 38 39 40 41 42 43
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
  script:
    - cd examples/integration_example/
    - make -j8

Ron Rahaman's avatar
Ron Rahaman committed
44
run_giraffe_serial_job:
45
  stage: run_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
46
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
47
    - build_giraffe_job
Ron Rahaman's avatar
Ron Rahaman committed
48 49 50 51 52
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
  script:
53
    - set -o pipefail
Ron Rahaman's avatar
Ron Rahaman committed
54
    - cd examples/integration_example
Ron Rahaman's avatar
Ron Rahaman committed
55
    - ../../giraffe-opt -i coefficient_integration.i | tee integration_example_serial.stdout
56 57
    - exit $?

Ron Rahaman's avatar
Ron Rahaman committed
58
verify_giraffe_serial_job:
59
  stage: verify_giraffe
60
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
61
    - run_giraffe_serial_job
Ron Rahaman's avatar
Ron Rahaman committed
62 63
  variables:
    GIT_STRATEGY: none
64 65
  script: 
    - cd examples/integration_example
Ron Rahaman's avatar
Ron Rahaman committed
66 67 68 69 70 71 72 73 74 75 76
    - grep -n "Heat balance" integration_example_serial.stdout
    - v1=$(grep "Heat balance" integration_example_serial.stdout | tail -1 | tr -s ' ' | cut -d ' ' -f 5)
    - v2=$(grep "Heat balance" integration_example_serial.stdout | tail -1 | tr -s ' ' | cut -d ' ' -f 6)
    # We want to test this statement:
    #   (0.78529 < $v1 < 0.78549) && (0.78203 < $v2 < 0.78203)
    # However, bc will return 1 if true, and we want the script to return 0 if successful
    # Hence, we test the inverse of that statement.  The inverse statement will
    # return 0 if the *desired* condition is true.  
    - echo "$v1 < 0.78529825617157133 || $v1 > 0.78549825617157133 || $v2 < 0.78203376069904283 || $v2 > 0.78223376069904283" | bc

run_giraffe_parallel_job:
77
  stage: run_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
78 79 80 81 82 83 84 85 86 87 88 89 90
  dependencies:
    - build_giraffe_job
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
  script:
    - set -o pipefail
    - cd examples/integration_example
    - mpirun -np 4 ../../giraffe-opt -i coefficient_integration.i | tee integration_example_parallel.stdout
    - exit $?

verify_giraffe_parallel_job:
91
  stage: verify_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
92 93 94 95 96 97 98 99 100
  dependencies:
    - run_giraffe_parallel_job
  variables:
    GIT_STRATEGY: none
  script: 
    - cd examples/integration_example
    - grep -n "Heat balance" integration_example_parallel.stdout
    - v1=$(grep "Heat balance" integration_example_parallel.stdout | tail -1 | tr -s ' ' | cut -d ' ' -f 5)
    - v2=$(grep "Heat balance" integration_example_parallel.stdout | tail -1 | tr -s ' ' | cut -d ' ' -f 6)
101 102 103 104 105 106
    # We want to test this statement:
    #   (0.78529 < $v1 < 0.78549) && (0.78203 < $v2 < 0.78203)
    # However, bc will return 1 if true, and we want the script to return 0 if successful
    # Hence, we test the inverse of that statement.  The inverse statement will
    # return 0 if the *desired* condition is true.  
    - echo "$v1 < 0.78529825617157133 || $v1 > 0.78549825617157133 || $v2 < 0.78203376069904283 || $v2 > 0.78223376069904283" | bc