[Wien] opticcpara crashed for mstar

Peter Blaha pblaha at theochem.tuwien.ac.at
Wed Mar 3 19:23:18 CET 2021


Are you running in k-point parallel mode ??

Clearly, method B is missing a   -p

In addition, I think the opticpara_lapw script of wien2k_19 does not 
work properly with the required case.mommat2 files.

Try the attached new version.

Regards

Am 03.03.2021 um 18:58 schrieb Dr. K. C. Bhamu:
> Dear Prof. Oleg
> 
> I am trying to run mstar code to calculate effective mass for a 
> tetragonal system with SOC.
> I am using Wien2k_19.2 compiled with mkl+ifort on a cluster.
> 
> To calculate the mstar, I am using a script given for Si(SOC).
> 
> All steps went fine but optic code has crashed.
> Below is the error report:
> 
> A. Output when I run optic using a job file:
> **  OPTIC crashed!
> 0.141u 0.434s 0:05.06 11.2% 0+0k 3560+1384io 4pf+0w
> error: command   /home/kcbhamu/soft/w2k192/opticcpara -up -c -so 
> upoptic.def   failed
>   Detected input arguments = 2
>   Input mommat file = pbe.mommat2up
>   Degeneracy tolerance dEtol = 1e-5 [Ha]
>   Confirming text-to-number conversion dEtol =  1.00000E-05 [Ha]
>   The input file pbe.mommat2up does not exist. Exiting
> 
> B. Output when I run opticon terminal:
> [kcbhamu at elpidos pbe]$ x optic -so -up
>   emin,emax,nbvalmax  -5.00000000000000        7.00000000000000          
>     9999
> forrtl: severe (24): end-of-file during read, unit 10, file 
> /home/kcbhamu/work/mstar/hossan/automa/pbe/./pbe.vectorsoup
> Image              PC                Routine            Line        Source
> opticc             000000000046CD5B  Unknown               Unknown  Unknown
> opticc             000000000048A259  Unknown               Unknown  Unknown
> opticc             000000000042F60C  mom_mat_                  200  
> sph-UP_tmp.f
> opticc             000000000041F94B  MAIN__                    469  opmain.f
> opticc             00000000004047A2  Unknown               Unknown  Unknown
> libc-2.17.so <http://libc-2.17.so/><http://libc-2.17.so 
> <http://libc-2.17.so/>>       00002AF1E6804555  __libc_start_main    
>   Unknown  Unknown
> opticc             00000000004046A9  Unknown               Unknown  Unknown
> 0.000u 0.002s 0:00.00 0.0% 0+0k 408+64io 2pf+0w
> error: command   /home/kcbhamu/soft/w2k192/opticc upoptic.def   failed
> 
> 
> Here is my case.inop file
> 99999 1       number of k-points, first k-point
> -5.0 7.0 9999 Emin, Emax for matrix elements, NBvalMAX
> 2             number of choices (columns in *outmat): 2: hex or tetrag. case
> 1             Re xx
> 3             Re zz
> ON           ON/OFF   writes MME to unit 4
> 
> Choices:
> 1......Re <x><x>
> 2......Re <y><y>
> 3......Re <z><z>
> 4......Re <x><y>
> 5......Re <x><z>
> 6......Re <y><z>
> 7......Im <x><y>
> 8......Im <x><z>
> 9......Im <y><z>
> 
> Could you please advise me how I can get rid of this error?
> 
> 
> Please let me know if I need to provide any additional information in 
> support of my query.
> 
> 
> Regards
> Bhamu
> 
> _______________________________________________
> 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             FAX: +43-1-58801-165982
Email: blaha at theochem.tuwien.ac.at    WIEN2k: http://www.wien2k.at
WWW:   http://www.imc.tuwien.ac.at
-------------------------------------------------------------------------
-------------- next part --------------
#!/bin/tcsh -f
#
# Run optic in parallel mode
#
# $Author: M.Lee $
# 

touch .lock_
foreach i (.lock_*)
    rm $i
end

onintr exit
set name	= $0
set bin         = $name:h       #default directory for WIEN-executables
if !(-d $bin) set bin = .
set name	= $name:t

unalias rm
alias   testinput       'if (! -e \!:1 ||  -z \!:1) goto \!:2'
alias   testerror       'if (! -z \!:1.error) goto error'

