[Wien] save_lapw problem with W2WEB

Peter Blaha peter.blaha at tuwien.ac.at
Wed Sep 6 09:57:57 CEST 2023


Dear Gerhard,

Thanks for the report.

The w2web problem of save_lapw for parallel calculations will be fixed 
in the next release. I'll change the "p" to "e" (2 places in savelapw.pl).

The other problems you report for save_lapw have historical reasons. 
The old save_lapw did not have switches like -d, -f or -s.
Anyway, I've enabled all these combinations and further tried to enhance 
the save_lapw against user errors.


clean_lapw:   .machinesXXX or .processesXXX will be removed.
when you do only a parallel calculation, there is no case.output1, but 
only a output1_1. So at least this file needs to be kept.
I also will remove all empty files.

I'll send the new version to your private email for further testing 
before release.

Best regards
Peter

Am 05.09.2023 um 12:06 schrieb Fecher, Gerhard:
> Dear Peter,
> I have an issue with save_lapw (Wien2k 23.2) when calling it from w2web after a parallel calculation.
> using -d savedir (by checking the box: Save calculation in a directory as specified) results in
>      save_lapw -d -eels savedir
> this does not happen for a non-parallel calculation.
> It seems that the p or -p from the parallel execution is transferred to the "savelapw.pl" script
> and eels is executed because of "$cmdline .= " -eels" if ($p)" in line 50
> maybe its better to associate eels with a different character than p.
> 
> further, from W2Web, when saving with old to a directory, the command is
>       save_lapw -o -d savedir
> and the -d overwrites -o such that the new saving scheme is used and not the old one
> 
> the same appears for save_lapw -o -f or save_lapw -o -s, or other combinations where one of -d, -f, -s appears after -o.
> reason is the 'set new' in the save_lapw script in the parts
>    case -[D|d]:
>    case -[F|f]:
>    case -[S|s]:
> 
> I think 'set new' is not necessary to be repeated for -d, -f, -s, because it is already done before the while statements,
> or is there a special need to have it always in such cases and to supress the old saving scheme?
> (unset new appears only in -o and -nodel)
> 
> In my tests, -d -eels savedir or -d -o savedir did not work at all, also from command line.
> 
> To use -o -d savedir, I also changed the following (mainly just copied from the new scheme) in save_lapw:
> (but this should be cross-checked to be correct or complete)
> 
> # old save scheme
> if ($?new) goto new
> echo 'Fallback to compatibility mode with "old" save_lapw'
> foreach i (clmsum clmup clmdn dmatup dmatdn dmatud vorbup vorbdn vorbud struct vrespsum vrespup vrespdn eeceup eecedn r2v r2vdn r2v2 r2v2dn r2v_nonloc r2v_nonlocdn r2v_half r2v_halfdn tausum tauup taudn )
> #old#    if (! -z $file.$i && -e $file.$i )  cp -p $file.$i $savefile.$i
>      if ($savefile == "") then
>          set to = $i
>      else
>          set to = $savefile.$i:e
>      endif
> #    if (-e $savedir/$to)  then
> #        if !($?force) goto exists
> #    endif
>      if !($?silent) echo "   $i -> $savedir/$to"
>      if (! -z $i && -e $i) cp -p $i $savedir/$to
> end
> 
> set hftest=`grep "HYBRID EIGENVALUES" $file.scf`
> if($#hftest != 0) then
>      foreach i ( vectorhf vectorhfup vectorhfdn vectorhfso vectorhfsoup vectorhfsodn energyhf energyhfup energyhfdn energyhfso energyhfsoup energyhfsodn energyhf_rbz energyhfup_rbz energyhfdn_rbz weighthf weighthfup weighthfdn weighthf_rbz weighthfup_rbz weighthfdn_rbz weighthfnoso weighthfnosoup weighthfnosodn corewf corewfup corewfdn)
> #old#        if (! -z $file.$i && -e $file.$i ) cp -p $file.$i $savefile.$i
>          if ($savefile == "") then
>             set to = $i
>          else
>             set to = $savefile.$i:e
>          endif
>          if !($?silent) echo "   $i -> $savedir/$to"
>          if (! -z $i && -e $i) cp -p $i $savedir/$to
>          end
>          echo "HF calculation detected and corresponding vectorhf, energyhf and weighthf files are also saved (provided they are NOT on '$SCRATCH'"
> endif
> 
> if (-e $file.scf )  mv $file.scf $savefile.scf
> if(! $?nodel) then
>      if (-e $file.broyd1)  rm $file.broyd*
>      echo 'broyden files deleted, clm*, dmat*, vorb*, vresp*, tau*,  eece*, scf and struct files saved under' $savefile
> endif
> exit (0)
> 
> # new save scheme, includes input files etc.
> 
> 
> 
> 
> Optional remark:
> It would also be nice if the hidden .machinesXXX as well as other numbered (XXX) files are removed with clean_lapw and/or save_lapw.
> For example, I guess the informations of all the case.output1up_XXX files is also contained in case.output1up
> and similar for output1dn, eenergyup, energydn, and maybe others.
> When using many cores, the things become sometimes a little unclear and after a while searching/inspecting becomes slow even though harddisc space doesn't matter much to me.
> 
> In version 21.1 I used the following (without removing empty files), but this might not be complete for 23.2:
> 
> echo "cleaning `pwd ` "
> (ls $file.vec* $file.help* $file.vrespva* $file.vrespco* $file.clmsc0* $file.clmsc1* $file.clmscup0* $file.clmscup1* $file.clmscdn0* $file.clmscdn1* $file.clmval_* $file.clmvalup_* $file.clmvaldn_* $file.output0[1-9]0[0-9] $file.output00[1-9][0-9] $file.output0[1-9][1-9][0-9] $file.output1_*_proc* $file.output1up_*_proc* $file.output1dn_*_proc* $file.output2_* $file.output2up_* $file.output2upeece_* $file.output2dn_* $file.output2dneece_* $file.recprlist $file.scfdm_* $file.scfdmup_* $file.scfdmdn_* $file.dmat_[0-9]* $file.dmatup_[0-9]* $file.dmatdn_[0-9]* $file.dmatud_[0-9]* > cleanfilelist1 )>& /dev/null
> set a=`cat cleanfilelist1`
> (ls $file.storeHinv* $file.nsh* $file.vint* $file.storeHinv* $file.nval* $file.broy* $file.*_old *~ $file.corew* fort.* ftn* *.error > cleanfilelist2 )>& /dev/null
> set a1=`cat cleanfilelist2`
> (ls .command* .running* .lapw?para .time?_* .tmp? :parallel* This_file* .processes .script .mist* .time_* :log STDOUT $file.klist_[0-9]* $file.weight* .in.tmp* *.def *.scf1*_* *.scf2*_* *.tmp* > cleanfilelist3 )>& /dev/null
> set a2=`cat cleanfilelist3`
> 
> # added more files by GHF
> 
> (ls $file.energy_* $file.energyup_* $file.energydn_* $file.energydum_* $file.output1_* $file.output1up_* $file.output1dn_* $file.klist_band_*  > cleanfilelist4 )>& /dev/null
> set a3=`cat cleanfilelist4`
> 
> (ls $file.energyso_* $file.energysodn_* $file.normsodn_* $file.normsoup_* $file.outputso_* $file.scfso_* $file.energysoup_* $file.outputdm_* $file.normso_* > cleanfilelist5 )>& /dev/null
> set a4=`cat cleanfilelist5`
> 
> (ls $file.current_int_x_*  $file.current_int_y_* $file.current_int_z_* $file.current_spheres_x_* $file.current_spheres_y_* $file.current_spheres_z_* $file.xim* $file.outputnmr_current* $file.restartnmr* nmr.err.* nmr.out.* > cleanfilelist6 )>& /dev/null
> set a5=`cat cleanfilelist6`
> 
> (ls .machine[0-9]* runlapw1_* .stdout2_*  .stdoutso_* .temp2_* .tempso_* .timeir_* .timeso_* > cleanfilelist7 )>& /dev/null
> set a6=`cat cleanfilelist7`
> 
> 
> rm cleanfilelist*
> if ( "$silent" == '-s') then
>    foreach i ($a $a1 $a2 $a3 $a4 $a5 $a6)
>    rm $i
>    end
>    exit (0)
> else
>    foreach i ($a $a1 $a2 $a3 $a4 $a5 $a6)
>    ls $i
>    rm $i
>    end
>    echo ' all large (unnecessary) files deleted\! '
>    exit (0)
> endif
> 
> Ciao
> Gerhard
> 
> DEEP THOUGHT in D. Adams; Hitchhikers Guide to the Galaxy:
> "I think the problem, to be quite honest with you,
> is that you have never actually known what the question is."
> 
> ====================================
> Dr. Gerhard H. Fecher
> Institut of Physics
> Johannes Gutenberg - University
> 55099 Mainz
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
> SEARCH the MAILING-LIST at:  http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html

-- 
--------------------------------------------------------------------------
Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
Phone: +43-1-58801-165300
Email: peter.blaha at tuwien.ac.at    WIEN2k: http://www.wien2k.at
WWW:   http://www.imc.tuwien.ac.at
-------------------------------------------------------------------------


More information about the Wien mailing list