Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

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

Update ExportAlloc to provide worker ids + submit order when available

parent 9bf36025
......@@ -105,22 +105,38 @@ string ExportToString::getResult() {
/* ExportAlloc: exports in .rec format */
ExportAlloc::ExportAlloc(string filename, Instance* ins) : output(filename), instance(ins) {
ExportAlloc::ExportAlloc(string filename, Instance* ins, bool submitOrder)
: output(filename), instance(ins), submitOrder(submitOrder) {
}
void ExportAlloc::onSchedule(int i, int w, double s, double f) {
if(instance->taskIDs.size() > 0) {
output << "JobId: " << instance->taskIDs[i] << endl;
} else {
output << "TaskId: " << i << endl;
string id = instance->taskIDs[i];
vector<string> parts;
split(id, ':', parts);
if(parts.size() == 1)
output << (submitOrder ? "SubmitOrder: " : "JobId: ") << instance->taskIDs[i] << endl;
else {
output << (submitOrder ? "SubmitOrder: " : "JobId: ") << parts[0] << endl;
output << "Tag:" << parts[1] << endl;
}
}
output << "TaskId: " << i << endl;
if(instance->taskTypeNames.size() > 0) {
output << "TaskType: " << instance->taskTypeNames[instance->taskTypes[i]] << endl;
}
int type = instance->getType(w);
output << "Workers:";
for(auto& i: instance->workerIDs[type])
output << i << " ";
output << endl;
if(instance->workerNames.size() > 0) {
output << "Architecture: " << instance->workerNames[instance->getType(w)] << endl;
output << "Architecture: " << instance->workerNames[type] << endl;
} else {
output << "WorkerType: " << instance->getType(w) << endl;
output << "WorkerType: " << type << endl;
}
output << endl;
}
......
......@@ -56,9 +56,10 @@ class ExportToString: public ExportSchedule {
class ExportAlloc : public SchedAction {
std::ofstream output;
Instance* instance;
Instance* instance;
bool submitOrder;
public:
ExportAlloc(std::string filename, Instance* ins);
ExportAlloc(std::string filename, Instance* ins, bool submitOrder = false);
void onSchedule(int i, int w, double s, double f);
~ExportAlloc();
};
......
......@@ -52,7 +52,7 @@ void computeAlg(ProgramOptions& progOpt, Instance* ins,
ExportAlloc* exportAlloc = NULL;
if(opts.isPresent("export")) {
exportAlloc = new ExportAlloc(opts.asString("export"), ins);
exportAlloc = new ExportAlloc(opts.asString("export"), ins, progOpt.useSubmitOrder);
seq.add(exportAlloc);
}
......@@ -355,7 +355,7 @@ int main(int argc, char** argv) {
name += ":" + instance->platformFile;
ExportToFile exp(progOpt.outputBestFile, instance, false, name);
// TODO: allow $p / $i in file names to replace with platform / instance
ExportAlloc alloc(progOpt.outputBestFile + ".rec", instance);
ExportAlloc alloc(progOpt.outputBestFile + ".rec", instance, progOpt.useSubmitOrder);
ActionSequence seq;
seq.add(&exp);
seq.add(&alloc);
......
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