set t	    = time  
set cmplx
set log     = :parallel
set defmach = `hostname`
set updn			# spinpolarization switch
set dnup    = 'dn'	        # spinpolarization switch
set sc				# semicore-switch
set hf				# hybrid-switch
set so				# spinorbit-switch
set remote = ssh
set tmp_dir = /tmp
set init = init:
set res  = residue:
set taskset0
set taskset='no'  

set scratch =      

if ( $?SCRATCH && $SCRATCH != '') then
  set scratch=`echo $SCRATCH  | sed -e 's/\/$//'`/ # we are afraid
                                # different settings in different
                                # computing centers
                                #use global variable for scratch if set
endif


############################################################################
# In this section use 0 to turn of an option, 1 to turn it on, 
# respectively choose a value

set useremote   = 1             # using remote shell to launch processes
setenv DELAY 0.1                  # delay launching of processes by n seconds
set debug       = 0             # set verbosity of debugging output

############################################################################
# and now we look if we should override the defaults
if (-e $bin/parallel_options) then
      source $bin/parallel_options
endif
if ( $?TASKSET ) then
        set taskset="$TASKSET"
endif
if ( $?USE_REMOTE ) then
        set useremote = $USE_REMOTE
endif
############################################################################

set tmp  = $tmp_dir/opticpara.$user.$$
set tmp2 = $tmp_dir/opticpara.$user.$$_2

