The tested functions are wrappers of MPI_Bcast in ABACUS, as defined in source_base/parallel_common.h. The source is process 0 in all MPI_Bcast wrappers.
The tested functions are: i. Parallel_Global::split_diag_world(), which is used in David diagonalization in pw basis calculation. ii. Parallel_Global::split_grid_world() iii. Parallel_Global::MyProd(std::complex<double> *in,std::complex<double> *inout,int *len,MPI_Datatype *dptr); iv. Parallel_Global::init_pools(); v. Parallel_Global::divide_pools(void);
The tested functions are mainly wrappers of MPI_Allreduce and MPI_Allgather in ABACUS, as defined in source_base/ parallel_reduce.h.
The logic to test MPI_Allreduce wrapper functions is to calculate the sum of the total array in two ways, one by using MPI_Allreduce with only 1 number, another one by using MPI_Allreduce with n numbers. The total array is deemed as the sum of local arrays with the same length.
- ReduceIntAll: Tests two variations of reduce_all()
- ReduceDoubleAll: Tests two variations of reduce_all()
- ReduceComplexAll: Tests two variations of reduce_complex_all()
- GatherIntAll: Tests gather_int_all() and gather_min_int_all()
- GatherDoubleAll: Tests gather_min_double_all() and gather_max_double_all()
- ReduceIntDiag: Tests reduce_int_diag()
- ReduceDoubleDiag: Tests reduce_double_diag()
- ReduceIntGrid: Tests reduce_int_grid()
- ReduceDoubleGrid: Tests reduce_double_grid() 10.ReduceDoublePool: Tests two variations of reduce_pool() and two variations of reduce_double_allpool() 11.ReduceComplexPool: Tests two variations of reduce_pool() 12.GatherDoublePool: Tests gather_min_double_pool() and gather_max_double_pool()
The tested functions: i. Parallel_Global::init_pools() is the public interface to call the private function Parallel_Global::divide_pools(), which divide all processes into KPAR groups. ii.Parallel_Kpoints::kinf() is the public interface to call another three functions: get_nks_pool(), get_startk_pool(), get_whichpool(), which divide all kpoints into KPAR groups. iii.Parallel_Kpoints::gatherkvec() is an interface to gather kpoints vectors from all processors. The default number of processes is set to 4 in parallel_kpoints_test.sh. One may modify it to do more tests, or adapt this unittest to local environment.
Test fixture for class Parallel_K2D