OpenMPI  0.1.1
vt_filter.h
1 /**
2  * VampirTrace
3  * http://www.tu-dresden.de/zih/vampirtrace
4  *
5  * Copyright (c) 2005-2012, ZIH, TU Dresden, Federal Republic of Germany
6  *
7  * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing
8  * Centre, Federal Republic of Germany
9  *
10  * See the file COPYING in the package base directory for details
11  **/
12 
13 #ifndef _VT_FILTER_H_
14 #define _VT_FILTER_H_
15 
16 #include "config.h"
17 
18 // disable OpenMP on NEC SX platforms to work around a compiler error
19 #if (defined(HAVE_OMP) && HAVE_OMP) && defined(_SX)
20 # undef HAVE_OMP
21 #endif // HAVE_OMP && _SX
22 
23 #include "vt_inttypes.h"
24 
25 #include <string>
26 #include <vector>
27 
28 #ifdef VT_MPI
29 # include "vt_defs.h" // to get VT_MPI_INT
30 # define MASTER if( MyRank == 0 )
31 # define SLAVE if( MyRank != 0 )
32 #else // VT_MPI
33 # define MASTER
34 # define SLAVE
35 #endif // VT_MPI
36 
37 // typedef for filter modes
38 //
39 typedef enum
40 {
41  MODE_GEN, // generate a filter file
42  MODE_FILT // filter a trace using an already existing filter file
43 } FilterModeT;
44 
45 // data structure for program parameters
46 //
47 struct ParamsS
48 {
49  ParamsS()
50  : mode(default_mode), input_trcfile(""), verbose_level(0),
51  show_progress(false), show_usage(false), show_version(false),
52  g_output_filtfile(""), g_incl_file(""), g_excl_file(""),
53  g_call_limit(g_default_call_limit), g_reduce_ratio(0),
54  g_print_stats(false), g_incl_callees(false),
55  f_output_trcfile(""), f_input_filtfile(""),
56  f_max_output_streams(f_default_max_output_streams),
57  f_max_file_handles(f_default_max_file_handles),
58  f_compress_level(f_default_compress_level) {}
59 
60  // defaults
61  //
62  static const FilterModeT default_mode = MODE_FILT;
63  static const uint32_t g_default_call_limit = 0;
64  static const uint32_t f_default_max_output_streams = 0;
65  static const uint32_t f_default_max_file_handles = 256;
66  static const uint32_t f_default_compress_level = 4;
67 
68  // command line parameters
69  //
70 
71  // general
72  //
73  FilterModeT mode;
74  std::string input_trcfile;
75  uint32_t verbose_level;
76  bool show_progress;
77  bool show_usage;
78  bool show_version;
79 
80  // generate
81  //
82  std::string g_output_filtfile;
83  std::string g_incl_file;
84  std::string g_excl_file;
85  std::vector<std::string> g_incl_funcs;
86  std::vector<std::string> g_excl_funcs;
87  uint32_t g_call_limit;
88  uint32_t g_reduce_ratio;
89  bool g_print_stats;
90  bool g_incl_callees;
91 
92  // filter
93  //
94  std::string f_output_trcfile;
95  std::string f_input_filtfile;
96  uint32_t f_max_output_streams;
97  uint32_t f_max_file_handles;
98  uint32_t f_compress_level;
99 
100 };
101 
102 // print verbose message
103 extern void VPrint( uint8_t level, const char * fmt, ... );
104 
105 // print verbose message in a parallel region
106 extern void PVPrint( uint8_t level, const char * fmt, ... );
107 
108 // global variables
109 //
110 
111 // name of program's executable
112 extern std::string ExeName;
113 
114 // program parameters
115 extern ParamsS Params;
116 
117 #ifdef VT_MPI
118  // number of MPI-ranks
119  extern VT_MPI_INT NumRanks;
120 
121  // MPI-rank of calling process
122  extern VT_MPI_INT MyRank;
123 #endif // VT_MPI
124 
125 #endif // _VT_FILTER_H_
Definition: datastructs.h:41
Definition: vt_dyn.h:53