Skip to content

Commit ced7970

Browse files
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into develop
2 parents d8015fa + 706836c commit ced7970

File tree

24 files changed

+688
-614
lines changed

24 files changed

+688
-614
lines changed

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# To build this Dockerfile, run `docker build -t abacus - < Dockerfile`.
2-
# Pull image with `docker pull ghcr.io/deepmodeling/abacus:latest`.
2+
# Alternatively, pull the image with `docker pull ghcr.io/deepmodeling/abacus:latest`.
3+
# Also available at `docker pull registry.dp.tech/deepmodeling/abacus:latest`.
4+
5+
# Docker images are aimed for evaluating ABACUS.
6+
# For production use, please compile ABACUS from source code and run in bare-metal for a better performace.
7+
38
FROM ubuntu:22.04
49
RUN apt update && apt install -y --no-install-recommends \
510
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev \
@@ -17,10 +22,11 @@ RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
1722
# If you have trouble cloning repo, replace "github.com" with "gitee.com".
1823
CMD mpirun --use-hwthread-cpus abacus
1924

20-
# To run ABACUS built by this image with all available threads, execute `docker run -v <host>:<wd> -w <wd/input> abacus`.
25+
# To run ABACUS built by this image with all available threads, execute `docker run -v <host>:<wd> -w <wd/input> abacus:latest`.
2126
# Replace '<host>' with the path to all files(including pseudopotential files), '<wd>' with a path to working directory, and '<wd/input>' with the path to input folder(containing 'INPUT', 'STRU', etc.).
22-
# e.g. after clone the repo to `$HOME` and pulled this image, execute `docker run -v ~/abacus-develop/tests/integrate:/workspace -w /workspace/101_PW_15_f_pseudopots abacus`.
23-
# To run ABACUS with a given MPI process number, execute `docker run -v <host>:<wd> -w <wd/input> -it --entrypoint mpirun abacus -np <processes> abacus`. Note: the first "abacus" is the name of the image, the second "abacus" is the name of the executable file. Do not use '--cpus' flag of 'docker run' to specify the number of processes.
27+
# e.g. after cloning the repo to `$HOME` and pulling image, execute `docker run -v ~/abacus-develop/tests/integrate:/workspace -w /workspace/101_PW_15_f_pseudopots abacus:latest`.
28+
# To run ABACUS with a given MPI process number, execute `docker run -v <host>:<wd> -w <wd/input> -it --entrypoint mpirun abacus:latest -np <processes> abacus`.
29+
# Note: It would be better using all available CPUs. Docker uses CFS to share the CPU resources, which will result in bad CPU affinity.
2430

2531
# To use this image as developing environment, execute `docker run -it --entrypoint /bin/bash abacus`.
2632
# Please refer to https://docs.docker.com/engine/reference/commandline/run/ for more details.

Dockerfile.gnu

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@ RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-wit
1616
unzip -q libtorch.zip && rm libtorch.zip && \
1717
cd libtorch && cp -r . /usr/local && \
1818
cd .. && rm -r libtorch
19+
20+
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
21+
cd abacus-develop && \
22+
cmake -B build -DENABLE_DEEPKS=ON && \
23+
cmake --build build -j`nproc` && \
24+
cmake --install build && \
25+
cd .. && rm -rf abacus-develop

Dockerfile.intel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,16 @@ RUN source /opt/intel/oneapi/setvars.sh \
4747
&& make PREFIX=/usr/local install \
4848
&& ln -s /usr/local/include/elpa-2021.05.002/elpa /usr/local/include/ \
4949
&& cd /tmp && rm -rf elpa-2021.05.002
50+
51+
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip \
52+
--no-check-certificate --quiet -O libtorch.zip && \
53+
unzip -q libtorch.zip && rm libtorch.zip && \
54+
cd libtorch && cp -r . /usr/local && \
55+
cd .. && rm -r libtorch
56+
57+
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
58+
cd abacus-develop && \
59+
cmake -B build -DENABLE_DEEPKS=ON && \
60+
cmake --build build -j`nproc` && \
61+
cmake --install build && \
62+
cd .. && rm -rf abacus-develop

docs/examples/dpgen.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ Next, for the "dpgen run" step, the following `run_param.json` should be provide
163163
"fp_pp_path": "./",
164164
"fp_pp_files": ["Al_ONCV_PBE-1.0.upf"], # the pseudopotential file
165165
"fp_orb_files": ["Al_gga_9au_100Ry_4s4p1d.orb"], # the orbital file (use only in LCAO calculation)
166+
"k_points":[2, 2, 2, 0, 0, 0], # k-mesh setting
166167
"user_fp_params":{ # All the ABACUS input paramters are defined here
167168
"ntype": 1, # defining input parameters from INPUT files is not supported yet.
168169
"ecutwfc": 80,
@@ -175,7 +176,6 @@ Next, for the "dpgen run" step, the following `run_param.json` should be provide
175176
"smearing_sigma": 0.002,
176177
"scf_thr":1e-8,
177178
"cal_force":1, # calculate force must be set to 1 in dpgen calculation
178-
"k_points":[2, 2, 2, 0, 0, 0], # k-mesh setting
179179
"kspacing": 0.01 # when KSPACING is set, the above k_points setting becomes invalid.
180180
}
181181
}
@@ -186,4 +186,4 @@ Notes:
186186
- The ABACUS-DPGEN interface can be used in both pw and lcao basis.
187187

188188

189-
[back to top](#abacus-wannier90-interface)
189+
[back to top](#abacus-wannier90-interface)

source/input.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,9 +1851,21 @@ bool Input::Read(const std::string &fn)
18511851
}
18521852
}
18531853

1854-
if (basis_type == "pw") // pengfei Li add 2015-1-31
1854+
if (basis_type == "pw" && gamma_only !=0) // pengfei Li add 2015-1-31
18551855
{
18561856
gamma_only = 0;
1857+
GlobalV::ofs_running << " WARNING : gamma_only has not been implemented for pw yet" << std::endl;
1858+
GlobalV::ofs_running << " the INPUT parameter gamma_only has been reset to 0" << std::endl;
1859+
GlobalV::ofs_running << " and a new KPT is generated with gamma point as the only k point" << std::endl;
1860+
1861+
GlobalV::ofs_warning << " Auto generating k-points file: " << GlobalV::global_kpoint_card << std::endl;
1862+
std::ofstream ofs(GlobalV::global_kpoint_card.c_str());
1863+
ofs << "K_POINTS" << std::endl;
1864+
ofs << "0" << std::endl;
1865+
ofs << "Gamma" << std::endl;
1866+
ofs << "1 1 1 0 0 0" << std::endl;
1867+
ofs.close();
1868+
18571869
// std::cout << "gamma_only =" << gamma_only << std::endl;
18581870
}
18591871
else if ((basis_type == "lcao" || basis_type == "lcao_in_pw") && (gamma_only == 1))

source/input_conv.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "module_base/global_function.h"
55
#include "module_base/global_variable.h"
66
#include "module_cell/unitcell.h"
7+
#include "module_surchem/surchem.h"
78
#include "module_symmetry/symmetry.h"
89
#include "src_io/berryphase.h"
910
#include "src_io/chi0_hilbert.h"
@@ -14,7 +15,6 @@
1415
#include "src_ions/ions_move_basic.h"
1516
#include "src_pw/global.h"
1617
#include "src_pw/occupy.h"
17-
#include "module_surchem/surchem.h"
1818
#ifdef __EXX
1919
#include "src_ri/exx_abfs-jle.h"
2020
#endif
@@ -27,10 +27,9 @@
2727
#include "src_lcao/local_orbital_charge.h"
2828
#endif
2929
#include "module_base/timer.h"
30-
#include "module_surchem/efield.h"
31-
3230
#include "module_elecstate/elecstate_lcao.h"
3331
#include "module_hsolver/hsolver_lcao.h"
32+
#include "module_surchem/efield.h"
3433

3534
void Input_Conv::Convert(void)
3635
{
@@ -97,6 +96,7 @@ void Input_Conv::Convert(void)
9796
Ions_Move_Basic::relax_bfgs_rmin = INPUT.relax_bfgs_rmin;
9897
Ions_Move_Basic::relax_bfgs_init = INPUT.relax_bfgs_init;
9998
Ions_Move_Basic::out_stru = INPUT.out_stru; // mohan add 2012-03-23
99+
Lattice_Change_Basic::out_stru = INPUT.out_stru;
100100

101101
GlobalV::CAL_STRESS = INPUT.cal_stress;
102102

@@ -203,15 +203,15 @@ void Input_Conv::Convert(void)
203203
GlobalV::NPOL = 1;
204204
}
205205

206-
//----------------------------------------------------------
207-
// Yu Liu add 2022-05-18
208-
//----------------------------------------------------------
206+
//----------------------------------------------------------
207+
// Yu Liu add 2022-05-18
208+
//----------------------------------------------------------
209209
GlobalV::EFIELD_FLAG = INPUT.efield_flag;
210210
GlobalV::DIP_COR_FLAG = INPUT.dip_cor_flag;
211211
Efield::efield_dir = INPUT.efield_dir;
212212
Efield::efield_pos_max = INPUT.efield_pos_max;
213213
Efield::efield_pos_dec = INPUT.efield_pos_dec;
214-
Efield::efield_amp = INPUT.efield_amp ;
214+
Efield::efield_amp = INPUT.efield_amp;
215215

216216
//----------------------------------------------------------
217217
// Fuxiang He add 2016-10-26
@@ -308,7 +308,7 @@ void Input_Conv::Convert(void)
308308
if (GlobalV::MY_RANK == 0)
309309
system(command0.c_str());
310310
if (INPUT.dft_functional == "hf" || INPUT.dft_functional == "pbe0" || INPUT.dft_functional == "hse"
311-
|| INPUT.dft_functional == "opt_orb" || INPUT.dft_functional == "scan0" )
311+
|| INPUT.dft_functional == "opt_orb" || INPUT.dft_functional == "scan0")
312312
{
313313
GlobalC::restart.info_save.save_charge = true;
314314
GlobalC::restart.info_save.save_H = true;
@@ -449,7 +449,7 @@ void Input_Conv::Convert(void)
449449
hsolver::HSolverLCAO::out_mat_hs = INPUT.out_mat_hs;
450450
hsolver::HSolverLCAO::out_mat_hsR = INPUT.out_mat_hs2; // LiuXh add 2019-07-16
451451
elecstate::ElecStateLCAO::out_wfc_lcao = INPUT.out_wfc_lcao;
452-
if(INPUT.calculation == "nscf" && !INPUT.towannier90 && !INPUT.berry_phase)
452+
if (INPUT.calculation == "nscf" && !INPUT.towannier90 && !INPUT.berry_phase)
453453
{
454454
elecstate::ElecStateLCAO::need_psi_grid = false;
455455
}

0 commit comments

Comments
 (0)