Skip to content

Commit b2c7f7e

Browse files
committed
update warning message for reading charge density
1 parent 7340a30 commit b2c7f7e

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

source/module_base/tool_quit.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void QUIT(int ret)
4848
#ifdef __NORMAL
4949

5050
#else
51-
ModuleBase::timer::finish(GlobalV::ofs_running , !GlobalV::MY_RANK);
51+
ModuleBase::timer::finish(GlobalV::ofs_running , -GlobalV::MY_RANK);
5252

5353
ModuleBase::Global_File::close_all_log(GlobalV::MY_RANK);
5454

@@ -68,34 +68,34 @@ void WARNING_QUIT(const std::string &file,const std::string &description,int ret
6868
{
6969
#ifdef __NORMAL
7070

71-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
72-
std::cout << " NOTICE " << std::endl;
73-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
71+
std::cout << " ---------------------------------------------------------" << std::endl;
72+
std::cout << " !NOTICE! " << std::endl;
73+
std::cout << " ---------------------------------------------------------" << std::endl;
7474

7575
#else
7676
std::cout << " " << std::endl;
77-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
78-
std::cout << " NOTICE " << std::endl;
79-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
77+
std::cout << " ---------------------------------------------------------" << std::endl;
78+
std::cout << " !NOTICE! " << std::endl;
79+
std::cout << " ---------------------------------------------------------" << std::endl;
8080
std::cout << " " << std::endl;
8181
std::cout << " " << description << std::endl;
8282
std::cout << " CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
8383
std::cout << " " << std::endl;
84-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
85-
std::cout << " NOTICE " << std::endl;
86-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
84+
std::cout << " ---------------------------------------------------------" << std::endl;
85+
std::cout << " !NOTICE! " << std::endl;
86+
std::cout << " ---------------------------------------------------------" << std::endl;
8787

8888

89-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
90-
GlobalV::ofs_running << " NOTICE " << std::endl;
91-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
89+
GlobalV::ofs_running << " ---------------------------------------------------------" << std::endl;
90+
GlobalV::ofs_running << " !NOTICE! " << std::endl;
91+
GlobalV::ofs_running << " ---------------------------------------------------------" << std::endl;
9292
GlobalV::ofs_running << std::endl;
9393
GlobalV::ofs_running << " " << description << std::endl;
9494
GlobalV::ofs_running << " CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
9595
GlobalV::ofs_running << std::endl;
96-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
96+
GlobalV::ofs_running << " ---------------------------------------------------------" << std::endl;
9797
GlobalV::ofs_running << " NOTICE " << std::endl;
98-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
98+
GlobalV::ofs_running << " ---------------------------------------------------------" << std::endl;
9999

100100
WARNING(file,description);
101101
GlobalV::ofs_running<<" Check in file : "<<PARAM.globalv.global_out_dir<<"warning.log"<<std::endl;
@@ -116,25 +116,25 @@ void CHECK_WARNING_QUIT(const bool error_in, const std::string &file,const std::
116116
{
117117
//All cores will print inforamtion
118118
std::cout.clear();
119-
if(!GlobalV::ofs_running.is_open())
119+
if(-GlobalV::ofs_running.is_open())
120120
{
121121
std::string logfile = PARAM.globalv.global_out_dir + "running_" + calculation + ".log";
122122
GlobalV::ofs_running.open( logfile.c_str(), std::ios::app );
123123
}
124-
if(!GlobalV::ofs_warning.is_open())
124+
if(-GlobalV::ofs_warning.is_open())
125125
{
126126
std::string warningfile = PARAM.globalv.global_out_dir + "warning.log";
127127
GlobalV::ofs_warning.open( warningfile.c_str(), std::ios::app );
128128
}
129129

130130
//print error information
131-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
132-
std::cout << " ERROR! " << description << std::endl;
131+
std::cout << " ---------------------------------------------------------" << std::endl;
132+
std::cout << " ERROR- " << description << std::endl;
133133
std::cout << " CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
134-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
135-
GlobalV::ofs_running << " ERROR! CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
134+
std::cout << " ---------------------------------------------------------" << std::endl;
135+
GlobalV::ofs_running << " ERROR- CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
136136
GlobalV::ofs_warning << std::endl;
137-
GlobalV::ofs_warning << " ERROR! " << file << ", core " << GlobalV::MY_RANK+1 << ": " << description << std::endl;
137+
GlobalV::ofs_warning << " ERROR- " << file << ", core " << GlobalV::MY_RANK+1 << ": " << description << std::endl;
138138
GlobalV::ofs_warning << std::endl;
139139
exit(1);
140140
}

source/module_elecstate/module_charge/charge_init.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
7373
{
7474
if (is == 1) // failed at the second spin
7575
{
76-
std::cout << "Incomplete electron density file!" << std::endl;
76+
std::cout << " Incomplete electron density file." << std::endl;
7777
read_error = true;
7878
break;
7979
}
@@ -105,15 +105,15 @@ void Charge::init_rho(elecstate::efermi& eferm_iout,
105105
if (read_error)
106106
{
107107
const std::string warn_msg
108-
= " WARNING: \"init_chg\" is enabled but ABACUS failed to read charge density from file.\n"
109-
" Please check if there is SPINX_CHG.cube (X=1,...) or {suffix}-CHARGE-DENSITY.restart in the "
108+
= " WARNING: \"init_chg\" is enabled but ABACUS failed to read\n charge density from file.\n"
109+
" Please check if there is SPINX_CHG.cube (X=1,...) or\n {suffix}-CHARGE-DENSITY.restart in the "
110110
"directory.\n";
111-
std::cout << std::endl << warn_msg;
111+
std::cout << warn_msg;
112112
if (PARAM.inp.init_chg == "file")
113113
{
114114
ModuleBase::WARNING_QUIT("Charge::init_rho",
115-
"Failed to read in charge density from file.\nIf you want to use atomic "
116-
"charge initialization, \nplease set init_chg to atomic in INPUT.");
115+
"Failed to read in charge density from file.\n For initializing atomic "
116+
"charge in calculations,\n please set init_chg to atomic in INPUT.");
117117
}
118118
}
119119

source/module_parameter/system_parameter.h

100755100644
File mode changed.

0 commit comments

Comments
 (0)