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