<div dir="ltr"><i>My message does not deliver to list because of the attachment, I have removed the attachment, but it was buildtemplateparallel.sh that ships with ANTs package (so you can take a look yourself):</i><div><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks Michael and Yury. You are right and there is no -n option in qsub. Maybe if we could dig deeper and find the faulty code , I will change the source code on github so others will not have my problem in future. I would also like to change condor_qsub so that it embraces -n, but I'm very suspicious that the '-n' problem might not be simply the root issue.Also it might only solve my problem (and not others in future that want to use neurodebian with condor and ants). </span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Here is the snippet from buildtemplateparallel.sh that I think is causing the problem. Please note $DOQSUB=1 will use SGE (and therefore condor_qsub in our case) and the original script is attached. </div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">'''</div><div style="font-family:arial,sans-serif;font-size:13px">
<div>if [ "$RIGID" -eq 1 ] ;</div><div> then</div><div> count=0</div><div> jobIDs=""</div><div><br></div><div> RIGID_IMAGESET=""</div><div><br></div><div> for IMG in $IMAGESETVARIABLE</div>
<div> do</div><div><br></div><div> RIGID_IMAGESET="$RIGID_IMAGESET rigid_${IMG}"</div><div><br></div><div> BASENAME=` echo ${IMG} | cut -d '.' -f 1 `</div><div><br></div><div> exe=" ${ANTSPATH}ANTS $DIM -m MI[${TEMPLATE},${IMG},1,32] -o rigid_${IMG} -i 0 --use-Histogram-Matching --number-of-affine-iterations 10000x10000x10000x10000x10000 $RIGIDTYPE"</div>
<div> exe2="${ANTSPATH}WarpImageMultiTransform $DIM ${IMG} rigid_${IMG} rigid_${BASENAME}Affine${afftype} -R ${TEMPLATE}"</div><div> pexe=" $exe >> job_${count}_metriclog.txt "</div><div>
<br></div><div> qscript="job_${count}_qsub.sh"</div><div><br></div><div> echo "$SCRIPTPREPEND" > $qscript</div><div><br></div><div> echo "$exe" >> $qscript</div><div><br>
</div><div> echo "$exe2" >> $qscript</div><div><br></div><div> <b> if [ $DOQSUB -eq 1 ] ; then</b></div><div><b><span style="white-space:pre-wrap"> </span>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}'`</b></div>
<div><b><span style="white-space:pre-wrap"> </span>jobIDs="$jobIDs $id"</b></div><div><b><span style="white-space:pre-wrap"> </span> sleep 0.5</b></div><div><span style="white-space:pre-wrap"> </span> elif [ $DOQSUB -eq 4 ]; then</div>
<div> echo "cp -R /jobtmp/pbstmp.\$PBS_JOBID/* ${currentdir}" >> $qscript;</div><div><span style="white-space:pre-wrap"> </span>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}'`</div>
<div><span style="white-space:pre-wrap"> </span>jobIDs="$jobIDs $id"</div><div><span style="white-space:pre-wrap"> </span> sleep 0.5</div><div> elif [ $DOQSUB -eq 2 ] ; then</div><div><span style="white-space:pre-wrap"> </span> # Send pexe and exe2 to same job file so that they execute in series</div>
<div><span style="white-space:pre-wrap"> </span> echo $pexe >> job${count}_r.sh</div><div><span style="white-space:pre-wrap"> </span> echo $exe2 >> job${count}_r.sh</div><div> elif [ $DOQSUB -eq 3 ] ; then</div>
<div><span style="white-space:pre-wrap"> </span>id=`xgrid $XGRIDOPTS -job submit /bin/bash $qscript | awk '{sub(/;/,"");print $3}' | tr '\n' ' ' | sed 's: *: :g'`</div><div><span style="white-space:pre-wrap"> </span>#echo "xgrid $XGRIDOPTS -job submit /bin/bash $qscript"</div>
<div><span style="white-space:pre-wrap"> </span>jobIDs="$jobIDs $id"</div><div> elif [ $DOQSUB -eq 0 ] ; then</div><div><span style="white-space:pre-wrap"> </span> # execute jobs in series</div><div><span style="white-space:pre-wrap"> </span> $exe</div>
<div><span style="white-space:pre-wrap"> </span> $exe2</div><div> fi</div><div><br></div><div> ((count++))</div><div> done</div></div><div style="font-family:arial,sans-serif;font-size:13px">'''</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">and here is the log using a few images, to make sure that the error is actually '-n'. <br>
<div><br></div><div><br></div><div><br></div><div>'''</div><div><div>--------------------------------------------------------------------------------------</div><div> No initial template exists. Creating a population average image from the inputs.</div>
<div>--------------------------------------------------------------------------------------</div><div>.</div><div>.</div><div>.</div><div>.</div><div>--------------------------------------------------------------------------------------</div>
<div> Start to build template: LonTehTemptemplate.nii.gz</div><div>--------------------------------------------------------------------------------------</div><div><br></div><div>--------------------------------------------------------------------------------------</div>
<div> Mapping parameters</div><div>--------------------------------------------------------------------------------------</div><div> ANTSPATH is /usr/bin/</div><div><br></div><div> Dimensionality: 3</div>
<div> N4BiasFieldCorrection: 1</div><div> Similarity Metric: CC</div><div> Transformation: GR</div><div> Regularization:</div><div> MaxIterations: 30x90x20</div>
<div> Number Of MultiResolution Levels: 3</div><div> OutputName prefix: LonTehTemp</div><div> Template: LonTehTemptemplate.nii.gz</div><div> Template Update Steps: 4</div>
<div> Template population: teh__000.03.nii.gz teh_manual_filled_000.03.nii.gz teh__filled_000.03.nii.gz teh_NMO_S_MOJADAM_filled_000.03.nii.gz teh_NMO_TAHEREH_filled_000.03.nii.gz</div><div>--------------------------------------------------------------------------------------</div>
<div>condor_qsub: unrecognized option '-n'</div><div>condor_qsub: unrecognized option '-n'</div><div>condor_qsub: unrecognized option '-n'</div><div>condor_qsub: unrecognized option '-n'</div>
<div>condor_qsub: unrecognized option '-n'</div><div>condor_qsub: unrecognized option '-n'</div></div></div><div><br></div><div>'''</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Jan 13, 2014 at 6:01 PM, Yury V. Zaytsev <span dir="ltr"><<a href="mailto:yury@shurup.com" target="_blank">yury@shurup.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, 2014-01-13 at 15:25 +0100, Michael Hanke wrote:<br>
><br>
> 4. Figure out what qsub -n does and try supporting it in condor_qsub<br>
><br>
> However, I have trouble figuring out what -n is supposed to do. Any<br>
> hint?<br>
<br>
</div>-N sets the name of the job, -n doesn't exist neither in SGE, nor in<br>
TORQUE, so I wonder where this comes from...<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sincerely yours,<br>
Yury V. Zaytsev<br>
<br>
<br>
</font></span></blockquote></div><br></div>