condor_qsub bash脚本中的奇怪行为

时间:2014-01-13 11:14:49

标签: bash parallel-processing jobs grid-computing condor

我正在尝试编写一个bash脚本来检查工作站中可用的网格引擎类型,并根据它开始提交作业。所有作业都是简单的bash脚本,这个bash脚本也会尝试将text.sh脚本写入本地目录,然后尝试提交这些作业。在神鹰的情况下,我很难让这个工作,并花了很多时间来解决问题,但没有成功。问题是,当我尝试这个时,我收到错误condor_qsub '-n' unrecognized option。虽然我从未向condor_qsub分配这样的选项,您可能会在下面看到。

for IMG in $IMAGESETVARIABLE
  do
#IMAGESETVARIABLE is a bunch of NIFTI images

  RIGID_IMAGESET="$RIGID_IMAGESET rigid_${IMG}"
#We can ignore this, an internal option for application 

  BASENAME=` echo ${IMG} | cut -d '.' -f 1 `
 #Defining codes to be inserted into job script file, the file that will finally submitted to grid engine

  exe=" ${ANTSPATH}ANTS $DIM -m MI[${TEMPLATE},${IMG},1,32] -o rigid_${IMG} -i 0 --use-Histogram-Matching --number-of-affine-iterations 10000x10000x10000x10000x10000 $RIGIDTYPE"
  exe2="${ANTSPATH}WarpImageMultiTransform $DIM ${IMG} rigid_${IMG} rigid_${BASENAME}Affine${afftype} -R ${TEMPLATE}"
  pexe=" $exe >> job_${count}_metriclog.txt "

  qscript="job_${count}_qsub.sh"

  echo "$SCRIPTPREPEND" > $qscript

  echo "$exe" >> $qscript

  echo "$exe2" >> $qscript

##SGE###
###$DOQSUB is an argument passed by user. It asks for the grid engine###
  if [ $DOQSUB -eq 1 ] ; then
    id=`qsub -cwd -S /bin/bash -N antsBuildTemplate_rigid -v ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1,LD_LIBRARY_PATH=$LD_LIBRARY_PATH,ANTSPATH=$ANTSPATH $QSUBOPTS $qscript | awk '{print $3}'`
    jobIDs="$jobIDs $id"
    sleep 0.5
##PBS##
elif [ $DOQSUB -eq 4 ]; then
    echo "cp -R /jobtmp/pbstmp.\$PBS_JOBID/* ${currentdir}" >> $qscript;
    id=`qsub -N antsrigid -v ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1,LD_LIBRARY_PATH=$LD_LIBRARY_PATH,ANTSPATH=$ANTSPATH $QSUBOPTS -q nopreempt -l nodes=1:ppn=1 -l walltime=4:00:00 $qscript | awk '{print $1}'`
    jobIDs="$jobIDs $id"
        sleep 0.5
##run jobs serially##
elif  [ $DOQSUB -eq 2 ] ; then
  # Send pexe and exe2 to same job file so that they execute in series
echo $pexe >> job${count}_r.sh
echo $exe2 >> job${count}_r.sh

##XGrid, Apple grid engine###

elif  [ $DOQSUB -eq 3 ] ; then
id=`xgrid $XGRIDOPTS -job submit /bin/bash $qscript | awk '{sub(/;/,"");print $3}' | tr '\n' ' ' | sed 's:  *: :g'`
#echo "xgrid $XGRIDOPTS -job submit /bin/bash $qscript"
    jobIDs="$jobIDs $id"

    #####Suspicious problematic snippet begins, submit with condor_qsub#####

elif [ $DOQSUB -eq 5 ] ; then   
id=`condor_qsub -v ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1,LD_LIBRARY_PATH=$LD_LIBRARY_PATH,ANTSPATH=$ANTSPATH $qscript | awk '{print $1}'`      
jobIDs="$jobIDs $id"
    sleep 0.5

    ####Suspicious problematic snippet ends

  elif  [ $DOQSUB -eq 0 ] ; then
  # execute jobs in series
  $exe
  $exe2
  fi

  ((count++))
done

请注意上面的代码片段只是一个大脚本的一部分,我已将问题缩小到上一节。

0 个答案:

没有答案