Skip to content

Commit 73258dd

Browse files
committed
fix compiling fail after merging
1 parent f433ed1 commit 73258dd

File tree

7 files changed

+19
-20
lines changed

7 files changed

+19
-20
lines changed

source/module_hsolver/test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ AddTest(
55
LIBS ${math_libs} base
66
SOURCES diago_cg_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../../module_hamilt/hamilt_pw.cpp
77
../../module_psi/psi.cpp ../../src_parallel/parallel_reduce.cpp
8-
../../src_parallel/parallel_global.cpp ../../module_pw/unittest/test_tool.cpp
8+
../../src_parallel/parallel_global.cpp ../../module_pw/test/test_tool.cpp
99
)
1010
AddTest(
1111
TARGET HSolver_dav
1212
LIBS ${math_libs} base
1313
SOURCES diago_david_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../../module_hamilt/hamilt_pw.cpp
1414
../../module_psi/psi.cpp ../../src_parallel/parallel_reduce.cpp ../../src_parallel/parallel_global.cpp
15-
../../module_pw/unittest/test_tool.cpp
15+
../../module_pw/test/test_tool.cpp
1616
)
1717
AddTest(
1818
TARGET HSolver_LCAO

source/module_hsolver/test/diago_cg_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "../diago_iter_assist.h"
99
#include "diago_mock.h"
1010
#include "mpi.h"
11-
#include "module_pw/unittest/test_tool.h"
11+
#include "module_pw/test/test_tool.h"
1212
#include <complex>
1313

1414
#include "gtest/gtest.h"

source/module_hsolver/test/diago_david_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include"gtest/gtest.h"
88
#include "module_base/inverse_matrix.h"
99
#include "module_base/lapack_connector.h"
10-
#include "module_pw/unittest/test_tool.h"
10+
#include "module_pw/test/test_tool.h"
1111
#include"mpi.h"
1212

1313
#define CONVTHRESHOLD 1e-3

source/module_pw/test/pw_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class TestEnv : public testing::Environment
3333
int main(int argc, char **argv)
3434
{
3535

36-
int npool;
37-
npool = 1;
36+
int kpar;
37+
kpar = 1;
3838
#ifdef __MPI
3939
int nproc, myrank,mypool;
4040
setupmpi(argc,argv,nproc, myrank);
41-
divide_pools(nproc, myrank, nproc_in_pool, npool, mypool, rank_in_pool);
41+
divide_pools(nproc, myrank, nproc_in_pool, kpar, mypool, rank_in_pool);
4242
#else
43-
nproc_in_pool = npool = 1;
43+
nproc_in_pool = kpar = 1;
4444
rank_in_pool = 0;
4545
#endif
4646
int result = 0;

source/module_pw/test/test_tool.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void setupmpi(int argc,char **argv,int &nproc, int &myrank)
1818
MPI_Aint dipc[2]={0,sizeof(double)};
1919

2020
// MPI_Type_struct: create a struct datatype
21-
MPI_Type_struct(
21+
MPI_Type_create_struct(
2222
2,// count: number of blocks(integer)
2323
ac,//number of element in each block(array)
2424
dipc,//byte displacement of each block
@@ -30,36 +30,36 @@ void setupmpi(int argc,char **argv,int &nproc, int &myrank)
3030
}
3131

3232

33-
void divide_pools(const int &nproc, const int &myrank, int &nproc_in_pool, int &npool, int&mypool, int &rank_in_pool)
33+
void divide_pools(const int &nproc, const int &myrank, int &nproc_in_pool, int &kpar, int&mypool, int &rank_in_pool)
3434
{
35-
nproc_in_pool = nproc/npool;
36-
if (myrank < (nproc%npool)*(nproc_in_pool+1))
35+
nproc_in_pool = nproc/kpar;
36+
if (myrank < (nproc%kpar)*(nproc_in_pool+1))
3737
{
3838
nproc_in_pool++;
3939
}
4040

41-
int *nproc_pool = new int[npool];
42-
int *startpro_pool = new int[npool];
43-
for(int ip = 0 ; ip < npool ; ++ip)
41+
int *nproc_pool = new int[kpar];
42+
int *startpro_pool = new int[kpar];
43+
for(int ip = 0 ; ip < kpar ; ++ip)
4444
{
4545
nproc_pool[ip] = 0;
4646
startpro_pool[ip] = 0;
4747
}
4848

4949
for (int i=0; i<nproc; i++)
5050
{
51-
int j = i%npool;
51+
int j = i%kpar;
5252
nproc_pool[j]++;
5353
}
5454

5555
// (3) To know start proc index in each pool.
56-
for (int i=1; i<npool; i++)
56+
for (int i=1; i<kpar; i++)
5757
{
5858
startpro_pool[i]=startpro_pool[i-1]+nproc_pool[i-1];
5959
}
6060

6161
// use 'myrank' to know 'mypool'.
62-
for (int i=0; i<npool; i++)
62+
for (int i=0; i<kpar; i++)
6363
{
6464
if (myrank >= startpro_pool[i])
6565
{

source/module_pw/test/test_tool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
void setupmpi(int argc,char **argv,int &nproc, int &myrank);
2-
void divide_pools(const int &nproc, const int &myrank,int &nproc_in_pool, int &npool, int&mypool, int &rank_in_pool);
2+
void divide_pools(const int &nproc, const int &myrank,int &nproc_in_pool, int &kpar, int&mypool, int &rank_in_pool);
33
void finishmpi();

source/src_pw/sto_wf.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ void Init_Com_Orbitals(Stochastic_WF& stowf, K_Vectors& kv)
111111
else igroup = GlobalV::NSTOGROUP - GlobalV::MY_STOGROUP - 1;
112112

113113
const int nks = kv.nks;
114-
const int npool = GlobalV::KPAR;
115114
const int ngroup = GlobalV::NSTOGROUP;
116115
const int n_in_pool = GlobalV::NPROC_IN_POOL;
117116
const int i_in_group = GlobalV::RANK_IN_STOGROUP;

0 commit comments

Comments
 (0)