Skip to content

Commit e893d10

Browse files
committed
add liy,riy
1 parent 6f7b540 commit e893d10

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

source/module_pw/pw_basis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class PW_Basis
184184
// FFT dimensions for wave functions.
185185
int nx, ny, nz, nxyz, nxy;
186186
int bigny, bignxyz, bignxy; // Gamma_only: ny = int(bigny/2)-1 , others: ny = bigny
187+
int liy,riy;// liy: the left edge of the pw ball; riy: the right edge of the pw ball
187188
int maxgrids; // max between nz * ns and bignxy * nplane
188189
FFT ft;
189190

source/module_pw/pw_distributeg_method1.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ void PW_Basis::collect_st(
224224
iy_start = 0;
225225
iy_end = this->ny - 1;
226226
}
227+
this->liy = this->riy = 0;
227228
for (int ix = -ibox[0]; ix <= ibox[0]; ++ix)
228229
{
229230
for (int iy = iy_start; iy <= iy_end; ++iy)
@@ -258,14 +259,17 @@ void PW_Basis::collect_st(
258259
temp_st_i[is] = x;
259260
temp_st_j[is] = y;
260261
temp_st_length[is] = static_cast<double>(st_length2D[index]);
262+
if(iy < this->riy) this->riy = iy;
263+
if(iy > this->liy) this->liy = iy;
261264
++is;
262265
std::cout << "is " << is << '\n';
263266
}
264267
}
265268
}
266269
}
267270
assert(is == this->nstot);
268-
271+
if(riy <= 0) riy += this->ny;
272+
std::cout<<"liy "<<liy<<" ; riy "<<riy<<std::endl;
269273
std::cout<<"collect sticks done\n";
270274

271275
// As we will distribute the longest sticks preferentially in Step(3), we rearrange st_* in the order of length decreasing.

source/module_pw/unittest/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ FFTW_LIB = -Wl,--start-group -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -Wl
7272
# CUDA_LIB_DIR = ${CUDA_DIR}/lib64
7373
# CUDA_LIB = -L${CUDA_LIB_DIR} -lcufft -lcublas -lcudart
7474

75+
#LIBS = ${FFTW_LIB} ${CUDA_LIB} -ltcmalloc -lprofiler
7576
LIBS = ${FFTW_LIB} ${CUDA_LIB}
7677
OPTS = -I${FFTW_INCLUDE_DIR} ${HONG} -Ofast -std=c++11 -simd -m64 -qopenmp -Wall -pedantic -g
7778

source/module_pw/unittest/Makefile.gnu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ FFTW_LIB = -L${FFTW_LIB_DIR} -lfftw3 -Wl,-rpath=${FFTW_LIB_DIR}
7070
# CUDA_LIB = -L${CUDA_LIB_DIR} -lcufft -lcublas -lcudart
7171

7272
LIBS = ${FFTW_LIB} ${CUDA_LIB}
73+
#LIBS = ${FFTW_LIB} ${CUDA_LIB} -ltcmalloc -lprofiler
7374
OPTS = -I${FFTW_INCLUDE_DIR} ${HONG} -Ofast -std=c++11 -Wall -g
7475
#==========================
7576
# MAKING OPTIONS

source/module_pw/unittest/Makefile.intel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ FFTW_LIB = -Wl,--start-group -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -Wl
7272
# CUDA_LIB_DIR = ${CUDA_DIR}/lib64
7373
# CUDA_LIB = -L${CUDA_LIB_DIR} -lcufft -lcublas -lcudart
7474

75+
#LIBS = ${FFTW_LIB} ${CUDA_LIB} -ltcmalloc -lprofiler
7576
LIBS = ${FFTW_LIB} ${CUDA_LIB}
7677
OPTS = -I${FFTW_INCLUDE_DIR} ${HONG} -Ofast -std=c++11 -simd -m64 -qopenmp -Wall -pedantic -g
7778

0 commit comments

Comments
 (0)