1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214 | #ifndef MOAB_MPE_H
#define MOAB_MPE_H
#include "moab/MOABConfig.h"
#ifdef MOAB_HAVE_LIBMPE
#include "moab_mpi.h"
#include "mpe.h"
#else
/* Define dummy logging functions */
/* mpe_misc.h */
#define MPE_Seq_begin( A, B ) \
{ \
if( ( A ) || ( B ) ) \
{ \
} \
}
#define MPE_Seq_end( A, B ) \
{ \
if( ( A ) || ( B ) ) \
{ \
} \
}
#define MPE_DelTag( A, B, C, D ) \
( \
{ \
if( ( A ) || ( B ) || ( C ) || ( D ) ) \
{ \
} \
}, \
MPI_SUCCESS )
#define MPE_GetTags( A, B, C, D ) ( ( A ) = *( C ), *( D ) = 0, if( B ){}, MPI_SUCCESS )
#define MPE_ReturnTags( A, B, C ) \
( \
{ \
if( ( A ) || ( B ) || ( C ) ) \
{ \
} \
}, \
0 )
#define MPE_TagsEnd() ( MPI_SUCCESS )
#define MPE_IO_Stdout_to_file( A, B ) \
{ \
if( ( A ) || ( B ) ) \
{ \
} \
}
#define MPE_GetHostName( A, B ) \
{ \
if( ( A ) || ( B ) ) \
{ \
} \
}
#define MPI_Start_debugger()
/*
#if (defined(__STDC__) || defined(__cplusplus))
#define MPE_Errors_to_dbx ( MPI_Comm *, int *, ... );
#else
void MPE_Errors_to_dbx ( MPI_Comm *, int *, char *, char *, int * );
#endif
void MPE_Errors_call_debugger ( char *, char *, char ** );
void MPE_Errors_call_xdbx ( char *, char * );
void MPE_Errors_call_dbx_in_xterm ( char *, char * );
void MPE_Signals_call_debugger ( void );
int MPE_Decomp1d ( int, int, int, int *, int * );
void MPE_Comm_global_rank ( MPI_Comm, int, int * );
*/
/* mpe_log.h */
#define MPE_LOG_OK 0
#define MPE_Log_OK MPE_LOG_OK
/* no problems */
#define MPE_LOG_LOCKED_OUT 1
#define MPE_Log_LOCKED_OUT MPE_LOG_LOCKED_OUT
/* logs are being worked on, cannot insert any new entries */
#define MPE_LOG_NO_MEMORY 2
#define MPE_Log_NO_MEMORY MPE_LOG_NO_MEMORY
/* could not allocate memory for logging data */
#define MPE_LOG_FILE_PROB 3
#define MPE_Log_FILE_PROB MPE_LOG_FILE_PROB
/* cound not open file for writing out the logged info */
#define MPE_LOG_NOT_INITIALIZED 4
#define MPE_Log_NOT_INITIALIZED MPE_LOG_NOT_INITIALIZED
/* logging not initialized */
#define MPE_LOG_PACK_FAIL 5
#define MPE_Log_PACK_FAIL MPE_LOG_PACK_FAIL
#define MPE_Init_log() ( MPI_SUCCESS )
#define MPE_Initialized_logging() 1
#define MPE_Describe_state( A, B, C, D ) \
{ \
if( ( A ) || ( B ) || ( C ) || ( D ) ) \
{ \
} \
}
#define MPE_Describe_event( A, B, C ) \
{ \
if( ( A ) || ( B ) || ( C ) ) \
{ \
} \
}
#define MPE_Log_get_event_number()
#define MPE_Log_send( A, B, C ) \
{ \
if( ( A ) || ( B ) || ( C ) ) \
{ \
} \
}
#define MPE_Log_receive( A, B, C ) \
{ \
if( ( A ) || ( B ) || ( C ) ) \
{ \
} \
}
#define MPE_Log_event( A, B, C ) \
{ \
if( ( A ) || ( B ) || ( C ) ) \
{ \
} \
}
#define MPE_Start_log()
#define MPE_Stop_log()
#define MPE_Finish_log( A ) \
{ \
if( A ) \
{ \
} \
}
#endif
#ifdef __cplusplus
namespace moab
{
class MPEState
{
private:
int sid, eid;
bool ok;
public:
MPEState( const char* name, const char* color = 0 )<--- Class 'MPEState' has a constructor with 1 argument that is not explicit. [+]Class 'MPEState' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
: sid( MPE_Log_get_event_number() ), eid( MPE_Log_get_event_number() ), ok( true )
{
MPE_Describe_state( sid, eid, name, color ? color : "yellow" );
}
MPEState() : ok( false ) {}<--- Member variable 'MPEState::sid' is not initialized in the constructor.<--- Member variable 'MPEState::eid' is not initialized in the constructor.
bool valid() const
{
return ok;
}
void start( int data = 0, const char* str = 0 )
{
MPE_Log_event( sid, data, str );
}
void start( const char* str, int data = 0 )
{
MPE_Log_event( sid, data, str );
}
void start( const char* str, const char* str2 )
{
MPE_Log_event( sid, 0, ( std::string( str ).append( str2 ) ).c_str() );
}
void end( int data = 0, const char* str = 0 )
{
MPE_Log_event( eid, data, str );
}
void end( const char* str, int data = 0 )
{
MPE_Log_event( eid, data, str );
}
};
class MPEEvent
{
private:
int id;
public:
MPEEvent( const char* name, const char* color = 0 ) : id( MPE_Log_get_event_number() )<--- Class 'MPEEvent' has a constructor with 1 argument that is not explicit. [+]Class 'MPEEvent' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
{
MPE_Describe_event( id, name, color ? color : "red" );
}
void log( int data = 0, const char* str = 0 )
{
MPE_Log_event( id, data, str );
}
void log( const char* str, int data = 0 )
{
MPE_Log_event( id, data, str );
}
};
} /* namespace moab */
#endif /* __cplusplus */
#endif /* MOAB_MPE_H */
|