Skip to content

Commit 977dc41

Browse files
authored
Merge branch 'develop' into mtblas
2 parents c859d54 + 8a02642 commit 977dc41

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

docs/advanced/input_files/kpt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ABACUS uses periodic boundary conditions for both crystals and finite systems. F
88

99
## Gamma-only Calculations
1010

11-
In ABACUS, we offer th option of running gamma-only calculations for LCAO basis by setting [gamma_only](./input-main.md#gamma_only) to be 1. Due to details of implementation, gamma-only calculation will be slightly faster than running a non gamma-only calculation and explicitly setting gamma point to be the only the k-point, but the results should be consistent.
11+
In ABACUS, we offer the option of running gamma-only calculations for LCAO basis by setting [gamma_only](./input-main.md#gamma_only) to be 1. Due to details of implementation, gamma-only calculation will be slightly faster than running a non gamma-only calculation and explicitly setting gamma point to be the only the k-point, but the results should be consistent.
1212

1313
> If gamma_only is set to 1, the KPT file will be overwritten. So make sure to turn off gamma_only for multi-k calculations.
1414
@@ -23,7 +23,7 @@ method to generate k-mesh, and the following is an example input k-point (`KPT`)
2323
K_POINTS //keyword for start
2424
0 //total number of k-point, `0' means generate automatically
2525
Gamma //which kind of Monkhorst-Pack method, `Gamma' or `MP'
26-
2 2 2 0 0 0 //first three number: subdivisions along recpri. vectors
26+
2 2 2 0 0 0 //first three number: subdivisions along reciprocal vectors
2727
//last three number: shift of the mesh
2828
```
2929

@@ -63,8 +63,8 @@ Direct //`Direct' or `Cartesian' coordinate
6363
## Band structure calculations
6464

6565
ABACUS uses specified high-symmetry directions of the Brillouin zone for band structure
66-
calculations. The third line of k-point file should start with Line or Line_Cartesian for
67-
line mode. Line means the positions below are in Direct coordinates, while Line_Cartesian
66+
calculations. The third line of k-point file should start with 'Line' or 'Line_Cartesian' for
67+
line mode. 'Line' means the positions below are in Direct coordinates, while 'Line_Cartesian'
6868
means in Cartesian coordinates:
6969

7070
```

source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void gint_vl_gpu(hamilt::HContainer<double>* hRGint,
4747
checkCuda(cudaStreamCreate(&streams[i]));
4848
}
4949

50-
Cuda_Mem_Wrapper<double> grid_vlocal_g(hRGint->get_nnr(), 1, false);
50+
const int nnrg = is_gamma_only ? hRGint->get_nnr() : gridt.nnrg;
51+
Cuda_Mem_Wrapper<double> grid_vlocal_g(nnrg, 1, false);
5152
grid_vlocal_g.memset_device_sync();
5253

5354
Cuda_Mem_Wrapper<double> dr_part(max_atom_per_z * 3, num_streams, true);
@@ -189,15 +190,15 @@ void gint_vl_gpu(hamilt::HContainer<double>* hRGint,
189190
checkCuda(cudaMemcpy(
190191
hRGint->get_wrapper(),
191192
grid_vlocal_g.get_device_pointer(),
192-
hRGint->get_nnr() * sizeof(double),
193+
nnrg * sizeof(double),
193194
cudaMemcpyDeviceToHost));
194195
}
195196
else
196197
{
197198
checkCuda(cudaMemcpy(
198199
pvpR,
199200
grid_vlocal_g.get_device_pointer(),
200-
hRGint->get_nnr() * sizeof(double),
201+
nnrg * sizeof(double),
201202
cudaMemcpyDeviceToHost));
202203
}
203204
for (int i = 0; i < num_streams; i++)

source/module_hsolver/diago_elpa_native.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ void DiagoElpaNative<T>::diag_pool(hamilt::MatrixBlock<T>& h_mat,
8181
// elpa_init(20210430);
8282
int success;
8383
elpa_t handle = elpa_allocate(&success);
84+
#ifdef _OPENMP
8485
int num_threads = omp_get_max_threads();
86+
#else
87+
int num_threads = 1;
88+
#endif
8589
elpa_set(handle, "omp_threads", num_threads, &success);
8690
elpa_set(handle, "na", (int)nFull, &success);
8791
elpa_set(handle, "nev", (int)nev, &success);

0 commit comments

Comments
 (0)