2017-02-19 08:05:55 +08:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright (C) 2001 Quantum ESPRESSO
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License. See the file `License' in the root directory
|
2016-06-08 18:56:31 +08:00
|
|
|
# of the present distribution.
|
|
|
|
|
2017-02-19 08:05:55 +08:00
|
|
|
|
2016-06-08 18:56:31 +08:00
|
|
|
if [[ $QE_USE_MPI == 1 ]]; then
|
|
|
|
export PARA_PREFIX="mpirun -np ${TESTCODE_NPROCS}"
|
2016-06-22 02:21:53 +08:00
|
|
|
export PARA_SUFFIX="-npool ${TESTCODE_NPROCS}"
|
2016-06-08 18:56:31 +08:00
|
|
|
else
|
|
|
|
unset PARA_PREFIX
|
2016-06-22 02:21:53 +08:00
|
|
|
unset PARA_SUFFIX
|
2016-06-08 18:56:31 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo $0" "$@
|
2021-06-10 16:06:34 +08:00
|
|
|
if [[ "$1" == "0" ]]
|
|
|
|
then
|
|
|
|
echo "Running PW ..."
|
|
|
|
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/pw.x -input $2 > $3 2> $4"
|
|
|
|
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/pw.x -input $2 > $3 2> $4
|
|
|
|
if [[ -e CRASH ]]
|
|
|
|
then
|
|
|
|
cat $3
|
|
|
|
fi
|
|
|
|
elif [[ "$1" == "1" ]]
|
2016-06-08 18:56:31 +08:00
|
|
|
then
|
2016-06-21 21:48:08 +08:00
|
|
|
echo "Running PW ..."
|
2019-11-27 00:14:32 +08:00
|
|
|
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/pw.x ${PARA_SUFFIX} -input $2 > $3 2> $4"
|
|
|
|
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/pw.x ${PARA_SUFFIX} -input $2 > $3 2> $4
|
2016-08-10 17:23:35 +08:00
|
|
|
if [[ -e CRASH ]]
|
|
|
|
then
|
|
|
|
cat $3
|
2021-06-10 16:06:34 +08:00
|
|
|
fi
|
2016-06-08 18:56:31 +08:00
|
|
|
elif [[ "$1" == "2" ]]
|
|
|
|
then
|
2016-06-21 21:48:08 +08:00
|
|
|
echo "Running PH ..."
|
2021-06-10 16:06:34 +08:00
|
|
|
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/ph.x -input $2 > $3 2> $4"
|
2019-11-27 00:14:32 +08:00
|
|
|
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/ph.x -input $2 > $3 2> $4
|
2016-08-10 17:23:35 +08:00
|
|
|
if [[ -e CRASH ]]
|
|
|
|
then
|
|
|
|
cat $3
|
|
|
|
fi
|
2021-06-10 16:06:34 +08:00
|
|
|
echo "Gather results in save"
|
2020-07-05 22:35:02 +08:00
|
|
|
python3 ../../EPW/bin/pp.py < pp.in
|
2016-06-08 18:56:31 +08:00
|
|
|
elif [[ "$1" == "3" ]]
|
|
|
|
then
|
2016-06-21 21:48:08 +08:00
|
|
|
echo "Running EPW ..."
|
2021-06-10 16:06:34 +08:00
|
|
|
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/epw.x ${PARA_SUFFIX} -input $2 > $3 2> $4"
|
2019-11-27 00:14:32 +08:00
|
|
|
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/epw.x ${PARA_SUFFIX} -input $2 > $3 2> $4
|
2016-08-10 17:23:35 +08:00
|
|
|
if [[ -e CRASH ]]
|
|
|
|
then
|
|
|
|
cat $3
|
|
|
|
fi
|
2018-02-16 03:00:55 +08:00
|
|
|
elif [[ "$1" == "4" ]]
|
|
|
|
then
|
|
|
|
echo "Running Q2R ..."
|
2021-06-10 16:06:34 +08:00
|
|
|
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/q2r.x -input $2 > $3 2> $4"
|
2019-11-27 00:14:32 +08:00
|
|
|
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/q2r.x -input $2 > $3 2> $4
|
2018-02-16 03:00:55 +08:00
|
|
|
if [[ -e CRASH ]]
|
|
|
|
then
|
|
|
|
cat $3
|
|
|
|
fi
|
2021-06-10 16:06:34 +08:00
|
|
|
echo "Gather results in save"
|
2020-07-05 22:35:02 +08:00
|
|
|
python3 ../../EPW/bin/pp.py < pp.in
|
2019-02-28 02:14:19 +08:00
|
|
|
elif [[ "$1" == "5" ]]
|
|
|
|
then
|
|
|
|
echo "Removing restart files ..."
|
|
|
|
echo "Running EPW ..."
|
2020-05-30 06:28:09 +08:00
|
|
|
###### rm *.Fin_restart1 *.Fin_restartcb1 restart.fmt
|
|
|
|
rm restart.fmt
|
2021-06-10 16:06:34 +08:00
|
|
|
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/epw.x ${PARA_SUFFIX} -input $2 > $3 2> $4"
|
2019-11-27 00:14:32 +08:00
|
|
|
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/epw.x ${PARA_SUFFIX} -input $2 > $3 2> $4
|
2019-02-28 02:14:19 +08:00
|
|
|
if [[ -e CRASH ]]
|
|
|
|
then
|
|
|
|
cat $3
|
|
|
|
fi
|
2016-06-08 18:56:31 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
#rm -f input_tmp.in
|