Skip to content

Commit

Permalink
Merge pull request #76 from kousuke-nakano/devel-#75
Browse files Browse the repository at this point in the history
Solved: bin/force**.sh assume that xxx/turborvb/bin directory is added to PATH.
  • Loading branch information
kousuke-nakano authored Sep 7, 2023
2 parents b9ac8f0 + 75793c1 commit d5a90a1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 23 deletions.
20 changes: 10 additions & 10 deletions bin/forcefn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ else

# read all values here
echo " reading all values in fort.12...."
echo " $2 $1 $3 ${num_all_columns} " | readffn.x $5
echo " $2 $1 $3 ${num_all_columns} " | $BASEDIR/readffn.x $5
mv fort.21 fort.21_master

# make each fort.21_col
Expand All @@ -112,7 +112,7 @@ if [ ${flag_read_once} = True ]; then
cp ./fort.21_tmp/fort.21_col_1 ./fort.21
mv ./fort.21 fort.21.1
else
echo " $2 $1 $3 1 " | readffn.x $5
echo " $2 $1 $3 1 " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.1
fi

Expand All @@ -122,7 +122,7 @@ if [ "$ipc" -gt 1 ]; then
cp ./fort.21_tmp/fort.21_col_2 ./fort.21
mv ./fort.21 fort.21.1i
else
echo " $2 $1 $3 2 " | readffn.x $5
echo " $2 $1 $3 2 " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.1i
fi
fi
Expand All @@ -138,7 +138,7 @@ do
cp ./fort.21_tmp/fort.21_col_$n ./fort.21
mv fort.21 fort.21.2
else
echo " $2 $1 $3 $n " | readffn.x $5
echo " $2 $1 $3 $n " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.2
fi

Expand All @@ -149,7 +149,7 @@ do
cp ./fort.21_tmp/fort.21_col_$n ./fort.21
mv fort.21 fort.21.3
else
echo " $2 $1 $3 $n " | readffn.x $5
echo " $2 $1 $3 $n " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.3
fi

Expand All @@ -160,7 +160,7 @@ do
cp ./fort.21_tmp/fort.21_col_$n ./fort.21
mv fort.21 fort.21.4
else
echo " $2 $1 $3 $n " | readffn.x $5
echo " $2 $1 $3 $n " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.4
fi

Expand All @@ -183,7 +183,7 @@ do
cp ./fort.21_tmp/fort.21_col_$n ./fort.21
mv fort.21 fort.21.2
else
echo " $2 $1 $3 $n " | readffn.x $5
echo " $2 $1 $3 $n " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.2
fi

Expand All @@ -194,7 +194,7 @@ do
cp ./fort.21_tmp/fort.21_col_$n ./fort.21
mv fort.21 fort.21.3
else
echo " $2 $1 $3 $n " | readffn.x $5
echo " $2 $1 $3 $n " | $BASEDIR/readffn.x $5
mv fort.21 fort.21.3
fi

Expand All @@ -212,13 +212,13 @@ if [ ${flag_read_once} = True ]; then
cp fort.21 fort.22
cp fort.21.1 fort.21
else
echo " $2 $1 $3 $n " | readffn.x $5
echo " $2 $1 $3 $n " | $BASEDIR/readffn.x $5
cp fort.21 fort.22
cp fort.21.1 fort.21
fi

echo "$1" | corrvar.x > pip0_fn.d
echo " $2 $1 $3 1 " | readf.x $5
echo " $2 $1 $3 1 " | $BASEDIR/readf.x $5

tail -1 fort.20 > c1val
awk ' NR == 1 {print " Energy (ave) =",$1,$2}' c1val >> pip0_fn.d
Expand Down
10 changes: 6 additions & 4 deletions bin/forcefn_kpoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

start_time=`date +%s`

BASEDIR=$(dirname "$0")

