Commit 2549cd91 authored by maximilianlohoefer's avatar maximilianlohoefer
Browse files

in runner_pt.cpp

replaced tokens std::"\n", which the compiler claimed to be syntax
errors with "\n"
made parser::get_all_with_one_from_specified_array compatible with
yextract


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@12 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent 0f7f15c2
......@@ -115,6 +115,7 @@ class odump
}
}
template <class Type> void write(std::vector<Type>&);
// void write(std::vector<bool>&);
template <class Type> void write(Type*, int);
template <class Type> void write(Type&);
void write(std::string&);
......@@ -150,6 +151,7 @@ class idump
bool good() {return !(!binary_file);}
void open(std::string filename) {binary_file.open(filename.c_str(),std::ios::in|std::ios::binary);}
template <class Type> void read(std::vector<Type>&);
// void read(std::vector<bool>&);
template <class Type> void read(Type*, int);
template <class Type> void read(Type&);
// read data and swap endianness
......@@ -171,6 +173,14 @@ void odump :: write(std::vector<Type>& v) {
write(v[i]);
}
/*void odump :: write(std::vector<bool>& v) {
luint n=v.size();
write(n);
for (uint i=0;i<n;++i) {
bool nel = v[i];
write(nel);
}
}*/
template <class Type>
void odump :: write(Type *a, int size)
......@@ -196,6 +206,17 @@ void idump :: read(std::vector<Type>& v) {
}
}
/*void idump :: read(std::vector<bool>& v) {
luint n;
read(n);
v.clear();
for (uint i=0;i<n;++i) {
bool nel;
read(nel);
v.push_back(nel);
}
}*/
template <class Type>
void idump :: read_se(std::vector<Type>& v) {
luint n;
......
......@@ -127,13 +127,20 @@ void parser :: get_all_with_one_from_specified_array(std::string sfai, int fai,
os<<(*i).first<<" = "<<(*i).second<<"\n";
for(i2=arrs.begin(); i2!=arrs.end();i2++) {
os<<(*i2).first<<"\n";
int size=((*i2).second).size();
if((*i2).first==sfai) os<<((*i2).second)[fai]<<"\n";
if((*i2).first==sfai)
os << (*i2).first.substr(1) << " = " << ((*i2).second)[fai] << "\n";
else {
int size=((*i2).second).size();
for(int j=0;j<size;j++)
os<< ((*i2).second)[j] <<"\n";
}
/* os<<(*i2).first<<"\n";
int size=((*i2).second).size();
if((*i2).first==sfai) os<<((*i2).second)[fai]<<"\n";
else {
for(int j=0;j<size;j++)
os<< ((*i2).second)[j] <<"\n";
}*/
os<<"\n";
}
}
......
......@@ -275,7 +275,7 @@ void runner_pt :: M_report_acc_ratio() {
std::ofstream afile(acceptfile.c_str(),std::ios::out|std::ios::app);
for(uint i = 0; i < pt_accepted.size(); i++)
afile<< double(pt_accepted[i])/double(pt_moves) << " ";
afile << std::"\n";
afile << "\n";
afile.close();
}
......@@ -440,7 +440,7 @@ void runner_pt :: checkpointing()
(*sys).measure[p-1].write(b.str());
}
what_is_next(S_CHECKPOINT);
(*STATUS) << my_rank << ": C " << my_rundir << std::"\n";
(*STATUS) << my_rank << ": C " << my_rundir << "\n";
}
void runner_pt :: merge_measurements()
......@@ -459,7 +459,7 @@ void runner_pt :: merge_measurements()
(*sys).write_output(tb.str(),p-1);
(*sys).measure[p-1].clear(); //otherwise, we might run out of memory
}
(*STATUS) << my_rank << ": M " << my_taskdir << std::"\n";
(*STATUS) << my_rank << ": M " << my_taskdir << "\n";
}
void runner_pt :: end_of_run()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment