30 std::map<std::string, std::string>
data;
46 if (line.find(
'#') != line.npos)
47 line.erase(line.find(
'#'));
55 return (line.find_first_not_of(
' ') == line.npos);
65 void parseLine(
const std::string &line,
size_t const lineNum)
67 if (line.find(
"clock:") != std::string::npos)
70 if (line.find(
"cores per socket:") != std::string::npos)
73 if (line.find(
"cores per NUMA domain:") != std::string::npos)
76 if (line.find(
"DP:") != std::string::npos)
79 if (line.find(
"SP:") != std::string::npos)
82 if (line.find(
"sockets:") != std::string::npos)
85 if (line.find(
"cacheline size:") != std::string::npos)
86 cachelinesize = std::stoi(line.substr(line.find(
":") + 1, 4));
88 if (line.find(
" MEM:") != std::string::npos)
92 if (
flag ==
false && (line.find(
"copy:") != std::string::npos))
95 std::string val = line.substr(line.find(
"[") + 1, line.find(
"]") - 17);
98 for (std::stringstream sst(val); std::getline(sst, a,
',');)
99 MEM_bandwidth.push_back(stod(a.replace(a.find(
"GB/s"), 4,
"")));
119 while (std::getline(file, line))
122 std::string temp = line;
std::size_t DisCosTiC_Datatype
std::string micro_architecture
DisCosTiC_Datatype cores_per_numa_domain
DisCosTiC_Datatype cores_per_chip
bool whitespace(const std::string &line) const
a function that returns false if a non-space character was found, true otherwise. The function is "co...
DisCosTiC_Datatype FP_ops_per_instruction_SP
std::map< std::string, std::string > data
which will hold pairs of key-value
std::vector< real_t > MEM_bandwidth
DisCosTiC_Datatype FP_ops_per_instruction_DP
DisCosTiC_Datatype cachelinesize
std::string fileName
As member variables, we will only have a std::string, which will hold the name of the configuration f...
YAMLParser(const std::string &fileName)
a class to set the name of the configuration file and extracts and parses the data
void removeComment(std::string &line) const
a function that removes everything from the semicolon (including it) to the end of the line.
DisCosTiC_Datatype FP_instructions_per_cycle
DisCosTiC_Datatype chips_per_node
void parseLine(const std::string &line, size_t const lineNum)
a function that extracts the key from the pair of key = value
#define fileopen(myfile, filename)
open an open file
#define fileclose(myfile, filename)
close an open file
it parses the user-defined configuration file (.cfg)