5#ifndef PARALLEL_KPOINTS_H
6#define PARALLEL_KPOINTS_H
39 void kinfo(
int& nkstot_in,
41 const int& my_pool_in,
42 const int& rank_in_pool_in,
87 template <
class T,
class V>
A basic type of data for complex array.
Definition complexarray.h:15
3 elements vector
Definition vector3.h:21
double float array
Definition realarray.h:21
void get_whichpool(const int &nkstot)
Get which pool each k-point belongs to.
Definition parallel_kpoints.cpp:51
void get_nks_pool(const int &nkstot)
Get number of k-points in each pool.
Definition parallel_kpoints.cpp:67
Parallel_Kpoints()
Default constructor.
Definition parallel_kpoints.h:22
~Parallel_Kpoints()
Destructor.
Definition parallel_kpoints.h:27
void pool_collection(double &value, const double *wk, const int &ik)
Collect value from each pool to wk.
Definition parallel_kpoints.cpp:140
void set_startpro_pool()
Set first processor for each pool.
Definition parallel_kpoints.cpp:97
int nspin
number of spins
Definition parallel_kpoints.h:134
std::vector< int > whichpool
whichpool[k]: the pool which k belongs to, dim: nkstot_np
Definition parallel_kpoints.h:104
void kinfo(int &nkstot_in, const int &kpar_in, const int &my_pool_in, const int &rank_in_pool_in, const int &nproc_in, const int &nspin_in)
Initialize k-point parallelization information.
Definition parallel_kpoints.cpp:11
int nkstot_np
number of k-points without spin
Definition parallel_kpoints.h:106
std::vector< int > nks_pool
K-point information.
Definition parallel_kpoints.h:102
int get_startpro_pool(const int &pool) const
Get the first processor in the pool.
Definition parallel_kpoints.h:115
int nks_np
number of k-points without spin in the present pool
Definition parallel_kpoints.h:107
void pool_collection_aux(T *value, const V &w, const int &dim, const int &ik) const
Auxiliary template function for pool collection.
Definition parallel_kpoints.cpp:212
int nproc
number of processors
Definition parallel_kpoints.h:133
std::vector< int > startpro_pool
the first processor in each pool
Definition parallel_kpoints.h:137
int kpar
number of pools
Definition parallel_kpoints.h:130
std::vector< int > startk_pool
the first k-point in each pool (without spin)
Definition parallel_kpoints.h:103
void gatherkvec(const std::vector< ModuleBase::Vector3< double > > &vec_local, std::vector< ModuleBase::Vector3< double > > &vec_global) const
Gather k-points from all processors.
Definition parallel_kpoints.cpp:117
int get_max_nks_pool() const
Get the maximum number of k-points in all pools.
Definition parallel_kpoints.h:124
int my_pool
the pool index of the present processor
Definition parallel_kpoints.h:131
int rank_in_pool
the rank in the present pool
Definition parallel_kpoints.h:132
void get_startk_pool(const int &nkstot)
Get start k-point index for each pool.
Definition parallel_kpoints.cpp:85
#define T
Definition exp.cpp:237