.gitlab-ci.yml 3.71 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 7 8
  - run_giraffe_serial
  - verify_giraffe_serial
  - run_giraffe_parallel
  - verify_giraffe_parallel
Ron Rahaman's avatar
Ron Rahaman committed
9

Ron Rahaman's avatar
Ron Rahaman committed
10 11
build_libmesh_job:
  stage: build_libmesh
12 13
  variables:
    GIT_STRATEGY: clone
14
    MOOSE_JOBS: 32
Ron Rahaman's avatar
Ron Rahaman committed
15 16 17 18 19 20
  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
21 22
configure_giraffe_job:
  stage: configure_giraffe
Ron Rahaman's avatar
Ron Rahaman committed
23
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
24
    - build_libmesh_job
Ron Rahaman's avatar
Ron Rahaman committed
25 26 27 28
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
29
    MOOSE_JOBS: 32
Ron Rahaman's avatar
Ron Rahaman committed
30 31 32 33 34
  script:
    - ./bootstrap || echo
    - cd examples/integration_example/
    - ../../configure 

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

Ron Rahaman's avatar
Ron Rahaman committed
48
run_giraffe_serial_job:
49
  stage: run_giraffe_serial
Ron Rahaman's avatar
Ron Rahaman committed
50
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
51
    - build_giraffe_job
Ron Rahaman's avatar
Ron Rahaman committed
52 53 54 55 56 57
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
  script:
    - cd examples/integration_example
Ron Rahaman's avatar
Ron Rahaman committed
58
    - rm -f *sch integration_example_serial.stdout
Ron Rahaman's avatar
Ron Rahaman committed
59 60
    - ../../giraffe-opt -i coefficient_integration.i | tee integration_example_serial.stdout
    - exit $?
61

Ron Rahaman's avatar
Ron Rahaman committed
62
verify_giraffe_serial_job:
63
  stage: verify_giraffe_serial
64
  dependencies:
Ron Rahaman's avatar
Ron Rahaman committed
65
    - run_giraffe_serial_job
66 67
  variables:
    GIT_STRATEGY: none
68 69
  script: 
    - cd examples/integration_example
Ron Rahaman's avatar
Ron Rahaman committed
70 71 72 73 74 75 76 77 78 79 80
    - 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:
81
  stage: run_giraffe_parallel
Ron Rahaman's avatar
Ron Rahaman committed
82 83 84 85 86 87 88 89
  dependencies:
    - build_giraffe_job
  variables:
    GIT_STRATEGY: none
    MOOSE_DIR: "$CI_PROJECT_DIR/moose"
    LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed" 
  script:
    - cd examples/integration_example
Ron Rahaman's avatar
Ron Rahaman committed
90
    - rm -f *sch integration_example_parallel.stdout
Ron Rahaman's avatar
Ron Rahaman committed
91 92
    - mpirun -np 4 ../../giraffe-opt -i coefficient_integration.i | tee integration_example_parallel.stdout
    - exit $?
Ron Rahaman's avatar
Ron Rahaman committed
93 94

verify_giraffe_parallel_job:
95
  stage: verify_giraffe_parallel
Ron Rahaman's avatar
Ron Rahaman committed
96 97 98 99 100 101 102 103 104
  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)
105 106 107 108 109 110
    # 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