mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-19 14:31:44 +02:00
Added qp_reset
This commit is contained in:
parent
f42affd833
commit
b8322eb01d
2
configure
vendored
2
configure
vendored
@ -287,7 +287,7 @@ EOF
|
||||
elif [[ ${PACKAGE} = ezfio ]] ; then
|
||||
|
||||
download \
|
||||
"https://gitlab.com/scemama/EZFIO/-/archive/v1.3.4/EZFIO-v1.3.4.tar.gz" \
|
||||
"https://gitlab.com/scemama/EZFIO/-/archive/v1.3.5/EZFIO-v1.3.5.tar.gz" \
|
||||
"${QP_ROOT}"/external/ezfio.tar.gz
|
||||
execute << EOF
|
||||
cd "\${QP_ROOT}"/external
|
||||
|
75
etc/qp.rc
75
etc/qp.rc
@ -9,46 +9,51 @@ source ${QP_ROOT}/etc/ezfio.rc
|
||||
|
||||
function _qp_usage()
|
||||
{
|
||||
echo "
|
||||
cat << EOF
|
||||
qp - Shell function of the qpsh shell
|
||||
|
||||
Usage:
|
||||
qp set_file EZFIO_DIRECTORY
|
||||
qp unset_file
|
||||
|
||||
qp has DIRECTORY ITEM
|
||||
qp get DIRECTORY ITEM
|
||||
qp set DIRECTORY ITEM VALUE : Scalar values
|
||||
qp set DIRECTORY ITEM : Array values read from stdin
|
||||
EZFIO access:
|
||||
|
||||
qp run PROGRAM
|
||||
qp man PROGRAM
|
||||
qp srun PROGRAM
|
||||
qp mpirun PROGRAM
|
||||
qp set_file EZFIO_DIR Sets the current EZFIO directory.
|
||||
|
||||
qp set_frozen_core
|
||||
qp unset_file Unsets the current EZFIO directory.
|
||||
|
||||
qp has <module> <parameter> If the <module>/<parameter> is set in the
|
||||
EZFIO directory, returns 1. Otherwise returns 0.
|
||||
|
||||
qp get <module> <parameter> Returns the value of <module>/<parameter>.
|
||||
|
||||
qp set <module> <parameter> [<value>]
|
||||
Sets the value of <module>/<parameter>. If the
|
||||
value is not given in the command line it is read
|
||||
from the standard input.
|
||||
|
||||
Running programs:
|
||||
|
||||
qp (run|srun|mpirun) <program>
|
||||
|
||||
Getting help:
|
||||
|
||||
qp man (<program>|<qp_command>)
|
||||
|
||||
Running quantum package commands:
|
||||
|
||||
qp create_ezfio_from_xyz
|
||||
qp convert_output_to_ezfio
|
||||
qp update
|
||||
qp create_ezfio
|
||||
qp plugins The corresponding commands start with "qp_".
|
||||
qp reset To get help for a command <qp_command>, run
|
||||
qp set_frozen_core <qp_command> --help
|
||||
qp set_mo_class
|
||||
qp plugins
|
||||
"
|
||||
qp update
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
function qp()
|
||||
{
|
||||
function clean_ezfio() {
|
||||
RESULT=""
|
||||
while [[ -n $1 ]] ; do
|
||||
case "$1" in
|
||||
None) RESULT+='"None" ' ;;
|
||||
*) RESULT+="$1 " ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
eval set -- "$RESULT"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
"set_file")
|
||||
if [[ -d ${2} ]] ; then
|
||||
@ -58,7 +63,6 @@ function qp()
|
||||
fi;;
|
||||
|
||||
"has"|"set"|"get"|"unset_file")
|
||||
clean_ezfio
|
||||
ezfio "$@"
|
||||
;;
|
||||
|
||||
@ -67,6 +71,11 @@ function qp()
|
||||
qp_set_frozen_core "$@" ${EZFIO_FILE}
|
||||
;;
|
||||
|
||||
"reset")
|
||||
shift
|
||||
qp_reset "$@" ${EZFIO_FILE}
|
||||
;;
|
||||
|
||||
"create_ezfio_from_xyz")
|
||||
shift
|
||||
# Replace ':' by spaces
|
||||
@ -257,7 +266,7 @@ _qp_Complete()
|
||||
case "${prev2}" in
|
||||
set|has|get)
|
||||
if [[ ${prev} == "qp" ]] ; then
|
||||
COMPREPLY=( $(compgen -W "plugins set set_frozen_core set_mo_class" -- $cur ) )
|
||||
COMPREPLY=( $(compgen -W "plugins set reset set_frozen_core set_mo_class" -- $cur ) )
|
||||
elif [[ ! -d ${EZFIO_FILE}/${prev} ]] ; then
|
||||
COMPREPLY=( $(compgen -W "" -- $cur ) )
|
||||
else
|
||||
@ -272,6 +281,10 @@ _qp_Complete()
|
||||
COMPREPLY=( $(compgen -W "-h $(cat ${QP_ROOT}/data/executables | cut -d ' ' -f 1)" -- $cur ) )
|
||||
return 0
|
||||
;;
|
||||
reset)
|
||||
COMPREPLY=( $(compgen -W "-h -m -a -d" -- $cur ) )
|
||||
return 0
|
||||
;;
|
||||
unset_file|set_frozen_core)
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
@ -291,7 +304,7 @@ _qp_Complete()
|
||||
*)
|
||||
COMPREPLY+=( $(compgen -W 'has get set unset_file edit \
|
||||
run srun mpirun set_frozen_core \
|
||||
set_mo_class ' \
|
||||
reset set_mo_class ' \
|
||||
-- $cur ) )
|
||||
return 0
|
||||
;;
|
||||
|
@ -93,10 +93,10 @@ ezfio=$1
|
||||
qp set_file $ezfio
|
||||
|
||||
if [[ $dets -eq 1 ]] ; then
|
||||
rm -- ${ezfio}/determinants/psi_{det,coef}.gz
|
||||
rm --force -- ${ezfio}/determinants/n_det
|
||||
rm --force -- ${ezfio}/determinants/psi_{det,coef}.gz
|
||||
fi
|
||||
|
||||
set -x
|
||||
if [[ $mos -eq 1 ]] ; then
|
||||
if [[ -f ${ezfio}/mo_basis/mo_class.gz ]] && [[ $(qp get mo_basis mo_num) -ne \
|
||||
$(zcat ${ezfio}/mo_basis/mo_class.gz |grep Active | wc -l) ]] ; then
|
||||
|
Loading…
Reference in New Issue
Block a user