Commit d7a97f1e authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

Fix header of exported schedules when using --submitorder

Thanks to Vinícius Garcia Pinto (@vgarciap) for the patch.
parent 4a0e7dee
......@@ -47,7 +47,7 @@ void ExportSchedule::outputHeader() {
*output << "sched ";
*output << "Tid worker taskType ";
if(instance->taskIDs.size() > 0)
*output << "JobId ";
*output << (submitOrder ? "SubmitOrder " : "JobId ");
*output << "start duration end" << endl;
}
......@@ -75,7 +75,8 @@ void ExportSchedule::onSchedule(int i, int w, double s, double f) {
/* ExportToFile */
ExportToFile::ExportToFile(string filename, Instance* ins, bool header, string name): ExportSchedule(ins, name), f(new ofstream(filename, ios::app)) {
ExportToFile::ExportToFile(string filename, Instance* ins, bool header, string name, bool submitorder): ExportSchedule(ins, name), f(new ofstream(filename, ios::app)) {
ExportSchedule::submitOrder = submitorder;
output = f;
if(header) outputHeader();
}
......
......@@ -30,6 +30,7 @@ class ExportSchedule : public SchedAction {
std::ostream* output;
Instance* instance;
std::string name;
bool submitOrder;
void outputHeader();
public:
ExportSchedule(std::ostream *stream, Instance* ins, bool header = false, std::string name ="");
......@@ -40,7 +41,7 @@ public:
class ExportToFile : public ExportSchedule {
std::ofstream* f;
public:
ExportToFile(std::string filename, Instance* ins, bool header = false, std::string name ="");
ExportToFile(std::string filename, Instance* ins, bool header = false, std::string name ="", bool submitOrder = false);
~ExportToFile();
};
class ExportToString: public ExportSchedule {
......
......@@ -131,7 +131,7 @@ void displayAlgResult(ProgramOptions& progOpt, Instance* instance,
if(progOpt.saveFile != "") {
globalExport = new ExportToFile(progOpt.saveFile, instance,
firstFile, result.key);
firstFile, result.key, progOpt.useSubmitOrder);
seq.add(globalExport);
}
......
Markdown is supported
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