mirror of
https://github.com/triqs/dft_tools
synced 2025-05-01 04:34:57 +02:00
[fix] fixes for latest dfttools version
This commit is contained in:
parent
24d102465b
commit
511589c0d5
@ -5,7 +5,7 @@ MPIRUN_CMD=mpirun
|
|||||||
show_help()
|
show_help()
|
||||||
{
|
{
|
||||||
echo "
|
echo "
|
||||||
Usage: vasp_dmft [-n <number of cores>] -i <number of iterations> -j <number of VASP iterations with fixed charge density> [-v <VASP version>] [-p <path to VASP directory>] [<dmft_script.py>]
|
Usage: vasp_dmft [-n <number of cores>] -i <number of iterations> -j <number of VASP iterations with fixed charge density> [-p <path to VASP directory>] [<dmft_script.py>]
|
||||||
|
|
||||||
If the number of cores is not specified it is set to 1 by default.
|
If the number of cores is not specified it is set to 1 by default.
|
||||||
|
|
||||||
@ -14,9 +14,6 @@ Usage: vasp_dmft [-n <number of cores>] -i <number of iterations> -j <number of
|
|||||||
Set the number of VASP iteration with a fixed charge density update
|
Set the number of VASP iteration with a fixed charge density update
|
||||||
inbetween the dmft runs with -j <number of VASP iterations with fixed charge density>
|
inbetween the dmft runs with -j <number of VASP iterations with fixed charge density>
|
||||||
|
|
||||||
Set the version of VASP by -v standard(default)/no_gamma_write to
|
|
||||||
specify if VASP writes the GAMMA file or not.
|
|
||||||
|
|
||||||
If the path to VASP directory is not specified it must be provided by a
|
If the path to VASP directory is not specified it must be provided by a
|
||||||
variable VASP_DIR.
|
variable VASP_DIR.
|
||||||
|
|
||||||
@ -56,12 +53,6 @@ while getopts ":n:i:j:v:p:h" opt; do
|
|||||||
VASP_DIR=$OPTARG
|
VASP_DIR=$OPTARG
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
v)
|
|
||||||
if [ -n "$OPTARG" ]; then
|
|
||||||
VASP_VERSION=$OPTARG
|
|
||||||
# echo "Version of VASP (writing GAMMA file (standard) or not (no_gamma_write): $VASP_VERSION"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
h)
|
h)
|
||||||
show_help
|
show_help
|
||||||
exit 1
|
exit 1
|
||||||
@ -99,11 +90,6 @@ if [ -z "$NDFTITER" ]; then
|
|||||||
NDFTITER=1
|
NDFTITER=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$VASP_VERSION" ]; then
|
|
||||||
echo " VASP version not specified, setting to standard"
|
|
||||||
VASP_VERSION="standard"
|
|
||||||
fi
|
|
||||||
|
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@ -115,7 +101,6 @@ fi
|
|||||||
echo " Number of cores: $NPROC"
|
echo " Number of cores: $NPROC"
|
||||||
echo " Number of iterations: $NITER"
|
echo " Number of iterations: $NITER"
|
||||||
echo " Number of iterations with fixed density: $NDFTITER"
|
echo " Number of iterations with fixed density: $NDFTITER"
|
||||||
echo " VASP version: $VASP_VERSION"
|
|
||||||
echo " Script name: $DMFT_SCRIPT"
|
echo " Script name: $DMFT_SCRIPT"
|
||||||
|
|
||||||
rm -f vasp.lock STOPCAR
|
rm -f vasp.lock STOPCAR
|
||||||
@ -123,5 +108,5 @@ rm -f vasp.lock STOPCAR
|
|||||||
stdbuf -o 0 $MPIRUN_CMD -np $NPROC "$VASP_DIR" &
|
stdbuf -o 0 $MPIRUN_CMD -np $NPROC "$VASP_DIR" &
|
||||||
|
|
||||||
|
|
||||||
$MPIRUN_CMD -np $NPROC @TRIQS_PYTHON_EXECUTABLE@ -m triqs_dft_tools.converters.plovasp.sc_dmft $(jobs -p) $NITER $NDFTITER $DMFT_SCRIPT 'plo.cfg' $VASP_VERSION || kill %1
|
$MPIRUN_CMD -np $NPROC @TRIQS_PYTHON_EXECUTABLE@ -m triqs_dft_tools.converters.plovasp.sc_dmft $(jobs -p) $NITER $NDFTITER $DMFT_SCRIPT 'plo.cfg' || kill %1
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class bcolors:
|
|||||||
ENDC = '\033[0m'
|
ENDC = '\033[0m'
|
||||||
|
|
||||||
# Main self-consistent cycle
|
# Main self-consistent cycle
|
||||||
def run_all(vasp_pid, dmft_cycle, cfg_file, n_iter, n_iter_dft, vasp_version):
|
def run_all(vasp_pid, dmft_cycle, cfg_file, n_iter, n_iter_dft):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
mpi.report(" Waiting for VASP lock to appear...")
|
mpi.report(" Waiting for VASP lock to appear...")
|
||||||
@ -163,8 +163,6 @@ def run_all(vasp_pid, dmft_cycle, cfg_file, n_iter, n_iter_dft, vasp_version):
|
|||||||
# electron.F around line 644
|
# electron.F around line 644
|
||||||
iter_dft = 0
|
iter_dft = 0
|
||||||
|
|
||||||
if vasp_version == 'standard' or vasp_version == 'ncl':
|
|
||||||
copyfile(src='GAMMA',dst='GAMMA_recent')
|
|
||||||
while iter_dft < n_iter_dft:
|
while iter_dft < n_iter_dft:
|
||||||
# insert recalculation of GAMMA here
|
# insert recalculation of GAMMA here
|
||||||
# Recalculates the density correction
|
# Recalculates the density correction
|
||||||
@ -192,8 +190,6 @@ def run_all(vasp_pid, dmft_cycle, cfg_file, n_iter, n_iter_dft, vasp_version):
|
|||||||
vasp_running = False
|
vasp_running = False
|
||||||
break
|
break
|
||||||
iter_dft += 1
|
iter_dft += 1
|
||||||
if vasp_version == 'standard' or vasp_version == 'ncl':
|
|
||||||
copyfile(src='GAMMA_recent',dst='GAMMA')
|
|
||||||
iter += 1
|
iter += 1
|
||||||
if iter == n_iter:
|
if iter == n_iter:
|
||||||
print("\n Maximum number of iterations reached.")
|
print("\n Maximum number of iterations reached.")
|
||||||
@ -250,13 +246,6 @@ def main():
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
cfg_file = 'plo.cfg'
|
cfg_file = 'plo.cfg'
|
||||||
|
|
||||||
try:
|
|
||||||
vasp_version = sys.argv[6]
|
|
||||||
except KeyError:
|
|
||||||
vasp_version = 'standard'
|
|
||||||
|
|
||||||
#if vasp_version != 'standard' and vasp_version != 'no_gamma_write':
|
|
||||||
# raise Exception('vasp_version has to be standard or no_gamma_write')
|
|
||||||
|
|
||||||
# if len(sys.argv) > 1:
|
# if len(sys.argv) > 1:
|
||||||
# vasp_path = sys.argv[1]
|
# vasp_path = sys.argv[1]
|
||||||
@ -271,7 +260,7 @@ def main():
|
|||||||
|
|
||||||
dmft_mod = importlib.import_module(dmft_script)
|
dmft_mod = importlib.import_module(dmft_script)
|
||||||
|
|
||||||
run_all(vasp_pid, dmft_mod.dmft_cycle, cfg_file, n_iter, n_iter_dft, vasp_version)
|
run_all(vasp_pid, dmft_mod.dmft_cycle, cfg_file, n_iter, n_iter_dft)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user