Main Page
Namespaces
Classes
Package Documentation
HLTrigger
Timer
src
processor_model.cc
Go to the documentation of this file.
1
#include <fstream>
2
#include <regex>
3
#include <string>
4
5
#include "
processor_model.h
"
6
7
std::string
read_processor_model
()
8
{
9
#ifdef __linux__
10
static
const
std::regex
pattern
(
"^model name\\s*:\\s*(.*)"
, std::regex::optimize);
11
std::smatch
match
;
12
13
std::ifstream cpuinfo(
"/proc/cpuinfo"
,
std::ios::in
);
14
std::string
line
;
15
while
(cpuinfo.good()) {
16
std::getline(cpuinfo, line);
17
if
(std::regex_match(line, match, pattern)) {
18
return
match[1];
19
}
20
}
21
#endif // __linux__
22
23
return
"unknown"
;
24
}
25
26
const
std::string
processor_model
=
read_processor_model
();
geometryCSVtoXML.line
line
Definition:
geometryCSVtoXML.py:15
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
processor_model.h
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
read_processor_model
std::string read_processor_model()
Definition:
processor_model.cc:7
processor_model
const std::string processor_model
Definition:
processor_model.cc:26
listBenchmarks.pattern
pattern
Definition:
listBenchmarks.py:26
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition:
Utils.h:10
Generated for CMSSW Reference Manual by
1.8.11