10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-02 11:25:26 +02:00

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 elif [[ ${PACKAGE} = ezfio ]] ; then
download \ 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 "${QP_ROOT}"/external/ezfio.tar.gz
execute << EOF execute << EOF
cd "\${QP_ROOT}"/external cd "\${QP_ROOT}"/external

View File

@ -9,46 +9,51 @@ source ${QP_ROOT}/etc/ezfio.rc
function _qp_usage() function _qp_usage()
{ {
echo " cat << EOF
qp - Shell function of the qpsh shell
Usage: Usage:
qp set_file EZFIO_DIRECTORY
qp unset_file
qp has DIRECTORY ITEM EZFIO access:
qp get DIRECTORY ITEM
qp set DIRECTORY ITEM VALUE : Scalar values
qp set DIRECTORY ITEM : Array values read from stdin
qp run PROGRAM qp set_file EZFIO_DIR Sets the current EZFIO directory.
qp man PROGRAM
qp srun PROGRAM
qp mpirun PROGRAM
qp set_frozen_core qp unset_file Unsets the current EZFIO directory.
qp create_ezfio_from_xyz qp has <module> <parameter> If the <module>/<parameter> is set in the
qp convert_output_to_ezfio EZFIO directory, returns 1. Otherwise returns 0.
qp update
qp set_mo_class qp get <module> <parameter> Returns the value of <module>/<parameter>.
qp plugins
" 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 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 case $1 in
"set_file") "set_file")
if [[ -d ${2} ]] ; then if [[ -d ${2} ]] ; then
@ -58,7 +63,6 @@ function qp()
fi;; fi;;
"has"|"set"|"get"|"unset_file") "has"|"set"|"get"|"unset_file")
clean_ezfio
ezfio "$@" ezfio "$@"
;; ;;
@ -67,6 +71,11 @@ function qp()
qp_set_frozen_core "$@" ${EZFIO_FILE} qp_set_frozen_core "$@" ${EZFIO_FILE}
;; ;;
"reset")
shift
qp_reset "$@" ${EZFIO_FILE}
;;
"create_ezfio_from_xyz") "create_ezfio_from_xyz")
shift shift
# Replace ':' by spaces # Replace ':' by spaces
@ -257,7 +266,7 @@ _qp_Complete()
case "${prev2}" in case "${prev2}" in
set|has|get) set|has|get)
if [[ ${prev} == "qp" ]] ; then 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 elif [[ ! -d ${EZFIO_FILE}/${prev} ]] ; then
COMPREPLY=( $(compgen -W "" -- $cur ) ) COMPREPLY=( $(compgen -W "" -- $cur ) )
else else
@ -272,6 +281,10 @@ _qp_Complete()
COMPREPLY=( $(compgen -W "-h $(cat ${QP_ROOT}/data/executables | cut -d ' ' -f 1)" -- $cur ) ) COMPREPLY=( $(compgen -W "-h $(cat ${QP_ROOT}/data/executables | cut -d ' ' -f 1)" -- $cur ) )
return 0 return 0
;; ;;
reset)
COMPREPLY=( $(compgen -W "-h -m -a -d" -- $cur ) )
return 0
;;
unset_file|set_frozen_core) unset_file|set_frozen_core)
COMPREPLY=() COMPREPLY=()
return 0 return 0
@ -291,7 +304,7 @@ _qp_Complete()
*) *)
COMPREPLY+=( $(compgen -W 'has get set unset_file edit \ COMPREPLY+=( $(compgen -W 'has get set unset_file edit \
run srun mpirun set_frozen_core \ run srun mpirun set_frozen_core \
set_mo_class ' \ reset set_mo_class ' \
-- $cur ) ) -- $cur ) )
return 0 return 0
;; ;;

View File

@ -93,10 +93,10 @@ ezfio=$1
qp set_file $ezfio qp set_file $ezfio
if [[ $dets -eq 1 ]] ; then 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 fi
set -x
if [[ $mos -eq 1 ]] ; then if [[ $mos -eq 1 ]] ; then
if [[ -f ${ezfio}/mo_basis/mo_class.gz ]] && [[ $(qp get mo_basis mo_num) -ne \ 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 $(zcat ${ezfio}/mo_basis/mo_class.gz |grep Active | wc -l) ]] ; then