Psi4
debugging.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_bin_psimrcc_debugging_h
29 #define _psi_src_bin_psimrcc_debugging_h
30 /***************************************************************************
31  * PSIMRCC
32  * Copyright (C) 2007 by Francesco Evangelista and Andrew Simmonett
33  * frank@ccc.uga.edu andysim@ccc.uga.edu
34  * A multireference coupled cluster code
35  ***********
36 ****************************************************************/
38 
39 namespace psi{ namespace psimrcc{
40 
41 // #define NODEBUG
42 #ifdef NODEBUG
43 #define DEBUGGING(level,statements)
44 #else
45 #define DEBUGGING(level,statements) \
46  if(debugging->is_level(level)){ \
47  statements \
48  }
49 #endif
50 
51 #ifdef NODEBUG
52 #define START_TIMER(level,title)
53 #else
54 #define START_TIMER(level,title) \
55  Timer timer; \
56  if(debugging->is_level(level)){ \
57  outfile->Printf("\n %-48s ...",title); \
58  \
59  }
60 #endif
61 
62 #ifdef NODEBUG
63 #define END_TIMER(level)
64 #else
65 #define END_TIMER(level) \
66  if(debugging->is_level(level)){ \
67  outfile->Printf(" done. Timing %10.4f s",timer.get()); \
68  \
69  }
70 #endif
71 
75 class Debugging{
76 public:
77  Debugging(Options &options);
78  ~Debugging() {delete[] level;}
79 
80  bool is_level(int n) {return(n <= 10 ? level[n] : false);}
81 private:
83  bool* level;
84 };
85 
86 extern Debugging* debugging;
87 
88 }} /* End Namespaces */
89 
90 #endif // _psi_src_bin_psimrcc_debugging_h
PsiReturnType psimrcc(SharedWavefunction, Options &)
Definition: psimrcc/main.cc:86
Debugging * debugging
Definition: psimrcc/main.cc:82
Definition: debugging.h:75
Options & options_
Definition: debugging.h:82
bool * level
Definition: debugging.h:83
Definition: liboptions.h:359
Debugging(Options &options)
Definition: debugging.cc:40
bool is_level(int n)
Definition: debugging.h:80
~Debugging()
Definition: debugging.h:78