Skip to content

Commit a582274

Browse files
committed
Use environment variable instead to allow OpenMPI run as root
1 parent 52a15fc commit a582274

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

source/source_lcao/module_operator_lcao/test/parallel_operator_tests.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33
np=`cat /proc/cpuinfo | grep "cpu cores" | uniq| awk '{print $NF}'`
44
echo "nprocs in this machine is $np"
55

6+
# Allow OpenMPI run as root
7+
export OMPI_ALLOW_RUN_AS_ROOT=1
8+
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
9+
610
for i in 2 3 4; do
711
if [[ $i -gt $np ]];then
812
continue
913
fi
1014
echo "TEST in parallel, nprocs=$i"
11-
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_overlap_cd_test
15+
mpirun -np $i ./MODULE_LCAO_operator_overlap_cd_test
1216
e1=$?
13-
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_overlap_test
17+
mpirun -np $i ./MODULE_LCAO_operator_overlap_test
1418
e2=$?
15-
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_ekinetic_test
19+
mpirun -np $i ./MODULE_LCAO_operator_ekinetic_test
1620
e3=$?
17-
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_nonlocal_test
21+
mpirun -np $i ./MODULE_LCAO_operator_nonlocal_test
1822
e4=$?
19-
mpirun --allow-run-as-root -np $i ./MODULE_LCAO_operator_T_NL_cd_test
23+
mpirun -np $i ./MODULE_LCAO_operator_T_NL_cd_test
2024
e5=$?
2125
if [[ $e1 -ne 0 || $e2 -ne 0 || $e3 -ne 0 || $e4 -ne 0 || $e5 -ne 0 ]]; then
2226
echo -e "\e[1;33m [ FAILED ] \e[0m"\

0 commit comments

Comments
 (0)