@@ -128,20 +128,20 @@ void ModuleBase::Global_File::make_dir_out(
128128 if (out_alllog)
129129 {
130130 ss << " running_" << calculation << " _" << rank + 1 ;
131- open_log (GlobalV::ofs_running, ss.str (), restart);
131+ open_log (GlobalV::ofs_running, ss.str (), calculation, restart);
132132 }
133133 else
134134 {
135135 if (rank==0 )
136136 {
137137 ss << " running_" << calculation;
138- open_log (GlobalV::ofs_running, ss.str (), restart);
138+ open_log (GlobalV::ofs_running, ss.str (), calculation, restart);
139139 }
140140 }
141141
142142 if (rank==0 )
143143 {
144- open_log (GlobalV::ofs_warning, " warning" , restart);
144+ open_log (GlobalV::ofs_warning, " warning" , calculation, restart);
145145 }
146146 return ;
147147}
@@ -159,7 +159,7 @@ void ModuleBase::Global_File::make_dir_atom(const std::string &label)
159159 return ;
160160}
161161
162- void ModuleBase::Global_File::open_log (std::ofstream &ofs, const std::string &fn, const bool &restart)
162+ void ModuleBase::Global_File::open_log (std::ofstream &ofs, const std::string &fn, const std::string &calculation, const bool &restart)
163163{
164164// ----------------------------------------------------------
165165// USE GLOBAL VARIABLE :
@@ -168,7 +168,7 @@ void ModuleBase::Global_File::open_log(std::ofstream &ofs, const std::string &fn
168168 std::stringstream ss;
169169 ss << GlobalV::global_out_dir << fn << " .log" ;
170170
171- if (fn == " running_md " && restart)
171+ if ((calculation == " md " || calculation == " sto-md " ) && restart)
172172 {
173173 ofs.open ( ss.str (), ios::app );
174174 }
0 commit comments