awk ' NR == 1 {print $7}' parminimized.d > c1val
read nvar < c1val
awk ' NR == 1 {print $8}' parminimized.d > c1val
Expand Down Expand Up @@ -81,11 +83,11 @@ do
if [ ! -z $4 ]
then

forcefn.sh $1 $2 $3 $4 $i
$BASEDIR/forcefn.sh $1 $2 $3 $4 $i

else

forcefn.sh $1 $2 $3 1 $i
$BASEDIR/forcefn.sh $1 $2 $3 1 $i

fi

Expand All @@ -102,12 +104,12 @@ done



python $(which energyfn.py) > pip0_fn.d
python $BASEDIR/energyfn.py > pip0_fn.d


if [ $ntot -gt 0 ]
then
python $(which force.py) > forces_fn.dat
python $BASEDIR/force.py > forces_fn.dat
fi

exit
Expand Down
6 changes: 3 additions & 3 deletions bin/forcefn_kpoints_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ do
touch forces_fn.dat

# calc forces
forcefn.sh $1 $2 $3 ${scale_pulay} 1 1>out_K${i}.o 2>err_K${i}.o & # run background
$BASEDIR/forcefn.sh $1 $2 $3 ${scale_pulay} 1 1>out_K${i}.o 2>err_K${i}.o & # run background
echo " calculating for K${i}..., pid = $!, counter = ${counter_for_parallel_calc}"
counter_for_parallel_calc=`expr ${counter_for_parallel_calc} + 1`

Expand Down Expand Up @@ -193,10 +193,10 @@ done

echo "done."

python $(which energyfn.py) > pip0_fn.d
python $BASEDIR/energyfn.py > pip0_fn.d

if [ $ntot -gt 0 ]; then
python $(which force.py) > forces_fn.dat
python $BASEDIR/force.py > forces_fn.dat
fi

cd $root_dir
Expand Down
8 changes: 5 additions & 3 deletions bin/forcevmc_kpoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

start_time=`date +%s`

BASEDIR=$(dirname "$0")

awk ' NR == 1 {print $7}' parminimized.d > c1val
read nvar < c1val
awk ' NR == 1 {print $8}' parminimized.d > c1val
Expand Down Expand Up @@ -90,7 +92,7 @@ touch forces_vmc.dat

for i in `seq 1 $nkps`
do
forcevmc.sh $1 $2 ${scale_pulay} $i
$BASEDIR/forcevmc.sh $1 $2 ${scale_pulay} $i

wkp=$(awk -v ind="${i}" ' NR == ind+2 {print $5} ' kp_info.dat)
#echo " $i $wkp " >> prova
Expand All @@ -102,10 +104,10 @@ do
fi
done

python $(which energy.py) > pip0.d
python $BASEDIR/energy.py > pip0.d

if [ $ntot -gt 0 ]; then
python $(which force.py) > forces_vmc.dat
python $BASEDIR/force.py > forces_vmc.dat
fi

end_time=`date +%s`
Expand Down
6 changes: 3 additions & 3 deletions bin/forcevmc_kpoints_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ do
touch forces_vmc.dat

# calc forces
forcevmc.sh $1 $2 ${scale_pulay} 1 1>out_K${i}.o 2>err_K${i}.o & # run background
${BASEDIR}/forcevmc.sh $1 $2 ${scale_pulay} 1 1>out_K${i}.o 2>err_K${i}.o & # run background
echo " calculating for K${i}..., pid = $!, counter = ${counter_for_parallel_calc}"
counter_for_parallel_calc=`expr ${counter_for_parallel_calc} + 1`

Expand Down Expand Up @@ -184,10 +184,10 @@ done

echo "done."

python $(which energy.py) > pip0.d
python ${BASEDIR}/energy.py > pip0.d

if [ $ntot -gt 0 ]; then
python $(which force.py) > forces_vmc.dat
python ${BASEDIR}/force.py > forces_vmc.dat
fi

cd $root_dir
Expand Down

0 comments on commit d5a90a1

Please sign in to comment.