Added qp_reset

This commit is contained in:
Anthony Scemama 2019-01-16 18:22:16 +01:00
parent f42affd833
commit b8322eb01d
3 changed files with 49 additions and 36 deletions

2
configure vendored
View File

@ -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

View File

@ -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 create_ezfio_from_xyz
qp convert_output_to_ezfio
qp update
qp set_mo_class
qp plugins
"
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 convert_output_to_ezfio
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 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
;;

View File

@ -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