if ($#argv < 1) then
	echo usage: $0 deffile
	exit
endif

while ($#argv)
  switch ($1)
  case -h:
  case -H: 
    set help
    shift; breaksw
  case -c:
    set cmplx = c
    shift; breaksw
  case -up:
    set updn = 'up'
    set dnup = 'dn'
    shift; breaksw
  case -dn:
    set updn = 'dn'
    set dnup = 'up'
    shift; breaksw
  case -hf:
    set hf = 'hf'
    shift; breaksw
  case -so:
    set so = 'so'
    shift; breaksw
  case -sc:
    set sc = 's'
    shift; breaksw
  default:
    set def = $1:r
    shift; breaksw
  endsw
end

set exe = $bin/optic$cmplx
set exe = optic$cmplx

#are we running parallel?
testinput .processes single
echo "running OPTIC in parallel mode"
echo "RUNNING" >.opticpara

#before we start, we wipe away all parallel error files
if ( -e optic_1.error ) rm *optic_*.error
if ( -e .timeop_1) rm .timeop_*

if (-e .machines.help) rm .machines.help

grep -v $init .processes|grep : | grep -v $res >$tmp2
set mist     = `wc $tmp2 `
set maxproc  = $mist[1]
#set machine  = `grep $init .processes |cut -f2 -d: | xargs`
set machine  = `grep -v $init .processes |grep : | grep -v $res | cut -f2 -d: | xargs`

set lockfile = `cut -f2 -d: $tmp2 | awk '{print $1 NR}'|xargs`
set residue  = `grep $res .processes|cut -f2 -d:`
if ($residue == "") unset residue

if ($debug > 0) echo machines: $machine

echo "** " Error in Parallel OPTIC >$def.error
#bounding cpus
set p_cpu_bound = ($machine)
set i=1
set cpu=0
set old=old
while ($i <= $#p_cpu_bound)
  if($old != $p_cpu_bound[$i]) then
     set cpu=0
  endif
  set old=$p_cpu_bound[$i]
  set p_cpu_bound[$i] = $cpu
  @ cpu ++
  @ i ++
end
#echo $machine
#echo $p_cpu_bound

#get name of case
setenv PWD `pwd|sed "s/tmp_mnt\///"`
#echo $PWD
setenv PWD $cwd
set case    = $PWD
set case    = $case:t          
if ($case == "") then
  echo "ERROR: cannot detect working directory $cwd -> exit"
  exit 1
endif
####set case    = $case:r           #head of file-names
if ($debug > 0) echo Setting up case $case for parallel execution
if ($debug > 0) echo of OPTIC
if ($debug > 0) echo "  "
#

#creating  def files
if ($debug > 0) echo " "
if ($debug > 0) echo -n "creating "$def"_*.def:  "
set i = 1
while ($i <= $maxproc)
  if ($debug > 0) echo -n "$i "
  cp $def.def .tmp
  #subsituting in files:
  cat <<theend >.script
s/\.vector$hf$so$dnup/&_$i/w .mist
s/\.vector$hf$so$updn/&_$i/w .mist
s/\.outputop/&_$i/w .mist
s/\.symmat/&_$i/w .mist
s/\.symma1/&_$i/w .mist
s/\.symma2/&_$i/w .mist
s/\.mommat2/&_$i/w .mist
s/\.mat_diag/&_$i/w .mist
s/\.mme/&_$i/w .mist
s/\.symop/&_$i/w .mist

theend

  sed -f .script .tmp > .tmp1
  sed "s/\.vector_${i}_$i\&dn/\.vectordn_$i/" .tmp1>.tmp2 
  sed "s/\.vector_${i}_$i\&up/\.vectorup_$i/" .tmp2>.tmp1
  sed "s/\.vector_${i}dn_$i/\.vectordn_$i/" .tmp1>.tmp2
  sed "s/\.vector_${i}_$i/\.vector_$i/" .tmp2>.tmp1
  sed "s/\.vectorhf_${i}dn_$i/\.vectorhfdn_$i/" .tmp1> .tmp2
  sed "s/\.vectorso_${i}dn_$i/\.vectorsodn_$i/" .tmp2> "$def"_$i.def
#similar fix for SO necessary

  @ i ++
end
if ($debug > 0) echo " "


#starting processes
if ($debug > 0) echo " "
if ($debug > 0) echo "starting process:  "

echo "->  "starting parallel optic at `date` >>$log

set loop    = 0
set endloop = 0
set runmach = ""
echo "files:$maxproc" >.processes2
# change working dir because of problems with automounted directories
#   cd $cwd
while ($loop < $maxproc)
  set p = 1
  if ($?residue && $?resok) set p = 2
  while ($p <= $#machine)
    if ($loop < $maxproc) then
	if !(-e .lock_$lockfile[$p]) then
	    @ loop ++
	    echo "${loop}:${maxproc} : $p_cpu_bound[$p]" >.processes2
	    if ($debug > 0) echo prepare $loop on $machine[$p]
	    set runmach = ($runmach $machine[$p])
	    echo $runmach >>.processes2
	    if ($debug > 1) echo "   >  $exe ${def}_${loop}.def on $machine[$p]"
	    if ($debug > 1) echo "   >  $exe ${def}_${loop}.def on $machine[$p]">>$log
	    if ($useremote == 1) then
	    if ($debug > 1) echo use remote
		touch .lock_$lockfile[$p]
		echo -n "$runmach[$loop] ">.timeop_$loop
                if("$taskset" != 'no') set taskset0="$taskset $p_cpu_bound[$p]"
		($remote $machine[$p] "cd $PWD;$t $taskset0 $exe ${def}_${loop}.def;rm -f .lock_$lockfile[$p]") >>.timeop_$loop  &
	 else
		if ($debug > 1) echo not using remote shell
		touch .lock_$lockfile[$p]
		echo -n "$runmach[$loop] " >.timeop_$loop
		(cd $PWD;$t $exe ${def}_${loop}.def;rm -f .lock_$lockfile[$p]) >>.timeop_$loop  &
	    endif
	endif
    if ($debug > 1) echo sleeping for $DELAY seconds
    sleep $DELAY
            jobs -l >.optic${cmplx}para.$$.`hostname`
    endif
    @ p ++
  end
end

#wait for execution to be completed
if ($debug > 0) echo " "
if ($debug > 0) echo "waiting for processes:  "
wait


set i = 1
while ($i <= $maxproc)
  testerror "$def"_$i
  @ i ++
end

#cpu summary:
set i = 1
while ($i <= $maxproc)
#    echo "      "`cat .timeop_$i`
#fix for bash timing
    bashtime2csh.pl_lapw .timeop_$i > .time_tmp
    mv .time_tmp .timeop_$i
    echo "      "`cat .timeop_$i` >>$log
    @ i ++
end

# postanalysis
echo "   Summary of opticpara:" >$tmp
set p = 1
while ($p <= $#machine)
    set m = $runmach[$p]
    cat .timeop_* | grep $m | tr "():" " " | \
	    awk '{u += $2; cl += 60*$4+$5} \
		END {print "   '$m'\t user=" u "\t wallclock=" cl}' >>$tmp
    @ p ++
end

uniq < $tmp |tee -a $log

echo "<-  "done at `date` >>$log

# concatenating the case.symmat files and case.mommat files

if (-e $case.symop)  rm $case.symop
if (-e ${scratch}$case.mme$updn)  rm ${scratch}$case.mme$updn
if (-e ${scratch}$case.symmat$updn)  rm ${scratch}$case.symmat$updn
if (-e ${scratch}$case.mommat2$updn)  rm ${scratch}$case.mommat2$updn
if (-e ${scratch}$case.mat_diag$updn) rm ${scratch}$case.mat_diag$updn
touch ${scratch}$case.symmat$updn
touch ${scratch}$case.mommat2$updn
touch ${scratch}$case.mat_diag$updn
touch ${scratch}$case.mme$updn

mv $case.symop_1 $case.symop
rm $case.symop_*
if( "$hf" != "hf" ) then
   if("$updn" == "") then
     opticcopy_lapw
   else
     opticcopy_lapw -$updn
   endif
endif

set i = 1
while ($i <= $maxproc)
 if ( $i == 1 ) then
    testinput ${scratch}$case.symmat_$i$updn scratchwarning
    cat ${scratch}$case.symmat_$i$updn    >  ${scratch}$case.symmat$updn
    cat ${scratch}$case.symma1_${i}$updn    >  ${scratch}$case.symma1$updn
    cat ${scratch}$case.symma2_${i}$updn    >  ${scratch}$case.symma2$updn
    if (-e ${scratch}$case.mommat2_$i$updn) then
      cat ${scratch}$case.mommat2_$i$updn   >  ${scratch}$case.mommat2$updn
    endif
    cat ${scratch}$case.mat_diag_$i$updn  >  ${scratch}$case.mat_diag$updn
    cat ${scratch}$case.mme_$i$updn  >  ${scratch}$case.mme$updn
 else
    tail -n +2  ${scratch}$case.symmat_$i$updn   >>  ${scratch}$case.symmat$updn
    tail -n +2  ${scratch}$case.symma1_${i}$updn   >>  ${scratch}$case.symma1$updn
    tail -n +2  ${scratch}$case.symma2_${i}$updn   >>  ${scratch}$case.symma2$updn
    if (-e ${scratch}$case.mommat2_$i$updn) then
      tail -n +2  ${scratch}$case.mommat2_$i$updn   >>  ${scratch}$case.mommat2$updn
    endif
    tail -n +2  ${scratch}$case.mat_diag_$i$updn >>  ${scratch}$case.mat_diag$updn
    tail -n +2  ${scratch}$case.mme_$i$updn >>  ${scratch}$case.mme$updn
 endif
    rm ${scratch}$case.symmat_$i$updn
    rm -f ${scratch}$case.mommat2_$i$updn
    rm ${scratch}$case.mat_diag_$i$updn
    rm ${scratch}$case.mme_$i$updn
    @ i ++
end

echo "Concatenating the parallel files to ${scratch}$case.symmat$updn, ${scratch}$case.mommat2$updn"

echo "<-  "done at `date` 
echo "<-  "done at `date` >>$log
echo "-----------------------------------------------------------------">>$log
rm $def.error
#rm .in.tmp .in.tmp1
touch $def.error
rm $tmp* >&/dev/null
rm .optic${cmplx}para.$$.`hostname` >&/dev/null
echo "DONE" >.opticpara
exit 0

single:
echo "running in single mode"
$exe $def.def
rm $tmp* >&/dev/null
rm .optic${cmplx}para.$$.`hostname` >&/dev/null
exit 0

scratchwarning:
echo "Could not find $case.symmat_$i$updn , which is probably because you used a scratch directory $SCRATCH"
echo "Copy these files  from the remote machines and concatenate them yourself"
echo "with commands like (for all your parallel calculations i):"
echo " cat $case.symmat_"'$i'"$updn >> $case.symmat$updn           when $i =1a "
echo " tail -n +2  $case.symmat_"'$i'"$updn >> $case.symmat$updn   else"
exit 1

error:
echo "** " OPTIC crashed!
echo "** " OPTIC crashed at `date`>>$log
echo "** " check ERROR FILES! >>$log
echo "-----------------------------------------------------------------">>$log
echo "** " Error in Parallel OPTIC >>$def.error
rm $tmp* >&/dev/null
rm .optic${cmplx}para.$$.`hostname` >&/dev/null
echo "ERROR" >.opticpara
exit 1


More information about the Wien mailing list