How can I send a batch job to PBS using a function in Shell? -


i can submit job pbs using both approaches of non-interactive batch jobs and/or interactive batch jobs. however, need use pbs commands in function. in other world need structure this:

#!/bin/sh pbs_setup () {  #pbs -l $1   #pbs -n $2  #pbs -q normal                                           #pbs -a $user                                                                                        #pbs -m ae                                                                                                #pbs -m $user"@gmail.com"                                                                          #pbs -q normal  #pbs -l nodes=1:ppn=8  #pbs }     pbs_setup "walltime=6:00:00" "step3";  echo " " echo "job started  echo " " echo "job ended  

when submitting job not working.

in fact final goal separating commands of job main body of code. when hpc changed edit shell file included function instead of editing shells. appreciate if give me suggestions.

you create custom submission command collects job options , sends them command line parameters actual qsub call.

here rather basic example of this. in real usage add more sophisticated parameter handling tailored type of jobs, , more consistent qsub interface. handling interactive jobs needs additional work.

  1. submit.sh

    #!/bin/bash walltime="${2:-06:00:00}" name="${3:-step3}" queue="normal" acct="$user" mailevents="ae" mailaddress="$user@gmail.com" resources="nodes=1:ppn=8"          if [ $# -lt  1 ] ;    echo "usage: submit.sh script [walltime [name]]" >    exit 1 fi  script="$1"  qsub -l "$walltime" -n "$name" -q "$queue" -a "$acct" \      -m "$mailevents" -m "$mailaddress" -l "$resources" "$script" 
  2. script.sh

    #!/bin/bash  echo " " echo "job started"  echo " " echo "job ended"  

this supposed used as

    submit.sh script.sh 06:00:00 step3 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -