Skip to content

Commit

Permalink
Merge pull request #2 from abacusmodeling/master
Browse files Browse the repository at this point in the history
Merge recent changes on master
  • Loading branch information
amcadmus authored Apr 22, 2021
2 parents 4e5ff6c + 397f78c commit aaaf1b5
Show file tree
Hide file tree
Showing 140 changed files with 4,753 additions and 3,682 deletions.
1 change: 1 addition & 0 deletions ABACUS.develop/examples/H2O-deepks-lcao/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ mixing_beta 0.4
out_band 0
out_descriptor 1
lmax_descriptor 2
newdm 1
4 changes: 4 additions & 0 deletions ABACUS.develop/examples/H2O-deepks-lcao/STRU
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ NUMERICAL_ORBITAL
H_gga_8au_60Ry_2s1p.orb
O_gga_7au_60Ry_2s2p1d.orb

NUMERICAL_DESCRIPTOR
jle.orb


LATTICE_CONSTANT
10

Expand Down
3 changes: 2 additions & 1 deletion ABACUS.develop/source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ memory.o\
print_info.o\
mathzone.o\
mathzone_add1.o\
math_integral.o\
integral.o \
poission.o \
polint.o \
Expand Down Expand Up @@ -153,6 +154,7 @@ LCAO_matrix.o\
LCAO_nnr.o \
LCAO_diago.o\
LCAO_evolve.o\
LCAO_descriptor.o\
ylm.o\
FORCE_STRESS.o\
FORCE_gamma.o\
Expand Down Expand Up @@ -262,7 +264,6 @@ variable_cell.o\
dftu.o\
dftu_yukawa.o\
dftu_relax.o\
lscc.o\

OBJS_COMMON=atom_spec.o \
unitcell.o \
Expand Down
26 changes: 1 addition & 25 deletions ABACUS.develop/source/README
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@

Currently we are working on optimizing the code structure of ABACUS,
implementing new functions, and adding more autotests.

-- mohan 2021-02-11

URGENT:

Ask Xiaohui Liu: all functions named with 'after_vc' should be reconstructed.
The 'FINAL_SCF' global varialble should be removed.
(condition: need to reconstruct these codes within a given time)

Ask Xiaohui Liu and Daye Zheng: We need test examples.

Ask Fuxiang He: we need to remove all TDDFT-related global variables
in global_variable.h, we need TDDFT examples.
(condition: need to reconstruct these codes within a given time)

Ask Daye Zheng: MD, force, stress modules need reconstruction

NEED TO DO:

Ask Xiaohui: we need to remove DQ and NQX in global_variable.h,
but the NQX is computed in ./src_pw/pseudopot_cell_vnl.cpp

Ask Peize: exx_lip.h and related Exx codes

QUESTION:

* in pw_basis.cpp, why ggwfc2=ggwfc if gamma_only is used?
37 changes: 29 additions & 8 deletions ABACUS.develop/source/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void Input::Default(void)
atom_file = "";//xiaohui modify 2015-02-01
kpoint_file = "";//xiaohui modify 2015-02-01
pseudo_dir = "";
read_file_dir = "auto";
pseudo_type = "auto"; // mohan add 2013-05-20 (xiaohui add 2013-06-23)
wannier_card = "";
latname = "test";
Expand Down Expand Up @@ -359,7 +360,7 @@ void Input::Default(void)
kernel_type="rpa";
eels_method=0;
absorption_method=0;
system="bulk";
system_type="bulk";
eta=0.05;
domega=0.01;
nomega=300;
Expand Down Expand Up @@ -456,7 +457,7 @@ void Input::Default(void)

cell_factor = 1.2; //LiuXh add 20180619

newDM=1; // Shen Yu add 2019/5/9
new_dm=1; // Shen Yu add 2019/5/9
mulliken=0;// qi feng add 2019/9/10

//---------------------------------------------------------- //Peize Lin add 2020-04-04
Expand Down Expand Up @@ -949,6 +950,10 @@ bool Input::Read(const string &fn)
{
read_value(ifs, restart_mode);
}
else if (strcmp("read_file_dir", word) == 0)
{
read_value(ifs, read_file_dir);
}
else if (strcmp("start_wfc", word) == 0)
{
read_value(ifs, start_wfc);
Expand Down Expand Up @@ -1404,7 +1409,7 @@ bool Input::Read(const string &fn)
}
else if (strcmp("system", word) == 0)
{
read_value(ifs, system);
read_value(ifs, system_type);
}
else if (strcmp("eta", word) == 0)
{
Expand Down Expand Up @@ -1657,7 +1662,7 @@ bool Input::Read(const string &fn)
}
else if (strcmp("newdm", word) == 0)
{
read_value(ifs, newDM);
read_value(ifs, new_dm);
}
//----------------------------------------------------------------------------------
// Xin Qu added on 2020-10-29 for DFT+U
Expand Down Expand Up @@ -2040,6 +2045,7 @@ void Input::Bcast()
Parallel_Common::bcast_double( mixing_gg0 ); //mohan add 2014-09-27

Parallel_Common::bcast_string( restart_mode );
Parallel_Common::bcast_string( read_file_dir);
Parallel_Common::bcast_string( start_wfc );
Parallel_Common::bcast_int( mem_saver );
Parallel_Common::bcast_int( printe );
Expand Down Expand Up @@ -2161,7 +2167,7 @@ void Input::Bcast()
Parallel_Common::bcast_string( kernel_type );
Parallel_Common::bcast_int( eels_method );
Parallel_Common::bcast_int( absorption_method );
Parallel_Common::bcast_string( system );
Parallel_Common::bcast_string( system_type );
Parallel_Common::bcast_double( eta );
Parallel_Common::bcast_double( domega );
Parallel_Common::bcast_int( nomega );
Expand Down Expand Up @@ -2259,7 +2265,7 @@ void Input::Bcast()

//Parallel_Common::bcast_int( epsilon0_choice );
Parallel_Common::bcast_double( cell_factor); //LiuXh add 20180619
Parallel_Common::bcast_int( newDM ); // Shen Yu add 2019/5/9
Parallel_Common::bcast_int( new_dm ); // Shen Yu add 2019/5/9
Parallel_Common::bcast_bool( restart_save ); // Peize Lin add 2020.04.04
Parallel_Common::bcast_bool( restart_load ); // Peize Lin add 2020.04.04

Expand Down Expand Up @@ -2646,7 +2652,8 @@ void Input::Check(void)
else if (ks_solver == "hpseps")
{
#ifdef __MPI
ofs_warning << "It's a good choice to use hpseps!" << endl;
ofs_warning << "It's not a good choice to use hpseps!" << endl;
if(gamma_only) WARNING_QUIT("Input","hpseps can not be used for gamma_only.");
#else
WARNING_QUIT("Input","hpseps can not be used for series version.");
#endif
Expand Down Expand Up @@ -2814,7 +2821,7 @@ void Input::Check(void)
// pengfei 2016-12-14
if(spectral_type!="None")
{
if( system!="bulk" && system!="surface")
if( system_type!="bulk" && system_type!="surface")
{
WARNING_QUIT("Input","system must be bulk or surface");
}
Expand Down Expand Up @@ -2936,6 +2943,20 @@ void Input::Check(void)
}
}
}

const string ss = "test -d " + read_file_dir;
if(read_file_dir=="auto")
{
global_readin_dir = global_out_dir;
}
else if( system( ss.c_str() ))
{
WARNING_QUIT("Input","please set right files directory for reading in.");
}
else
{
global_readin_dir = read_file_dir + '/';
}

return;
}
Expand Down
5 changes: 3 additions & 2 deletions ABACUS.develop/source/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Input
string suffix; // suffix of out put dir
string atom_file; // file contains atomic positions -- xiaohui modify 2015-02-01
string pseudo_dir; // directory of pseudopotential
string read_file_dir; // directory of files for reading
string pseudo_type; // the type of pseudopotential, mohan add 2013-05-20, ABACUS supports
// UPF format (default) and vwr format. (xiaohui add 2013-06-23)
string kpoint_file; // file contains k-points -- xiaohui modify 2015-02-01
Expand Down Expand Up @@ -296,7 +297,7 @@ class Input
int absorption_method; // 0: vasp's method 1: pwscf's method
//int epsilon_choice; // 0: hilbert_transform method; 1: standard method
string kernel_type; // the kernel type: rpa, tdlda ...
string system; // bulk or surface
string system_type; // bulk or surface
double eta; // unit(Ry)
double domega; // unit(Ry)
int nomega;
Expand Down Expand Up @@ -398,7 +399,7 @@ class Input
// 2: use new DM algorithm and only show key debug information
// 3: use new DM algorithm and show all detail debug information
//==========================================================
int newDM;
int new_dm;

//==========================================================
// DFT+U Xin Qu added on 2020-10-29
Expand Down
17 changes: 10 additions & 7 deletions ABACUS.develop/source/input_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void Input_Conv::Convert(void)
}
//chi0_hilbert.epsilon = INPUT.epsilon;
chi0_hilbert.kernel_type = INPUT.kernel_type;
chi0_hilbert.system = INPUT.system;
chi0_hilbert.system = INPUT.system_type;
chi0_hilbert.eta = INPUT.eta;
chi0_hilbert.domega = INPUT.domega;
chi0_hilbert.nomega = INPUT.nomega;
Expand Down Expand Up @@ -314,7 +314,7 @@ void Input_Conv::Convert(void)
{
//chi0_standard.epsilon = INPUT.epsilon;
chi0_standard.epsilon = true;
chi0_standard.system = INPUT.system;
chi0_standard.system = INPUT.system_type;
chi0_standard.eta = INPUT.eta;
chi0_standard.domega = INPUT.domega;
chi0_standard.nomega = INPUT.nomega;
Expand Down Expand Up @@ -397,6 +397,8 @@ void Input_Conv::Convert(void)
#endif
}
else{
delete[] soc.m_loc;
soc.m_loc = new Vector3<double> [INPUT.ntype];
LSPINORB = false;
NONCOLIN = false;
DOMAG = false;
Expand Down Expand Up @@ -578,7 +580,7 @@ void Input_Conv::Convert(void)

ppcell.cell_factor = INPUT.cell_factor; //LiuXh add 20180619

NEW_DM=INPUT.newDM; // Shen Yu add 2019/5/9
// NEW_DM=INPUT.new_dm; // Shen Yu add 2019/5/9

//----------------------------------------------------------
// main parameters / electrons / spin ( 2/16 )
Expand Down Expand Up @@ -625,10 +627,11 @@ void Input_Conv::Convert(void)
//----------------------------------------------------------
// About LCAO
//----------------------------------------------------------
ORB.ecutwfc = INPUT.lcao_ecut;
ORB.dk = INPUT.lcao_dk;
ORB.dR = INPUT.lcao_dr;
ORB.Rmax = INPUT.lcao_rmax;
// mohan add 2021-04-16
// ORB.ecutwfc = INPUT.lcao_ecut;
// ORB.dk = INPUT.lcao_dk;
// ORB.dR = INPUT.lcao_dr;
// ORB.Rmax = INPUT.lcao_rmax;

// mohan add 2021-02-16
berryphase::berry_phase_flag = INPUT.berry_phase;
Expand Down
10 changes: 9 additions & 1 deletion ABACUS.develop/source/run_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ void Run_lcao::lcao_line(void)

// * reading the localized orbitals/projectors
// * construct the interpolation tables.
hm.orb_con.set_orb_tables();
hm.orb_con.set_orb_tables(
UOT,
ORB,
INPUT.lcao_ecut,
INPUT.lcao_dk,
INPUT.lcao_dr,
INPUT.lcao_rmax,
ucell.lat0,
Exx_Abfs::Lmax);

// * allocate H and S matrices according to computational resources
// * set the 'trace' between local H/S and global H/S
Expand Down
63 changes: 63 additions & 0 deletions ABACUS.develop/source/src_external/GRID_api/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This is the Makefile of ABACUS-ORB API

include Makefile.system
include Makefile.Objects

VPATH=../../src_global\
:../../src_lcao\
:./\

#==========================
# Define HONG
#==========================
HONG= -DMETIS -DMKL_ILP64

#==========================
# OPTIMIZE OPTIONS
#==========================
OPTS_GDB = -g -W

#==========================
# OBJECTS NEEDED
#==========================
#FP_OBJS_0=$(OBJS_ORBITAL)\
#$(OBJS_GLOBAL)\
#main.o\
FP_OBJS_0=main.o\
$(OBJS_TRY)\
$(OBJS_ORBITAL)\

FP_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${FP_OBJS_0})
PDIAG_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${OBJS_PDIAG})
PDIAG_MR=$(patsubst %.o, ${OBJ_DIR}/%.o, ${PDIAG_MR_0})

#==========================
# MAKING OPTIONS
#==========================
fp_mpi :
@ make init
@ make -j $(NP) serial2

init :
@ if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi
@ if [ ! -d $(OBJ_DIR)/README ]; then echo "This directory contains all of the .o files" > $(OBJ_DIR)/README; fi
@ if [ ! -d ../bin ]; then mkdir ../bin; fi

serial : ${FP_OBJS} ${HEADERS}
${CPLUSPLUS} ${OPTS} $(FP_OBJS) ${LIBS} -o ${VERSION}.x

serial2 : ${FP_OBJS}
${CPLUSPLUS} ${OPTS} $(FP_OBJS) ${LIBS} -o ${VERSION}.x

#==========================
# rules
#==========================
${OBJ_DIR}/%.o:%.cpp
${CPLUSPLUS_MPI} ${OPTS} ${OPTS_MPI} -c ${HONG} $< -o $@
${OBJ_DIR}/%.o:%.f
${FORTRAN} -c ${HONG} $< -o $@

.PHONY:clean
clean:
@ if [ -d $(OBJ_DIR) ]; then rm -rf $(OBJ_DIR); fi
26 changes: 26 additions & 0 deletions ABACUS.develop/source/src_external/GRID_api/Makefile.Objects
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# This is a test makefile for Electronic-structure
#
# This particular makefile defines all the executables and objects
# files needed, who they depend on, and the compilation defaults.#
# The file makefile.local is included below.
# That file defines the actual commands to use to run the C++
# compiler, library options and directories, etc., all of which are
# machine specific and depend on the local installation. Hence the name.
#

VERSION= ABACUS-GRID
HEADERS= *.h

OBJS_TRY=math_integral.o\
complexarray.o\
complexmatrix.o\
matrix.o\

OBJS_GRID=grid_base.o\
grid_base_beta.o\
grid_bigcell.o\
grid_meshball.o\
grid_meshk.o\
grid_technique.o\

14 changes: 14 additions & 0 deletions ABACUS.develop/source/src_external/GRID_api/Makefile.system
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include Makefile.vars

#==========================
# LIBS and INCLUDES
#==========================
LIBS = -lifcore -lm -lpthread

INCLUDES = -I. -Icommands

#==========================
# OPTIMIZE OPTIONS
#==========================
OPTS = ${INCLUDES} -Ofast -std=c++11 -simd -march=native -m64 -Werror -Wall -pedantic -g
#OPTS_MPI = -cxx=${CPLUSPLUS}
Loading

0 comments on commit aaaf1b5

Please sign in to comment.