Repository navigation
Expand file tree
/
Copy pathgraphchi_basic_includes.hpp
More file actions
94 lines (73 loc) · 2.65 KB
/
Copy pathgraphchi_basic_includes.hpp
File metadata and controls
94 lines (73 loc) · 2.65 KB
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
/**
* @file
* @author Aapo Kyrola <[email protected]>
* @version 1.0
*
* @section LICENSE
*
* Copyright [2012] [Aapo Kyrola, Guy Blelloch, Carlos Guestrin / Carnegie Mellon University]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @section DESCRIPTION
*
* This header includes all the main headers needed for a GraphChi
* program.
*/
#ifndef GRAPHCHI_DEF_ALLBASIC_INCLUDES
#define GRAPHCHI_DEF_ALLBASIC_INCLUDES
#include <omp.h>
#include <sstream>
#include "api/chifilenames.hpp"
#include "api/graphchi_context.hpp"
#include "api/graphchi_program.hpp"
#include "api/graph_objects.hpp"
#include "api/ischeduler.hpp"
#include "api/vertex_aggregator.hpp"
#include "engine/graphchi_engine.hpp"
#include "logger/logger.hpp"
#include "metrics/metrics.hpp"
#include "metrics/reps/basic_reporter.hpp"
#include "metrics/reps/file_reporter.hpp"
#include "metrics/reps/html_reporter.hpp"
#include "preprocessing/conversions.hpp"
#include "util/cmdopts.hpp"
namespace graphchi {
/**
* Helper for metrics.
*/
static VARIABLE_IS_NOT_USED void metrics_report(metrics &m);
static VARIABLE_IS_NOT_USED void metrics_report(metrics &m) {
std::string reporters = get_option_string("metrics.reporter", "console");
char * creps = (char*)reporters.c_str();
const char * delims = ",";
char * t = strtok(creps, delims);
while(t != NULL) {
std::string repname(t);
if (repname == "basic" || repname == "console") {
basic_reporter rep;
m.report(rep);
} else if (repname == "file") {
file_reporter rep(get_option_string("metrics.reporter.filename", "metrics.txt"));
m.report(rep);
} else if (repname == "html") {
html_reporter rep(get_option_string("metrics.reporter.htmlfile", "metrics.html"));
m.report(rep);
} else {
logstream(LOG_WARNING) << "Could not find metrics reporter with name [" << repname << "], ignoring." << std::endl;
}
t = strtok(NULL, delims);
}
}
};
#endif