#! /bin/csh -f source /home/jsoc/.setJSOCenv set host = `echo $HOST` set SGE_ROOT = /SGE2 echo $host set start = 2012.05.05_TAI set end = 2012.07.07_TAI if ( $#argv == 1 ) then @ nproc = $argv[1] set proc = processors else @ nproc = 1 set proc = processor endif echo "Processing on $nproc $proc." set BIN = /home/jsoc/cvs/Development/JSOC/bin/linux_avx/ set QSUB = "/SGE2/bin/lx-amd64/qsub -q a.q" set SHOW_INFO = $BIN/show_info set CUTOUT = $BIN/m2meharp set DISAMBIG = $BIN/disambig_v3 set SHARP = $BIN/sharp set DRMS_RUN = $BIN/drms_run set times #@ bnum = `$SHOW_INFO -q hmi.B_720s'['$start'-'$end']' -c` #@ hnum = `$SHOW_INFO -q su_jeneen.Mharp_720s'[]['$start'-'$end'][? npix > 0 ?]' -c` #@ htnum = `$SHOW_INFO -q su_jeneen.Mharp_720s'[]['$start'-'$end'][? npix > 0 ?]' key=t_rec | sort -u | wc -l ` #@ snum = `$SHOW_INFO -q su_jeneen.sharp_720s'[]['$start'-'$end'][? npix > 0 ?]' -c` #@ diff = $hnum - $snum #@ diff2 = $htnum - $bnum #echo "$hnum $snum $bnum" #if ( $diff == 0 ) then # echo "No missing sharps for $start to $end." # exit #else # echo "$diff sharps are missing out of $hnum" # if ( $diff2 > 0 ) then # echo "$diff2 times will not be processed because of no B" #endif foreach i ( `$SHOW_INFO -q su_jeneen.Mharp_720s'[]['$start'-'$end'][? npix > 0 ?]' key=t_rec | sort -u` ) #foreach i ( `$SHOW_INFO -q hmi.B_720s'['$start'-'$end']' key=t_rec | sort -u` ) set times = ($times $i) end echo "$#times time slots" set out = missingSharps.$start'-'$end if ( -e $out ) then rm $out endif @ j = 1 while ( $j <= $#times ) set trec = $times[$j] echo "$j'/'$#times $trec" foreach harpnum ( `$SHOW_INFO -q su_jeneen.Mharp_720s'[]['$trec'][? npix > 0 ?]' key=harpnum` ) # @ count = `$SHOW_INFO -q su_jeneen.sharp_720s'['$harpnum']['$trec']' -c` # if ( $count == 0 ) then echo "$harpnum.$trec" echo "$harpnum.$trec" >> $out endif end @ j++ end echo "" sort -u -o$out $out @ nlist = `wc -l $out | awk '{print $1}'` set ncomm = `expr $nlist / $nproc` @ foo = `expr $nproc \* $ncomm` if ( $foo < $nlist ) then @ ncomm++ endif @ k = 1 @ first = 1 set tstmp = `echo $start | awk -F\_ '{print $1}'` while ( $k <= $nproc ) set CMD = /tmp28/jsocprod/sharps/SPECIAL.$tstmp.$k.cmd set LOG = /tmp28/jsocprod/sharps/SPECIAL.$tstmp.$k.log if ( -e $CMD ) then rm $CMD endif if ( -e $LOG ) then rm $LOG endif @ last = $k * $ncomm if ( $last > $nlist ) then @ last = $nlist endif echo "#! /bin/csh -f " > $CMD foreach T ( `sed -n "$first,$last p" $out` ) @ harp = `echo $T | awk -F\. '{print $1}'` set trec = `echo $T | awk -F\. '{print $2"."$3"."$4}'` echo "$SHARP mharp=su_jeneen.Mharp_720s'['$harp']['$trec']' b=hmi.B_720s'['$trec']' \\ dop=hmi.V_720s'['$trec']' cont=hmi.Ic_720s'['$trec']' \\ cont=hmi.Ic_720s'['$trec']' sharp_cea=su_jeneen.sharp_cea_720s sharp_cut=su_jeneen.sharp_720s" >>$CMD echo "" >> $CMD end echo "mv $CMD /tmp28/jsocprod/sharps/done/" >> $CMD echo "mv $LOG /tmp28/jsocprod/sharps/done/" >> $CMD chmod +x $CMD $QSUB -e $LOG -o $LOG $CMD @ first = $last + 1 @ k++ end #@ m = 1 #while ( $m <= $nproc ) # sleep 5 # set CMD = /tmp28/jsocprod/sharps/FSHP.$tstmp.$m # set DRMS_CMD = /tmp28/jsocprod/sharps/DFSHP.$tstmp.$m # set LOG = /tmp28/jsocprod/sharps/FSLOG.$tstmp.$m # echo "$DRMS_RUN $CMD >> $LOG" >> $DRMS_CMD # chmod +x $CMD $DRMS_CMD # $QSUB -e $LOG -o $LOG $DRMS_CMD # rm $DRMS_CMD # @ m++ #end rm $out