master.sh 1.9 KB
Newer Older
T
tangwei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#!/bin/bash

###################################################
# Usage: submit.sh
# Description: run mpi submit clinet
###################################################

# ---------------------------------------------------------------------------- #
#                            variable define                                   #
# ---------------------------------------------------------------------------- #
declare g_curPath=""
declare g_scriptName=""
declare g_workPath=""
declare g_run_stage=""

# ---------------------------------------------------------------------------- #
#                             const define                                     #
# ---------------------------------------------------------------------------- #
declare -r CALL="x"
################################################################################

#-----------------------------------------------------------------------------------------------------------------
# Function: get_cur_path
# Description: get churrent path
# Parameter:
#   input:
#   N/A
#   output:
#   N/A
# Return: 0 -- success; not 0 -- failure
# Others: N/A
#-----------------------------------------------------------------------------------------------------------------
T
tangwei 已提交
33
get_cur_path() {
T
tangwei 已提交
34
  g_run_stage="get_cur_path"
T
tangwei 已提交
35 36 37 38
  cd "$(dirname "${BASH_SOURCE-$0}")"
  g_curPath="${PWD}"
  g_scriptName="$(basename "${BASH_SOURCE-$0}")"
  cd - >/dev/null
T
tangwei 已提交
39 40 41 42 43 44 45
}

#-----------------------------------------------------------------------------------------------------------------
#fun : check function return code
#param : N/A
#return : 0 -- success; not 0 -- failure
#-----------------------------------------------------------------------------------------------------------------
T
tangwei 已提交
46 47 48 49 50
function check_error() {
  if [ ${?} -ne 0 ]; then
    echo "execute " + $g_run_stage + " raise exception! please check ..."
    exit 1
  fi
T
tangwei 已提交
51
}
T
tangwei 已提交
52

T
tangwei 已提交
53
source ${engine_submit_scrpit}
T
tangwei 已提交
54

T
tangwei 已提交
55
main