@@ -25,7 +25,8 @@ void compute_ekb(const Parallel_Orbitals* pv,
2525 const int nlocal,
2626 const std::complex <double >* Htmp,
2727 const std::complex <double >* psi_k,
28- double * ekb)
28+ double * ekb,
29+ std::ofstream& ofs_running)
2930{
3031
3132 std::complex <double >* tmp1 = new std::complex <double >[pv->nloc_wfc ];
@@ -76,10 +77,10 @@ void compute_ekb(const Parallel_Orbitals* pv,
7677
7778 if (PARAM.inp .td_print_eij > 0.0 )
7879 {
79- GlobalV:: ofs_running
80+ ofs_running
8081 << " ------------------------------------------------------------------------------------------------"
8182 << std::endl;
82- GlobalV:: ofs_running << " Eij:" << std::endl;
83+ ofs_running << " Eij:" << std::endl;
8384 for (int i = 0 ; i < pv->nrow_bands ; i++)
8485 {
8586 for (int j = 0 ; j < pv->ncol_bands ; j++)
@@ -98,12 +99,12 @@ void compute_ekb(const Parallel_Orbitals* pv,
9899 }
99100 if (aa > 0.0 || bb > 0.0 )
100101 {
101- GlobalV:: ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
102+ ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
102103 }
103104 }
104105 }
105- GlobalV:: ofs_running << std::endl;
106- GlobalV:: ofs_running
106+ ofs_running << std::endl;
107+ ofs_running
107108 << " ------------------------------------------------------------------------------------------------"
108109 << std::endl;
109110 }
@@ -156,7 +157,8 @@ void compute_ekb_tensor(const Parallel_Orbitals* pv,
156157 const int nlocal,
157158 const ct::Tensor& Htmp,
158159 const ct::Tensor& psi_k,
159- ct::Tensor& ekb)
160+ ct::Tensor& ekb,
161+ std::ofstream& ofs_running)
160162{
161163 // Create Tensor objects for temporary data
162164 ct::Tensor tmp1 (ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape ({pv->nloc_wfc }));
@@ -209,10 +211,10 @@ void compute_ekb_tensor(const Parallel_Orbitals* pv,
209211
210212 if (PARAM.inp .td_print_eij >= 0.0 )
211213 {
212- GlobalV:: ofs_running
214+ ofs_running
213215 << " ------------------------------------------------------------------------------------------------"
214216 << std::endl;
215- GlobalV:: ofs_running << " Eij:" << std::endl;
217+ ofs_running << " Eij:" << std::endl;
216218 for (int i = 0 ; i < pv->nrow_bands ; i++)
217219 {
218220 for (int j = 0 ; j < pv->ncol_bands ; j++)
@@ -231,12 +233,12 @@ void compute_ekb_tensor(const Parallel_Orbitals* pv,
231233 }
232234 if (aa > 0.0 || bb > 0.0 )
233235 {
234- GlobalV:: ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
236+ ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
235237 }
236238 }
237239 }
238- GlobalV:: ofs_running << std::endl;
239- GlobalV:: ofs_running
240+ ofs_running << std::endl;
241+ ofs_running
240242 << " ------------------------------------------------------------------------------------------------"
241243 << std::endl;
242244 }
@@ -290,7 +292,8 @@ void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv,
290292 const int nlocal,
291293 const ct::Tensor& Htmp,
292294 const ct::Tensor& psi_k,
293- ct::Tensor& ekb)
295+ ct::Tensor& ekb,
296+ std::ofstream& ofs_running)
294297{
295298 // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice
296299 ct::DeviceType ct_device_type = ct::DeviceTypeToEnum<Device>::value;
@@ -346,10 +349,10 @@ void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv,
346349 {
347350 ct::Tensor Eij_cpu = Eij.to_device <ct::DEVICE_CPU>();
348351
349- GlobalV:: ofs_running
352+ ofs_running
350353 << " ------------------------------------------------------------------------------------------------"
351354 << std::endl;
352- GlobalV:: ofs_running << " Eij:" << std::endl;
355+ ofs_running << " Eij:" << std::endl;
353356 for (int i = 0 ; i < nband; i++)
354357 {
355358 for (int j = 0 ; j < nband; j++)
@@ -368,12 +371,12 @@ void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv,
368371 }
369372 if (aa > 0.0 || bb > 0.0 )
370373 {
371- GlobalV:: ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
374+ ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
372375 }
373376 }
374377 }
375- GlobalV:: ofs_running << std::endl;
376- GlobalV:: ofs_running
378+ ofs_running << std::endl;
379+ ofs_running
377380 << " ------------------------------------------------------------------------------------------------"
378381 << std::endl;
379382 }
@@ -406,15 +409,17 @@ template void compute_ekb_tensor_lapack<base_device::DEVICE_CPU>(const Parallel_
406409 const int nlocal,
407410 const ct::Tensor& Htmp,
408411 const ct::Tensor& psi_k,
409- ct::Tensor& ekb);
412+ ct::Tensor& ekb,
413+ std::ofstream& ofs_running);
410414
411415#if ((defined __CUDA) /* || (defined __ROCM) */ )
412416template void compute_ekb_tensor_lapack<base_device::DEVICE_GPU>(const Parallel_Orbitals* pv,
413417 const int nband,
414418 const int nlocal,
415419 const ct::Tensor& Htmp,
416420 const ct::Tensor& psi_k,
417- ct::Tensor& ekb);
421+ ct::Tensor& ekb,
422+ std::ofstream& ofs_running);
418423#endif // __CUDA
419424#endif // __MPI
420425
0 commit comments