ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
tool_quit.h
Go to the documentation of this file.
1#ifndef QUIT_H
2#define QUIT_H
3
4#include <cassert>
5#include <complex>
6#include <fstream>
7#include <iomanip>
8#include <iostream>
9#include <string>
10#include <valarray>
11#include <vector>
12
13namespace ModuleBase
14{
15
16//==========================================================
17// GLOBAL FUNCTION :
18// NAME : WARNING( write information into GlobalV::ofs_warning)
19// NAME : QUIT( exit the running program)
20// NAME : WARNING_QUIT( write information into
21// GlobalV::ofs_warning , and then quit)
22//==========================================================
29void WARNING(const std::string &file, const std::string &description);
30
38void set_quit_out_dir(const std::string& dir);
39
44const std::string& get_global_out_dir();
45
54void set_quit_calculation(const std::string& calculation);
55
60[[noreturn]] void QUIT(void);
61
66[[noreturn]] void QUIT(int ret);
67
74[[noreturn]] void WARNING_QUIT(const std::string& file, const std::string& description);
75
82[[noreturn]] void WARNING_QUIT(const std::string& file, const std::string& description, int ret);
83
90void CHECK_WARNING_QUIT(const bool error, const std::string &file, const std::string &description);
91
92} // namespace ModuleBase
93
94#endif
Definition clebsch_gordan_coeff.cpp:8
void WARNING_QUIT(const std::string &, const std::string &)
Combine the functions of WARNING and QUIT.
Definition test_delley.cpp:15
void CHECK_WARNING_QUIT(const bool error_in, const std::string &file, const std::string &description)
Check, if true, WARNING_QUIT.
Definition tool_quit.cpp:153
const std::string & get_global_out_dir()
Read back the injected global output directory. Returns an empty string if set_quit_out_dir was never...
Definition tool_quit.cpp:28
void set_quit_calculation(const std::string &calculation)
Inject the calculation tag used by CHECK_WARNING_QUIT to compose the fallback log filename ("running_...
Definition tool_quit.cpp:33
void WARNING(const std::string &file, const std::string &description)
Print out warning information in warning.log file.
Definition tool_quit_no_exit.cpp:8
void set_quit_out_dir(const std::string &dir)
Inject the global output directory used by QUIT/WARNING_QUIT/CHECK_WARNING_QUIT for log path resoluti...
Definition tool_quit.cpp:23
void QUIT()
Close .log files and exit.
Definition tool_quit.cpp:60
file(GLOB ATen_CORE_SRCS "*.cpp") set(ATen_CPU_SRCS $
Definition CMakeLists.txt:1