#!/bin/csh -f set useremote = 1 # using remote shell to launch processes set mpiremote = 1 # using remote shell to launch mpi set remote = ssh set name = $0 set bin = $name:h #default directory for WIEN-executables if (-e $bin/parallel_options) then source $bin/parallel_options endif if ( $?USE_REMOTE ) then set useremote = $USE_REMOTE endif if ( $?MPI_REMOTE ) then set mpiremote = $MPI_REMOTE endif if ( $?WIEN_MPIRUN ) then set mpirun = "$WIEN_MPIRUN" else set mpirun='mpirun -np _NP_ _EXEC_' endif if ( ! $?CORES_PER_NODE ) then setenv CORES_PER_NODE 1 endif if (( ! $?PINNING_COMMAND ) || ( ! $?PINNING_LIST )) setenv NOPINNING if ( ! $?OMP_NUM_THREADS ) then setenv OMP_NUM_THREADS 1 endif @ CPN = $CORES_PER_NODE / $OMP_NUM_THREADS if( "$CPN" == "0" ) set CPN=1 set nmrdir = $0:h set nmrbin = $nmrdir set fbz = '' set q = "-q 0.005" set ietest = 1000000 set scissor = '' set emin = '' set emax = '' set broad = '' set iemin = '' set iemax = '' set cmplx = '' set cmplxe = '' set nocore = '' set nocc = '' set noco = '-noco' set noduc = '' set socop = '' set dosoc = 0 set rmcore = '' set coreonly = '' set onlyspheres = '' set xiop = '' set dopara = 0 set para = '' set debug = '' set savedir = '' set orbop = '' set orbopso = '' set spinop = '' set spin = '' set ovlpmax = '-ovlpmax 0.4' set dosp = 0 set doorb = 0 set dohf = 0 set hfop = '' set nmrhf = '' set diaghf = '' set redklist = '' set newklist = 0 set modehf = '-mode1' set green = '-green' set writehs = '' set scratch = '' set filter = '' set noexec = 0 set rundir = . set esemicore = '' set scratchdir = ./ set atomin1 = 0 set nodesin1='-nodes 8' set focusin1='' set metal='' set kbT='' set fermi='' set quota = 0 set quotaop = '' set restart = '' set dorestart = 0 unset setscratch unset mode unset initonly unset noinit set hfdir = 0 unset doxionly set dokgen unset clean unset help unset lom10 # JH set lom10_flag # JH alias teststatus 'if ($status) goto error' alias IPRINT_inc 'sed "s/0 NUMBER/1 NUMBER/g" \!:1 > .case.inc;'\ 'mv .case.inc \!:1' alias IPRINT_inso 'sed "3s/........../10. 9999. /" \!:1 > .case.inso;'\ 'mv .case.inso \!:1' set logfile = :log echo "> ($name) options: $argv" >> $logfile set argv1=($argv) while ($#argv) switch ($1) case -lom10: #JH set lom10; set lom10_flag="-lom10" # JH shift; breaksw #JH case -scratch: shift; set scratchdir = ${1} set setscratch set ncar=`echo $scratchdir |wc -m` @ ncar -- set lcar=`echo $scratchdir | cut -c$ncar` if("$lcar" != '/' ) set scratchdir=`echo "${scratchdir}/"` set scratch = "-scratch ${scratchdir}" shift; breaksw case -case: shift; set case = $1 shift; breaksw case -save: shift; set savedir = $1 set mode = save shift; breaksw case -mode: shift; set mode = $1 if ($mode == 'lapwso') then set dosoc=1 endif if ($mode == 'hf') then set dohf = 1 set hfop = '-hf' set nmrhf = '-nmrhf' endif shift; breaksw case -nodes: shift; set nodesin1 = "-nodes $1" shift; breaksw case -focus: shift; set focusin1 = "-focus $1" shift; breaksw case -hf: set dohf = 1 set hfop = '-hf' set nmrhf = '-nmrhf' shift; breaksw case -hfdir: shift; set rundir = $1 set hfdir = 1 shift; breaksw case -quota: set quota = 1 shift; set quotaop = "-quota $1" shift; breaksw case -c: set cmplx = '-c' set cmplxe = 'c' shift; breaksw case -q: shift; set q = "-q $1" shift; breaksw case -ietest: shift; set ietest = $1 shift; breaksw case -scissor: shift; set scissor = "-scissor $1" shift; breaksw case -esemicore: shift; set esemicore = "-esemicore $1" shift; breaksw case -emin: shift; set emin = "-emin $1" set nocore = '-nocore' shift; breaksw case -emax: shift; set emax = "-emax $1" shift; breaksw case -iemin: shift; set iemin = "-iemin $1" set nocore = '-nocore' shift; breaksw case -iemax: shift; set iemax = "-iemax $1" shift; breaksw case -broad: shift; set broad = "-broad $1" shift; breaksw case -ovlpmax: shift; set ovlpmax = "-ovlpmax $1" shift; breaksw case -filt_cxyz_o: shift; set filter = "$filter -filt_cxyz_o $1 $2" shift; shift; breaksw case -filt_cxyz_q: shift; set filter = "$filter -filt_cxyz_q $1 $2" shift; shift; breaksw case -filt_curr_o: shift; set filter = "$filter -filt_curr_o $1 $2" shift; shift; breaksw case -filt_curr_fop: shift; set filter = "$filter -filt_curr_fop $1 $2" shift; shift; breaksw case -nocore: set nocore = '-nocore' shift; breaksw case -nocc: set nocc = '-nocc' shift; breaksw case -noco: set noco = '-noco' shift; breaksw case -doco: set noco = '' shift; breaksw case -noduc: set noduc = '-noduc' shift; breaksw case -metal: set metal = '-metal' shift; breaksw case -kbT: shift; set kbT = "-kbT $1" shift; breaksw case -fermi: shift; set fermi = "-fermi $1" shift; breaksw case -fbz: set fbz = '-fbz' shift; breaksw case -so: set socop = '-so' set dosoc = 1 shift; breaksw case -rmcore: set rmcore = '-rmcore' shift; breaksw case -coreonly: set coreonly = '-coreonly' shift; breaksw case -onlyspheres: set onlyspheres = '-onlyspheres' shift; breaksw case -orb: set orbop = '-orb' set spinop = '-up' set spinop2 = '-dn' set spin = 'up' set spin2 = 'dn' set dosp = 1 set doorb = 1 shift; breaksw case -up: set spinop = '-up' set spinop2 = '-dn' set spin = 'up' set spin2 = 'dn' set dosp = 1 shift; breaksw case -dn: set spinop = '-dn' set spinop2 = '-up' set spin = 'dn' set spin2 = 'up' set dosp = 1 shift; breaksw case -xionly: set xiop = '-xionly' set doxionly shift; breaksw case -diaghf: set diaghf = '-diaghf' shift; breaksw case -redklist: set redklist = '-redklist' shift; breaksw case -newklist: set newklist = 1 shift; breaksw case -mode1: set modehf = '-mode1' shift; breaksw case -mode2: set modehf = '-mode2' shift; breaksw case -mode3: set modehf = '-mode3' shift; breaksw case -nokgen: unset dokgen shift; breaksw case -noxi: set xiop = '-noxi' shift; breaksw case -p: if ((-e .machines) && !(-z .machines)) then set dopara = 1 set para = '-p' else echo "Required file .machines not found. Switching to sequential mode." endif shift; breaksw case -green: set green = '-green' set writehs = '' shift; breaksw case -leq: set green = '-leq' set writehs = '-writehs' shift; breaksw case -noinit: set noinit = 1 shift; breaksw case -initonly: set initonly = 1 shift; breaksw case -noexec: set noexec = 1 shift; breaksw case -debug: set debug = '-debug' shift; breaksw case -clean: set clean shift; breaksw case -restart: set restart = '-restart' set dorestart = 1 shift; breaksw case -[h|H]: set help shift; breaksw default: set optiontest = `echo $1|cut -c1` if ( "$optiontest" == '-' ) then echo "error in your arguments: $1 is not a valid option" exit(3) endif set command = $1 shift; breaksw endsw end if ($?help) goto help if !($?case) then set case = `pwd` set case = $case:t endif if ($cmplxe == '') then set cmplxe=`cut -b -6 $case.struct |awk 'BEGIN{c="c"};{if ($0 == "-1 0 0") {getline; {if ($0 == " 0-1 0"){getline; {if ($0 == " 0 0-1"){c= ""}}}}}};END{print c}'` endif if($cmplxe == 'c') then set cmplx = '-c' endif if ($?clean) goto clean if !($?setscratch) then if ( $?SCRATCH ) then set scratchdir=`echo $SCRATCH | sed -e 's/\/$//'`/ set scratch="-scratch ${scratchdir}" endif endif if ($?setscratch) setenv SCRATCH ${scratchdir} if !($?mode) then set next = klist if ($?noinit) then set next = current endif if ($dorestart) then set next = current endif else if ($mode == 'init') then unset mode set initonly set next = klist goto $next else if ($mode == 'xionly') then set next = current else set next = $mode endif endif if ($hfdir) then set initonly set next = klist set dohf = 1 set hfop = '-hf' set nmrhf = '-nmrhf' unset mode echo $rundir echo endif set orbop2 = $orbop if ($dosoc) then if ($doorb) then set orbopso = '-orb' set orbop='' endif endif set cmplxenmr = $cmplxe if ($dosoc) then set cmplxenmr = 'c' endif goto $next clean: foreach i (q0 pqx mqx pqy mqy pqz mqz testvec) rm -rf nmr_$i end rm -f ${case}.qvec_* ${case}.current_spheres_?_* ${case}.current_int_?_* ${case}.xim_* ${case}.outputnmr_current_* ${case}.restartnmr* printf "\n cleaning .... done \n" goto koniec testval: mv $case.klist $case.klist_nmrsave mv $case.kgen $case.kgen_nmrsave x kgen -fbz <& /dev/null if ($dosp) then x lapw1 $cmplx $para -nmr $orbop $spinop2 $writehs $scratch -d >& /dev/null endif foreach k ( $i.klist_* ) cp $k ${k}_all end cp ../$case.klist $i.klist_all cp ../$case.scf2$spin $i.scf2$spin if ($dosp) then cp ../$case.scf2$spin2 $i.scf2$spin2 endif endif cd ../ endif end printf "\n lapw1 .... done\n\n" if ($?mode) goto koniec hf: if ($dohf) then foreach j (q0 pqx mqx pqy mqy pqz mqz) if (!($hfdir) || ($j == $rundir) ) then set i=nmr_$j if (!(-e $case.corewf$spin) || (-z $case.corewf$spin)) then printf "cd ./ ... x lcore $spinop -f $case \n" x lcore $spinop if ($dosp) then printf "cd ./ ... x lcore $spinop2 -f $case \n" x lcore $spinop2 endif endif cp $case.inhf $i/$i.inhf cp $case.in0 $i/$i.in0 cp $case.clmsum $i/$i.clmsum if (($spin == '') || ($spin == 'up')) then cp $case.clmup $i/$i.clmup cp $case.r2v_grr $i/$i.r2v_grr else cp $case.clmdn $i/$i.clmdn cp $case.r2v_grrdn $i/$i.r2v_grrdn endif cp $case.in1${cmplxe}_nmr $i/$i.in1${cmplxe}_nmr cp $case.vectorhf$spin $i/$i.vectorhf${spin}_old cp $case.klist_ibz_all $i/$i.klist_ibz_all cp $case.klist_fbz $i/$i.klist_fbz cp $case.klist_ibz $i/$i.klist_ibz cp $case.outputkgenhf $i/$i.outputkgenhf cp $case.clmcor$spin $i/$i.clmcor$spin cp $case.struct $i/$i.struct cp $case.inc $i/$i.inc cp $case.corewf$spin $i/$i.corewf$spin cp $case.vsp$spin $i/$i.vsp$spin cp $case.vsp$spin $i/$i.vsp${spin}_old cp $case.weighthf$spin $i/$i.weighthf$spin cp $case.klist_fbz $i/$i.klist_fbz_old cp $case.klist_ibz $i/$i.klist_ibz_old cp $case.outputkgenhf $i/$i.outputkgenhf_old if ("$redklist" == "-redklist") then cp $case.klist_rfbz $i/$i.klist_rfbz cp $case.klist_rfbz $i/$i.klist_rfbz_old cp $case.klist_ribz $i/$i.klist_ribz cp $case.klist_ribz $i/$i.klist_ribz_old cp $case.weighthf${spin}_rbz $i/$i.weighthf${spin}_rbz endif if ($newklist) then cp $case.klist_fbz_old $i/$i.klist_fbz_old cp $case.klist_ibz_old $i/$i.klist_ibz_old cp $case.outputkgenhf_old $i/$i.outputkgenhf_old if ("$redklist" == "-redklist") then cp $case.klist_rfbz_old $i/$i.klist_rfbz_old cp $case.klist_ribz_old $i/$i.klist_ribz_old endif endif if ($dosp) then cp $case.clm$spin2 $i/$i.clm$spin2 if (($spin2 == '') || ($spin2 == 'up')) then cp $case.r2v_grr $i/$i.r2v_grr else cp $case.r2v_grrdn $i/$i.r2v_grrdn endif cp $case.vectorhf$spin2 $i/$i.vectorhf${spin2}_old cp $case.clmcor$spin2 $i/$i.clmcor$spin2 cp $case.corewf$spin2 $i/$i.corewf$spin2 cp $case.vsp$spin2 $i/$i.vsp$spin2 cp $case.vsp$spin2 $i/$i.vsp${spin2}_old cp $case.weighthf$spin2 $i/$i.weighthf$spin2 if ("$redklist" == "-redklist") then cp $case.weighthf${spin2}_rbz $i/$i.weighthf${spin2}_rbz endif endif if !($noexec) then printf "cd ./$i ... x hf $cmplx $diaghf $modehf -newklist $redklist $nmrhf $para $spinop $scratch \n" cd $i x hf $cmplx $diaghf $modehf -newklist $redklist $nmrhf $para $spinop $scratch if ($dosp) then printf "cd ./$i ... x hf $cmplx $diaghf $modehf -newklist $redklist $nmrhf $para $spinop2 $scratch \n" x hf $cmplx $diaghf $modehf -newklist $redklist $nmrhf $para $spinop2 $scratch endif teststatus cd ../ endif endif end printf "\n hf .... done\n\n" endif if ($?mode) goto koniec lapwso: if ($dosoc) then if( $case.in1${cmplxe}_nmr != $case.in1c_nmr ) cp $case.in1${cmplxe}_nmr $case.in1c_nmr foreach j (q0 pqx mqx pqy mqy pqz mqz) set i=nmr_$j printf "cd ./$i ... x lapwso $para $spinop $orbopso $scratch \n" cp $case.inso $i/$i.inso cd $i IPRINT_inso $i.inso if (!($quota)) then x lapwso $cmplx $para $orbopso $spinop $scratch teststatus else x lapwso $cmplx $para $orbopso $spinop $scratch -d endif cd ../ end printf "\nlapwso .... ready\n\n" endif if ($?mode) goto koniec lapw2: foreach j (q0 pqx mqx pqy mqy pqz mqz) if (!($hfdir) || ($j == $rundir) ) then set i=nmr_$j cp $case.kgen ${i}/$i.kgen cp $case.in2$cmplxe $i/$i.in2$cmplxe if ($dosoc) then cp $case.in2$cmplxe $i/$i.in2c endif cp $case.inm ${i}/$i.inm cd $i if (!($quota)) then printf "cd ./$i ... x lapw2 $cmplx -fermi $para $spinop $hfop $nmrhf $socop $scratch \n" x lapw2 $cmplx -fermi $para $spinop $hfop $nmrhf $socop $scratch teststatus if ($dosp) then printf "cd ./$i ... x lapw2 $cmplx -fermi $para $spinop2 $hfop $nmrhf $socop $scratch \n" x lapw2 $cmplx -fermi $para $spinop2 $hfop $nmrhf $socop $scratch teststatus endif endif cd ../ endif end printf "\nlapw2 .... ready\n\n" if ($?mode) goto koniec lcore: printf "cd ./ ... x lcore $cmplx -f $case $spinop \n" IPRINT_inc $case.inc x lcore $spinop if ($dosp) then x lcore $spinop2 endif teststatus printf "\nlcore .... ready\n\n" if ($?mode) goto koniec if ($?initonly) goto koniec current: if ($dorestart) then if ( $dopara ) then cp .machines nmr_q0/ endif cd nmr_q0 x lapw1 $cmplx $para -nmr $orbop $spinop $writehs $scratch -d >& /dev/null cp .machine* ../nmr_pqx/ cp .machine* ../nmr_mqx/ cp .machine* ../nmr_pqy/ cp .machine* ../nmr_mqy/ cp .machine* ../nmr_pqz/ cp .machine* ../nmr_mqz/ cd .. endif set param = "-case $case -mode current $coreonly $debug $xiop $green $scissor $spinop $onlyspheres $emin $emax $iemin $iemax $nocore $scratch $filter $hfop $esemicore $nocc $noduc $noco $broad $socop $fbz $metal $kbT $fermi $quotaop $restart" set exec = "$nmrbin/nmr$cmplxenmr $param" set execmpi = "$nmrbin/nmr${cmplxenmr}_mpi $param" set execlapw1="$WIENROOT/lapw1${cmplxenmr}" set execlapwso="$WIENROOT/lapwso" if !( $dopara ) then printf "\n EXECUTING: $exec\n\n" $exec teststatus else printf "\n EXECUTING: $execmpi\n\n" set mist = `grep -v init nmr_q0/.processes | grep : | grep -v residue | wc` set maxproc = $mist[1] set machine = `grep -v init nmr_q0/.processes | grep -v residue | cut -f2 -d: | xargs` set mpinproc = `grep -v init nmr_q0/.processes | grep -v residue | cut -f4 -d: | xargs` set mpiid = `grep -v init nmr_q0/.processes | grep -v residue | cut -f5 -d: | xargs` set loop = 0 if( ! $?NOPINNING ) then set corelist = ($PINNING_LIST) set corelist0=($corelist) set j=1 set total_jobs = 0 set number_of_p_jobs=$maxproc while($j <= $number_of_p_jobs) @ total_jobs = $total_jobs + $mpinproc[$p] # $number_per_job[$j] @ j ++ end @ total_nodes = $number_of_p_jobs * $total_jobs * $OMP_NUM_THREADS / $CORES_PER_NODE set i=1 while($i <= $total_nodes) set corelist = ($corelist,$corelist0) @ i ++ end endif while ($loop < $maxproc) set p = 1 while ($p <= $#machine) if ($loop < $maxproc) then @ loop ++ set dir = `pwd` rm -f nmr.err.$loop echo machine: $machine[$p] > nmr.out.${loop} echo dir: $dir >> nmr.out.${loop} sleep 0.1 if ( $mpinproc[$p] > 1 ) then set mpip = $mpiid[$p] if ($quota) then ### srun-implmentation, RUH Nov 16th 2015 set number_of_nodes=`sort nmr_q0/.machine$loop | uniq -c | wc -l` set offset=$mpinproc[$p] # $number_per_job[$p] set offset_tmp=0 @ offset = $offset / $CPN @ offset_tmp=$offset * $CPN if($offset_tmp == $mpinproc[$p] ) then @ offset=$offset * ($loop - 1) else set offset=$mpinproc[$p] @ offset=($offset * ($loop - 1)) / $CPN endif ### end of srun-implentation foreach j (q0 pqx mqx pqy mqy pqz mqz) set i=nmr_$j set ttt_temp=(`echo $mpirun | sed -e "s^_NP_^$mpinproc[$p]^" -e "s^_EXEC_^${execlapw1}_mpi ${spin}lapw1_${loop}.def^" -e "s^_HOSTS_^.machine$mpip^" -e "s^_nodes_^$number_of_nodes^" -e "s^_offset_^$offset^"`) if( $?NOPINNING ) then set ttt=(`echo $ttt_temp | sed -e "s^_PINNING_^^"`) else if ( $maxproc == 1) then set ttt=(`echo $ttt_temp | sed -e "s^_PINNING_^$PINNING_COMMAND$PINNING_LIST^"`) else # @ total_nodes = $maxproc * $mpinproc[$p] / $CPN # @ corelist_start = $mpinproc[$p] * ($p - 1 - $offset * $total_nodes) + 1 # @ corelist_end = $mpinproc[$p] * ($p - $offset * $total_nodes) # set locallist="" # while($corelist_start <= $corelist_end) # set locallist=(`echo "$locallist$corelist[$corelist_start]"`) # @ corelist_start ++ # if($corelist_start <= $corelist_end) set locallist=(`echo "$locallist,"`) # end @ total_nodes = $maxproc * $mpinproc[$p] * $OMP_NUM_THREADS / $CPN @ corelist_start = $mpinproc[$p] * ($p - 1) + 1 @ corelist_end = $corelist_start + $mpinproc[$p] - 1 set locallist=(`echo $corelist | cut -d, -f$corelist_start-$corelist_end`) set ttt=(`echo $ttt_temp | sed -e "s^_PINNING_^$PINNING_COMMAND$locallist^"`) endif endif echo $ttt > ${i}/runlapw1_${loop} if ($dosoc) then set ttt_temp=(`echo $mpirun | sed -e "s^_NP_^$mpinproc[$p]^" -e "s^_EXEC_^${execlapwso}_mpi ${spin}lapwso_${loop}.def^" -e "s^_HOSTS_^.machine$mpip^" -e "s^_nodes_^$number_of_nodes^" -e "s^_offset_^$offset^"`) if( $?NOPINNING ) then set ttt=(`echo $ttt_temp | sed -e "s^_PINNING_^^"`) else if ( $maxproc == 1) then set ttt=(`echo $ttt_temp | sed -e "s^_PINNING_^$PINNING_COMMAND$PINNING_LIST^"`) else set corelist = (`echo $PINNING_LIST | sed -e "s^,^ ^g"`) @ total_nodes = $maxproc * $mpinproc[$p] / $CPN @ corelist_start = $mpinproc[$p] * ($p - 1 - $offset * $total_nodes) + 1 @ corelist_end = $mpinproc[$p] * ($p - $offset * $total_nodes) set locallist="" while($corelist_start <= $corelist_end) set locallist=(`echo "$locallist$corelist[$corelist_start]"`) @ corelist_start ++ if($corelist_start <= $corelist_end) set locallist=(`echo "$locallist,"`) end set ttt=(`echo $ttt_temp | sed -e "s^_PINNING_^$PINNING_COMMAND$locallist^"`) endif endif echo $ttt > ${i}runlapwso_${loop} endif end endif ### srun-implmentation, RUH Nov 16th 2015 set number_of_nodes=`sort nmr_q0/.machine$loop | uniq -c | wc -l` set offset=$mpinproc[$p] # $number_per_job[$p] set offset_tmp=0 @ offset = $offset / $CPN @ offset_tmp=$offset * $CPN if($offset_tmp == $mpinproc[$p] ) then @ offset=$offset * ($loop - 1) else set offset=$mpinproc[$p] @ offset=($offset * ($loop - 1)) / $CPN endif ### end of srun-implentation set exec1 = "$execmpi -p $loop" set exec2 = (`echo $mpirun | sed -e "s^_NP_^$mpinproc[$p]^" -e "s^_EXEC_^${exec1}^" -e "s^_HOSTS_^nmr_q0/.machine$mpip^" -e "s^_nodes_^$number_of_nodes^" -e "s^_offset_^$offset^"`) set doremote = $mpiremote else foreach j (q0 pqx mqx pqy mqy pqz mqz) set i=nmr_$j echo "${execlapw1} ${spin}lapw1_${loop}.def" > ${i}/runlapw1_${loop} if ($dosoc) then echo "${execlapwso} ${spin}lapwso_${loop}.def" > ${i}/runlapwso_${loop} endif end set exec2 = "$exec -p ${loop}" set doremote = $useremote endif if ($quota) then echo $exec2 > runnmr_${loop} set exec3 = "x_nmr_quota -case $case -p ${loop} $restart $quotaop" echo exec: $exec3 >> nmr.out.${loop} if ($doremote == 1) then ($remote $machine[$p] "cd $dir; $exec3" >> nmr.out.${loop}) >& nmr.err.$loop & else ( cd $dir; $exec3 >> nmr.out.${loop} ) >& nmr.err.${loop} & endif else echo exec: $exec2 >> nmr.out.${loop} if ($doremote == 1) then ($remote $machine[$p] "cd $dir; $exec2" >> nmr.out.${loop}) >& nmr.err.$loop & else (cd $dir; $exec2 >> nmr.out.${loop}) >& nmr.err.$loop & endif endif endif @ p ++ end wait end set loop = 0 while ($loop < $maxproc) @ loop ++ # if (! -z nmr.err.$loop ) goto error end # echo $exec ..... done set exec = "$nmrbin/nmr$cmplxenmr -case $case -mode sumpara $debug -p $maxproc $xiop $spinop $coreonly $green $scratch $hfop $socop" printf "\n EXECUTING: $exec\n\n" $exec printf "\ncurrent .... ready\n\n" endif if ($?mode) goto koniec if ($?doxionly) goto koniec integ: set param = "-case $case -mode integ $debug $spinop $nocore $coreonly $green $socop $fbz $metal $xiop" set exec = "$nmrbin/nmr$cmplxenmr $param" set execmpi = "$nmrbin/nmr${cmplxenmr}_mpi $param" if !( $dopara ) then printf "\n EXECUTING: $exec\n\n" $exec teststatus else grep '^nmr_integ:' .machines | sed -e 's/^nmr_integ://' -e 's/ *$//' -e 's/^ //'> .machinetmp sed -e "1p" -e 'd' .machinetmp | sed -e '/\(^[a-zA-Z0-9\-]*$\)/p' -e '/\(^[a-zA-Z0-9\-]*:[0-9]*$\)/p' -e "s/ */\\ /gp" -e 'd' >.machine_nmrinteg set x=`cut -d: -f2 -s .machine_nmrinteg` if ("$x" != '') then set machine_i=`cat .machine_nmrinteg` rm .machine_nmrinteg set ii=1 foreach s ($machine_i) set x=`echo $s|cut -d: -f2 -s ` if ("$x" == '') set x=1 set iii=1 while ($iii <= $x) echo $s |cut -d: -f1 >>.machine_nmrinteg @ iii ++ end @ ii ++ end endif if ( -e .machine_nmrinteg) then set machine = `head -1 .machine_nmrinteg` set ttt = `cat .machine_nmrinteg` set mpinproc = $#ttt else set mpinproc = 0 set machine = "" endif if ( $mpinproc > 0 ) then set mpi = 1 else set mpi = 0 endif if ( $mpi ) then ### srun-implmentation, RUH Nov 16th 2015 set number_of_nodes=`sort .machine_nmrinteg | uniq -c | wc -l` set offset=$mpinproc # $number_per_job[$p] set offset_tmp=0 @ offset = $offset / $CPN @ offset_tmp=$offset * $CPN if($offset_tmp == $mpinproc ) then set offset=0 else set offset=$mpinproc @ offset=($offset) / $CPN endif #### end of srun-implentation set execmpi1 = (`echo $mpirun | sed -e "s^_NP_^$mpinproc^" -e "s^_EXEC_^${execmpi}^" -e "s^_HOSTS_^.machine_nmrinteg^" -e "s^_nodes_^$number_of_nodes^" -e "s^_offset_^$offset^"`) set dir = `pwd` printf "\n EXECUTING: $execmpi1\n\n" if ($mpiremote == 1) then $remote $machine "cd $dir; $execmpi1" else $execmpi1 endif else printf "\n EXECUTING: $exec\n\n" $exec teststatus endif endif goto koniec sumpara: if ( $dopara ) then set mist = `grep -v init nmr_q0/.processes | grep : | grep -v residue | wc` set maxproc = $mist[1] set machine = `grep -v init nmr_q0/.processes | grep -v residue | cut -f2 -d: | xargs` set mpinproc = `grep -v init nmr_q0/.processes | grep -v residue | cut -f4 -d: | xargs` set mpiid = `grep -v init nmr_q0/.processes | grep -v residue | cut -f5 -d: | xargs` set exec = "$nmrbin/nmr$cmplxenmr -case $case -mode sumpara $debug -p $maxproc $xiop $spinop $coreonly $green $scratch $hfop $socop" printf "\n EXECUTING: $exec\n\n" $exec teststatus endif goto koniec moment: set exec = "$nmrbin/nmr$cmplxenmr -case $case -mode moment $onlyspheres $debug $spinop $fbz $coreonly" printf "\n EXECUTING: $exec\n\n" $exec teststatus goto koniec atoms: set exec = "$nmrbin/nmr$cmplxenmr -case $case -mode atoms $debug $spinop" printf "\n EXECUTING: $exec\n\n" $exec teststatus goto koniec plot: set exec = "$nmrbin/nmr$cmplxenmr -case $case -mode plot $debug $spinop $nocore $coreonly $rmcore $socop" printf "\n EXECUTING: $exec\n\n" $exec teststatus goto koniec in1: set exec = "$nmrbin/nmr$cmplxenmr -case $case -mode in1 $nodesin1 $green $ovlpmax $focusin1 $socop $spinop $orbop" if($?lom10) then #JH set exec = "$nmrbin/nmr${cmplxenmr}_lom10 -case $case -mode in1 $nodesin1 $green $ovlpmax $focusin1 $socop $spinop $orbop" #JH endif #JH printf "\n EXECUTING: $exec\n\n" $exec teststatus goto koniec save: mkdir $savedir cp $case.struct $case.outputnmr_klist $case.outputnmr_integ $case.outputnmr_current $case.in1${cmplxe}_nmr $case.xim $savedir # cp $case.current_int_x $case.current_int_y $case.current_int_z $savedir # cp $case.current_spheres_x $case.current_spheres_y $case.current_spheres_z $savedir goto koniec koniec: printf "\nstop\n" exit(0) error: printf "\nstop error\n" exit (1) help: less ${nmrbin}/SRC_nmr/README_NMR