Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@
np=`cat /proc/cpuinfo | grep "cpu cores" | uniq| awk '{print $NF}'`
echo "nprocs in this machine is $np"

# Allow OpenMPI run as root
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

for i in 2 3 4; do
if [[ $i -gt $np ]];then
continue
fi
echo "TEST in parallel, nprocs=$i"
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_overlap_cd_test
mpirun -np $i ./MODULE_LCAO_operator_overlap_cd_test
e1=$?
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_overlap_test
mpirun -np $i ./MODULE_LCAO_operator_overlap_test
e2=$?
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_ekinetic_test
mpirun -np $i ./MODULE_LCAO_operator_ekinetic_test
e3=$?
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_nonlocal_test
mpirun -np $i ./MODULE_LCAO_operator_nonlocal_test
e4=$?
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_T_NL_cd_test
mpirun -np $i ./MODULE_LCAO_operator_T_NL_cd_test
e5=$?
if [[ $e1 -ne 0 || $e2 -ne 0 || $e3 -ne 0 || $e4 -ne 0 || $e5 -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
Expand Down
8 changes: 6 additions & 2 deletions tests/17_DS_DFTU/run_scf_nscf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ MPI_NP="${2:-4}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEST_DIR="$(pwd)"

# Allow OpenMPI run as root
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

echo "========================================"
echo " SCF + NSCF Workflow"
echo "========================================"
Expand Down Expand Up @@ -94,7 +98,7 @@ echo "-----------------"
echo ""
echo "[1/4] Running SCF calculation..."
cd "${SCF_DIR}"
mpirun -np ${MPI_NP} --allow-run-as-root "${ABACUS}" > scf.log 2>&1 || {
mpirun -np ${MPI_NP} "${ABACUS}" > scf.log 2>&1 || {
echo "ERROR: SCF calculation failed!"
echo "Check ${SCF_DIR}/scf.log for details"
cd "${TEST_DIR}"
Expand Down Expand Up @@ -146,7 +150,7 @@ fi
# Step 4: Run NSCF calculation
# -------------------------------------------------------
echo "[3/4] Running NSCF calculation..."
mpirun -np ${MPI_NP} --allow-run-as-root "${ABACUS}" > nscf.log 2>&1 || {
mpirun -np ${MPI_NP} "${ABACUS}" > nscf.log 2>&1 || {
echo "ERROR: NSCF calculation failed!"
echo "Check ${TEST_DIR}/nscf.log for details"
exit 1
Expand Down
Loading