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
5 changes: 5 additions & 0 deletions source/module_base/test_parallel/blacs_connector_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./blacs_connector
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done

5 changes: 5 additions & 0 deletions source/module_base/test_parallel/parallel_2d_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ for i in 2 3 4; do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./parallel_2d_test
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
done
5 changes: 5 additions & 0 deletions source/module_base/test_parallel/parallel_common_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 3;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./base_ParaCommon
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 5 additions & 0 deletions source/module_base/test_parallel/parallel_global_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./base_ParaGlobal
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 4 additions & 1 deletion source/module_base/test_parallel/parallel_reduce_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ TEST_F(ParaReduce, GatherIntAll)
/// printf("post rank %d array[%d] = %d, min = %d \n",
/// my_rank,i,array[i],min_number);
}
delete[] array;
}

TEST_F(ParaReduce, GatherDoubleAll)
Expand All @@ -266,6 +267,7 @@ TEST_F(ParaReduce, GatherDoubleAll)
/// printf("post rank %d array[%d] = %f, min = %f, max = %f \n",
/// my_rank,i,array[i],min_number,max_number);
}
delete[] array;
}

TEST_F(ParaReduce, ReduceIntDiag)
Expand Down Expand Up @@ -306,6 +308,7 @@ TEST_F(ParaReduce, ReduceIntDiag)
/// my_rank,mpiContext.dsize,diag_sum_first, diag_sum_second);
EXPECT_EQ(diag_sum_first, diag_sum_second);
delete[] rand_array;
delete[] swap;
MPI_Comm_free(&DIAG_WORLD);
}
}
Expand Down Expand Up @@ -595,7 +598,7 @@ TEST_F(ParaReduce, GatherDoublePool)
/// printf("post rank %d, pool rank %d, array[%d] = %f, min = %f, max = %f \n",
/// my_rank,mpiContext.rank_in_pool,i,array[i],min_number,max_number);
}

delete[] array;
MPI_Comm_free(&POOL_WORLD);
}
}
Expand Down
5 changes: 5 additions & 0 deletions source/module_base/test_parallel/parallel_reduce_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./base_ParaReduce
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 5 additions & 0 deletions source/module_basis/module_ao/test/parallel_orbitals_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ for i in 2 3 4; do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./parallel_orbitals_test
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
done
3 changes: 3 additions & 0 deletions source/module_cell/test/atom_spec_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,15 @@ TEST_F(AtomSpecTest, BcastAtom)
atom.mass = 12.0;
atom.tau.resize(atom.na);
atom.taud.resize(atom.na);
atom.dis.resize(atom.na);
atom.vel.resize(atom.na);
atom.mag.resize(atom.na);
atom.angle1.resize(atom.na);
atom.angle2.resize(atom.na);
atom.m_loc_.resize(atom.na);
atom.mbl.resize(atom.na);
atom.lambda.resize(atom.na);
atom.constrain.resize(atom.na);
atom.tau[0].x = 0.2;
atom.tau[0].y = 0.2;
atom.tau[0].z = 0.2;
Expand Down
5 changes: 5 additions & 0 deletions source/module_cell/test/bcast_atom_pseudo_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./cell_atom_pseudo
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 5 additions & 0 deletions source/module_cell/test/bcast_atom_spec_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./cell_atom_spec
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 5 additions & 0 deletions source/module_cell/test/klist_test_para.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./cell_klist_test_para1
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
2 changes: 2 additions & 0 deletions source/module_cell/test/prepare_unitcell.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class UcellTestPrepare
ucell->atoms[it].angle2.resize(ucell->atoms[it].na);
ucell->atoms[it].m_loc_.resize(ucell->atoms[it].na);
ucell->atoms[it].mbl.resize(ucell->atoms[it].na);
ucell->atoms[it].lambda.resize(ucell->atoms[it].na);
ucell->atoms[it].constrain.resize(ucell->atoms[it].na);
ucell->atoms[it].mass = ucell->atom_mass[it]; // mass set here
for(int ia=0; ia<ucell->atoms[it].na; ++ia)
{
Expand Down
5 changes: 5 additions & 0 deletions source/module_cell/test/unitcell_test_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./cell_unitcell_test_para
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 5 additions & 0 deletions source/module_cell/test_pw/unitcell_test_pw_para.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./cell_unitcell_test_pw
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ for i in 2 3 4; do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./operator_overlap_cd_test
e1=$?
mpirun -np $i ./operator_overlap_test
e2=$?
mpirun -np $i ./operator_ekinetic_test
e3=$?
mpirun -np $i ./operator_nonlocal_test
e4=$?
mpirun -np $i ./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"\
"execute UT with $i cores error."
exit 1
fi
done
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ for i in 2 3 4; do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./hcontainer_transfer_test
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
done
2 changes: 0 additions & 2 deletions source/module_hsolver/test/diago_cg_float_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ class DiagoCGPrepare
int ik = 1;
hamilt::Hamilt<std::complex<float>>* ha;
ha =new hamilt::HamiltPW<std::complex<float>>(nullptr, nullptr, nullptr, nullptr,nullptr);
int* ngk = new int [1];
//psi::Psi<std::complex<float>> psi(ngk,ik,nband,npw);
psi::Psi<std::complex<float>> psi;
psi.resize(ik,nband,npw);
//psi.fix_k(0);
Expand Down
4 changes: 3 additions & 1 deletion source/module_hsolver/test/diago_cg_parallel_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ for i in 6 3 2;do
fi
echo "TEST DIAGO CG in parallel, nprocs=$i"
OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_cg
e1=$?
OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_cg_float
if [[ $? != 0 ]];then
e2=$?
if [[ e1 -ne 0 || e2 -ne 0 ]];then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
Expand Down
2 changes: 0 additions & 2 deletions source/module_hsolver/test/diago_cg_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ class DiagoCGPrepare
int ik = 1;
hamilt::Hamilt<std::complex<double>>* ha;
ha =new hamilt::HamiltPW<std::complex<double>>(nullptr, nullptr, nullptr, nullptr,nullptr);
int* ngk = new int [1];
//psi::Psi<std::complex<double>> psi(ngk,ik,nband,npw);
psi::Psi<std::complex<double>> psi;
psi.resize(ik,nband,npw);
//psi.fix_k(0);
Expand Down
4 changes: 3 additions & 1 deletion source/module_hsolver/test/diago_david_parallel_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ for i in 6 3 2;do
fi
echo "TEST DIAGO davidson in parallel, nprocs=$i"
OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_dav
e1=$?
OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_dav_float
if [[ $? != 0 ]];then
e2=$?
if [[ e1 -ne 0 || e2 -ne 0 ]];then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
Expand Down
1 change: 1 addition & 0 deletions source/module_hsolver/test/parallel_k2d_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ TEST_P(ParallelK2DTest, DividePools) {
EXPECT_EQ(k2d.get_p2D_pool()->get_col_size(), 5);
k2d.set_kpar(10);
EXPECT_EQ(k2d.get_kpar(), 10);
k2d.unset_para_env();
}
//delete k2d.Pkpoints;
//delete k2d.get_p2D_pool();
Expand Down
5 changes: 5 additions & 0 deletions source/module_hsolver/test/parallel_k2d_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 8;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./hsolver_parak2d_test
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
5 changes: 5 additions & 0 deletions source/module_io/test/write_wfc_nao_para.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ for i in 4;do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./io_write_wfc_nao
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33m [ FAILED ] \e[0m"\
"execute UT with $i cores error."
exit 1
fi
break
done
Loading