<div dir="ltr">Dear Sir,<div>Last time when I was calculation optical properties using hf potential then i got some error. Then Peter Blaha sir suggested to remove that /. And problem was solved by doing this. Thats why this / is not here.</div><div><br></div><div>Best Regards</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 15, 2020 at 11:52 PM Peeyush kumar kamlesh <<a href="mailto:peeyush.physik.rku@gmail.com">peeyush.physik.rku@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear Gavin Sir,<br><div>opticpara_lapw file is as follows:</div><div><br></div><div>#!/bin/tcsh -f<br>#<br># Run optic in parallel mode<br>#<br># $Author: M.Lee $<br># <br><br>touch .lock_<br>foreach i (.lock_*)<br> rm $i<br>end<br><br>onintr exit<br>set name = $0<br>set bin = $name:h #default directory for WIEN-executables<br>if !(-d $bin) set bin = .<br>set name = $name:t<br><br>unalias rm<br>alias testinput 'if (! -e \!:1 || -z \!:1) goto \!:2'<br>alias testerror 'if (! -z \!:1.error) goto error'<br><br>set t = time <br>set cmplx<br>set log = :parallel<br>set defmach = `hostname`<br>set updn # spinpolarization switch<br>set dnup = 'dn' # spinpolarization switch<br>set sc # semicore-switch<br>set hf # hybrid-switch<br>set so # spinorbit-switch<br>set remote = ssh<br>set tmp_dir = /tmp<br>set init = init:<br>set res = residue:<br>set taskset0<br>set taskset='no' <br><br>set scratch = <br><br>if ( $?SCRATCH && $SCRATCH != '') then<br> set scratch=`echo $SCRATCH | sed -e 's/\/$//'` # we are afraid<br> # different settings in different<br> # computing centers<br> #use global variable for scratch if set<br>endif<br><br><br>############################################################################<br># In this section use 0 to turn of an option, 1 to turn it on, <br># respectively choose a value<br><br>set useremote = 1 # using remote shell to launch processes<br>setenv DELAY 0.1 # delay launching of processes by n seconds<br>set debug = 0 # set verbosity of debugging output<br><br>############################################################################<br># and now we look if we should override the defaults<br>if (-e $bin/parallel_options) then<br> source $bin/parallel_options<br>endif<br>if ( $?TASKSET ) then<br> set taskset="$TASKSET"<br>endif<br>if ( $?USE_REMOTE ) then<br> set useremote = $USE_REMOTE<br>endif<br>############################################################################<br><br>set tmp = $tmp_dir/opticpara.$user.$$<br>set tmp2 = $tmp_dir/opticpara.$user.$$_2<br><br>if ($#argv < 1) then<br> echo usage: $0 deffile<br> exit<br>endif<br><br>while ($#argv)<br> switch ($1)<br> case -h:<br> case -H: <br> set help<br> shift; breaksw<br> case -c:<br> set cmplx = c<br> shift; breaksw<br> case -up:<br> set updn = 'up'<br> set dnup = 'dn'<br> shift; breaksw<br> case -dn:<br> set updn = 'dn'<br> set dnup = 'up'<br> shift; breaksw<br> case -hf:<br> set hf = 'hf'<br> shift; breaksw<br> case -so:<br> set so = 'so'<br> shift; breaksw<br> case -sc:<br> set sc = 's'<br> shift; breaksw<br> default:<br> set def = $1:r<br> shift; breaksw<br> endsw<br>end<br><br>set exe = $bin/optic$cmplx<br>set exe = optic$cmplx<br><br>#are we running parallel?<br>testinput .processes single<br>echo "running OPTIC in parallel mode"<br>echo "RUNNING" >.opticpara<br><br>#before we start, we wipe away all parallel error files<br>if ( -e optic_1.error ) rm *optic_*.error<br>if ( -e .timeop_1) rm .timeop_*<br><br>if (-e .machines.help) rm .machines.help<br><br>grep -v $init .processes|grep : | grep -v $res >$tmp2<br>set mist = `wc $tmp2 `<br>set maxproc = $mist[1]<br>#set machine = `grep $init .processes |cut -f2 -d: | xargs`<br>set machine = `grep -v $init .processes |grep : | grep -v $res | cut -f2 -d: | xargs`<br><br>set lockfile = `cut -f2 -d: $tmp2 | awk '{print $1 NR}'|xargs`<br>set residue = `grep $res .processes|cut -f2 -d:`<br>if ($residue == "") unset residue<br><br>if ($debug > 0) echo machines: $machine<br><br>echo "** " Error in Parallel OPTIC >$def.error<br>#bounding cpus<br>set p_cpu_bound = ($machine)<br>set i=1<br>set cpu=0<br>set old=old<br>while ($i <= $#p_cpu_bound)<br> if($old != $p_cpu_bound[$i]) then<br> set cpu=0<br> endif<br> set old=$p_cpu_bound[$i]<br> set p_cpu_bound[$i] = $cpu<br> @ cpu ++<br> @ i ++<br>end<br>#echo $machine<br>#echo $p_cpu_bound<br><br>#get name of case<br>setenv PWD `pwd|sed "s/tmp_mnt\///"`<br>#echo $PWD<br>setenv PWD $cwd<br>set case = $PWD<br>set case = $case:t <br>if ($case == "") then<br> echo "ERROR: cannot detect working directory $cwd -> exit"<br> exit 1<br>endif<br>####set case = $case:r #head of file-names<br>if ($debug > 0) echo Setting up case $case for parallel execution<br>if ($debug > 0) echo of OPTIC<br>if ($debug > 0) echo " "<br>#<br><br>#creating def files<br>if ($debug > 0) echo " "<br>if ($debug > 0) echo -n "creating "$def"_*.def: "<br>set i = 1<br>while ($i <= $maxproc)<br> if ($debug > 0) echo -n "$i "<br> cp $def.def .tmp<br> #subsituting in files:<br> cat <<theend >.script<br>s/vector$hf$so$dnup/&_$i/w .mist<br>s/vector$hf$so$updn/&_$i/w .mist<br>s/outputop/&_$i/w .mist<br>s/symmat/&_$i/w .mist<br>s/symma1/&_$i/w .mist<br>s/symma2/&_$i/w .mist<br>s/mommat2/&_$i/w .mist<br>s/mat_diag/&_$i/w .mist<br>s/mme/&_$i/w .mist<br>s/symop/&_$i/w .mist<br><br>theend<br><br> sed -f .script .tmp > .tmp1<br> sed "s/vector_${i}_$i\&dn/vectordn_$i/" .tmp1>.tmp2 <br> sed "s/vector_${i}_$i\&up/vectorup_$i/" .tmp2>.tmp1<br> sed "s/vector_${i}dn_$i/vectordn_$i/" .tmp1>.tmp2<br> sed "s/vector_${i}_$i/vector_$i/" .tmp2>.tmp1<br> sed "s/vectorhf_${i}dn_$i/vectorhfdn_$i/" .tmp1> .tmp2<br> sed "s/vectorso_${i}dn_$i/vectorsodn_$i/" .tmp2> "$def"_$i.def<br>#similar fix for SO necessary<br><br> @ i ++<br>end<br>if ($debug > 0) echo " "<br><br><br>#starting processes<br>if ($debug > 0) echo " "<br>if ($debug > 0) echo "starting process: "<br><br>echo "-> "starting parallel optic at `date` >>$log<br><br>set loop = 0<br>set endloop = 0<br>set runmach = ""<br>echo "files:$maxproc" >.processes2<br># change working dir because of problems with automounted directories<br># cd $cwd<br>while ($loop < $maxproc)<br> set p = 1<br> if ($?residue && $?resok) set p = 2<br> while ($p <= $#machine)<br> if ($loop < $maxproc) then<br> if !(-e .lock_$lockfile[$p]) then<br> @ loop ++<br> echo "${loop}:${maxproc} : $p_cpu_bound[$p]" >.processes2<br> if ($debug > 0) echo prepare $loop on $machine[$p]<br> set runmach = ($runmach $machine[$p])<br> echo $runmach >>.processes2<br> if ($debug > 1) echo " > $exe ${def}_${loop}.def on $machine[$p]"<br> if ($debug > 1) echo " > $exe ${def}_${loop}.def on $machine[$p]">>$log<br> if ($useremote == 1) then<br> if ($debug > 1) echo use remote<br> touch .lock_$lockfile[$p]<br> echo -n "$runmach[$loop] ">.timeop_$loop<br> if("$taskset" != 'no') set taskset0="$taskset $p_cpu_bound[$p]"<br> ($remote $machine[$p] "cd $PWD;$t $taskset0 $exe ${def}_${loop}.def;rm -f .lock_$lockfile[$p]") >>.timeop_$loop &<br> else<br> if ($debug > 1) echo not using remote shell<br> touch .lock_$lockfile[$p]<br> echo -n "$runmach[$loop] " >.timeop_$loop<br> (cd $PWD;$t $exe ${def}_${loop}.def;rm -f .lock_$lockfile[$p]) >>.timeop_$loop &<br> endif<br> endif<br> if ($debug > 1) echo sleeping for $DELAY seconds<br> sleep $DELAY<br> jobs -l >.optic${cmplx}para.$$.`hostname`<br> endif<br> @ p ++<br> end<br>end<br><br>#wait for execution to be completed<br>if ($debug > 0) echo " "<br>if ($debug > 0) echo "waiting for processes: "<br>wait<br><br><br>set i = 1<br>while ($i <= $maxproc)<br> testerror "$def"_$i<br> @ i ++<br>end<br><br>#cpu summary:<br>set i = 1<br>while ($i <= $maxproc)<br># echo " "`cat .timeop_$i`<br>#fix for bash timing<br> bashtime2csh.pl_lapw .timeop_$i > .time_tmp<br> mv .time_tmp .timeop_$i<br> echo " "`cat .timeop_$i` >>$log<br> @ i ++<br>end<br><br># postanalysis<br>echo " Summary of opticpara:" >$tmp<br>set p = 1<br>while ($p <= $#machine)<br> set m = $runmach[$p]<br> cat .timeop_* | grep $m | tr "():" " " | \<br> awk '{u += $2; cl += 60*$4+$5} \<br> END {print " '$m'\t user=" u "\t wallclock=" cl}' >>$tmp<br> @ p ++<br>end<br><br>uniq < $tmp |tee -a $log<br><br>echo "<- "done at `date` >>$log<br><br># concatenating the case.symmat files and case.mommat files<br><br>if (-e $case.symop) rm $case.symop<br>if (-e ${scratch}$case.mme$updn) rm ${scratch}$case.mme$updn<br>if (-e ${scratch}$case.symmat$updn) rm ${scratch}$case.symmat$updn<br>if (-e ${scratch}$case.mommat2$updn) rm ${scratch}$case.mommat2$updn<br>if (-e ${scratch}$case.mat_diag$updn) rm ${scratch}$case.mat_diag$updn<br>touch ${scratch}$case.symmat$updn<br>touch ${scratch}$case.mommat2$updn<br>touch ${scratch}$case.mat_diag$updn<br>touch ${scratch}$case.mme$updn<br><br>mv $case.symop_1 $case.symop<br>rm $case.symop_*<br>if( "$hf" != "hf" ) then<br> opticcopy_lapw<br>endif<br><br>set i = 1<br>while ($i <= $maxproc)<br> if ( $i == 1 ) then<br># testinput $case.symmat_$i$updn scratchwarning<br> cat ${scratch}$case.symmat_$i$updn > ${scratch}$case.symmat$updn<br> cat ${scratch}$case.symma1_${i}$updn > ${scratch}$case.symma1$updn<br> cat ${scratch}$case.symma2_${i}$updn > ${scratch}$case.symma2$updn<br> if (-e ${scratch}$case.mommat2_$i$updn) then<br> cat ${scratch}$case.mommat2_$i$updn > ${scratch}$case.mommat2$updn<br> endif<br> cat ${scratch}$case.mat_diag_$i$updn > ${scratch}$case.mat_diag$updn<br> cat ${scratch}$case.mme_$i$updn > ${scratch}$case.mme$updn<br> else<br> tail -n +2 ${scratch}$case.symmat_$i$updn >> ${scratch}$case.symmat$updn<br> tail -n +2 ${scratch}$case.symma1_${i}$updn >> ${scratch}$case.symma1$updn<br> tail -n +2 ${scratch}$case.symma2_${i}$updn >> ${scratch}$case.symma2$updn<br> if (-e ${scratch}$case.mommat2_$i$updn) then<br> tail -n +2 ${scratch}$case.mommat2_$i$updn >> ${scratch}$case.mommat2$updn<br> endif<br> tail -n +2 ${scratch}$case.mat_diag_$i$updn >> ${scratch}$case.mat_diag$updn<br> tail -n +2 ${scratch}$case.mme_$i$updn >> ${scratch}$case.mme$updn<br> endif<br> rm ${scratch}$case.symmat_$i$updn<br> rm -f ${scratch}$case.mommat2_$i$updn<br> rm ${scratch}$case.mat_diag_$i$updn<br> rm ${scratch}$case.mme_$i$updn<br> @ i ++<br>end<br><br>echo "<- "done at `date` >>$log<br>echo "-----------------------------------------------------------------">>$log<br>rm $def.error<br>#rm .in.tmp .in.tmp1<br>touch $def.error<br>rm $tmp* >&/dev/null<br>rm .optic${cmplx}para.$$.`hostname` >&/dev/null<br>echo "DONE" >.opticpara<br>exit 0<br><br>single:<br>echo "running in single mode"<br>$exe $def.def<br>rm $tmp* >&/dev/null<br>rm .optic${cmplx}para.$$.`hostname` >&/dev/null<br>exit 0<br><br>scratchwarning:<br>echo "Could not find $case.symmat_$i$updn , which is probably because you used a scratch directory $SCRATCH"<br>echo "Copy these files from the remote machines and concatenate them yourself"<br>echo "with commands like (for all your parallel calculations i):"<br>echo " cat $case.symmat_"'$i'"$updn >> $case.symmat$updn when $i =1a "<br>echo " tail -n +2 $case.symmat_"'$i'"$updn >> $case.symmat$updn else"<br>exit 1<br><br>error:<br>echo "** " OPTIC crashed!<br>echo "** " OPTIC crashed at `date`>>$log<br>echo "** " check ERROR FILES! >>$log<br>echo "-----------------------------------------------------------------">>$log<br>echo "** " Error in Parallel OPTIC >>$def.error<br>rm $tmp* >&/dev/null<br>rm .optic${cmplx}para.$$.`hostname` >&/dev/null<br>echo "ERROR" >.opticpara<br>exit 1<br></div></div>
</blockquote></div>