submit.sh 2.3 KB
Newer Older
T
tangwei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash

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

#-----------------------------------------------------------------------------------------------------------------
#fun : get argument from env, set it into variables
#param : N/A
#return : 0 -- success; not 0 -- failure
#-----------------------------------------------------------------------------------------------------------------
function vars_get_from_env() {
T
tangwei 已提交
14
  echo "xx"
T
tangwei 已提交
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
}

#-----------------------------------------------------------------------------------------------------------------
#fun : package
#param : N/A
#return : 0 -- success; not 0 -- failure
#-----------------------------------------------------------------------------------------------------------------
function package() {
  g_run_stage="package"

}

#-----------------------------------------------------------------------------------------------------------------
#fun : before hook submit to cluster
#param : N/A
#return : 0 -- success; not 0 -- failure
#-----------------------------------------------------------------------------------------------------------------
function before_submit() {
T
tangwei 已提交
33
  echo "before_submit"
T
tangwei 已提交
34 35 36 37 38 39 40 41
}

#-----------------------------------------------------------------------------------------------------------------
#fun : after hook submit to cluster
#param : N/A
#return : 0 -- success; not 0 -- failure
#-----------------------------------------------------------------------------------------------------------------
function after_submit() {
T
tangwei 已提交
42
  echo "after_submit"
T
tangwei 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55
}

#-----------------------------------------------------------------------------------------------------------------
#fun : submit to cluster
#param : N/A
#return : 0 -- success; not 0 -- failure
#-----------------------------------------------------------------------------------------------------------------
function submit() {
  g_run_stage="submit"

  before_submit

  ${g_hpc_path}/bin/qsub_f \
T
tangwei 已提交
56 57 58 59 60 61 62
    -N ${g_job_name} \
    --conf ${g_qsub_conf} \
    --hdfs ${g_hdfs_path} \
    --ugi ${g_hdfs_ugi} \
    --hout ${g_hdfs_output} \
    --files ${g_submit_package} \
    -l nodes=${g_job_nodes},walltime=1000:00:00,resource=full ${g_job_entry}
T
tangwei 已提交
63 64 65 66 67

  after_submit
}

function main() {
T
tangwei 已提交
68
  echo "run submit done"
T
tangwei 已提交
69
}