Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 852999c1 authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel
Browse files

pmtool: add a 'share' option for all algorithms

parent 816ffd3e
......@@ -317,6 +317,11 @@ int main(int argc, char** argv) {
seq.add(localExport);
}
InternalShare* share = NULL;
if(opts.isPresent("share")) {
share = new InternalShare(opts.asString("share"), &instance);
seq.add(share);
}
string name = buildName(it->first->name(), outputNamesRaw, optionKeys, it->second);
......@@ -352,6 +357,11 @@ int main(int argc, char** argv) {
seq.remove(localExport);
free(localExport);
}
if(share) {
share->finish();
seq.remove(share);
free(share);
}
}
if(globalExport) free(globalExport);
......
......@@ -99,3 +99,19 @@ void UtilAnalysis::write(string prefix) {
}
reset();
}
InternalShare::InternalShare(string name, Instance* ins) :
shareName(name), instance(ins), allocation(ins->nbTasks, -1),
startTimes(ins->nbTasks, -1) {
}
void InternalShare::onSchedule(int i, int w, double s, double f) {
allocation[i] = instance->getType(w);
startTimes[i] = s;
}
void InternalShare::finish() {
instance->extraData[shareName + "[alloc]"] = (allocation);
instance->extraData[shareName + "[start]"] = (startTimes);
}
......@@ -50,5 +50,17 @@ class UtilAnalysis : public SchedAction {
void write(std::string prefix);
};
class InternalShare : public SchedAction {
std::string shareName;
Instance* instance;
std::vector<double> allocation;
std::vector<double> startTimes;
public:
InternalShare(std::string shareName, Instance* ins);
void onSchedule(int i, int w, double s, double f);
void finish();
};
#endif
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