std::vector<Event *> event_set;
Container* root_container = nullptr;
std::unordered_map<char*, char*> meta_info;
- void addMetaInfo(char* key, char* value);
- void cleanupOutput();
- void writeOutput(FILE *file);
+ void add_meta_info(char* key, char* value);
+ void cleanup_output();
+ void write_output(FILE* file);
+
+ // deprecated
+ XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::add_meta_info()") void addMetaInfo(char* key, char* value)
+ {
+ add_meta_info(key, value);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::cleanup_output()") void cleanupOutput() { cleanup_output(); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::write_output()") void writeOutput(FILE* file) { write_output(file); }
};
}
public:
Event(std::string name, double start_time, double end_time, std::string type);
~Event();
- void addCharacteristic(char* characteristic);
- void addResources(std::vector<sg_host_t>* host_selection);
- void addInfo(char* key, char* value);
+ void add_characteristic(char* characteristic);
+ void add_resources(std::vector<sg_host_t>* host_selection);
+ void add_info(char* key, char* value);
void print(FILE* file);
+ // deprecated
+ XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_characteristic()") void addCharacteristic(char* characteristic)
+ {
+ add_characteristic(characteristic);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_resources()") void addResources(
+ std::vector<sg_host_t>* host_selection)
+ {
+ add_resources(host_selection);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_info()") void addInfo(char* key, char* value)
+ {
+ add_info(key, value);
+ }
+
private:
std::string name;
double start_time;
Container *parent = nullptr;
std::vector<Container*> children;
std::vector<sg_host_t> resource_list;
- void addChild(Container* child);
- void addResources(std::vector<sg_host_t> hosts);
- void createHierarchy(sg_netzone_t from_as);
- std::vector<int> getHierarchy();
- std::string getHierarchyAsString();
+ void add_child(Container* child);
+ void add_resources(std::vector<sg_host_t> hosts);
+ void create_hierarchy(sg_netzone_t from_as);
+ std::vector<int> get_hierarchy();
+ std::string get_hierarchy_as_string();
void print(FILE *file);
- void printResources(FILE *file);
+ void print_resources(FILE* file);
+
+ // deprecated
+ XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_child()") void addChild(Container* child) { add_child(child); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_resources()") void addResources(std::vector<sg_host_t> hosts)
+ {
+ add_resources(hosts);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Container::create_hierarchy()") void createHierarchy(sg_netzone_t from_as)
+ {
+ create_hierarchy(from_as);
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy()") std::vector<int> getHierarchy()
+ {
+ return get_hierarchy();
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy_as_string()") std::string getHierarchyAsString()
+ {
+ return get_hierarchy_as_string();
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Container::print_resources()") void printResources(FILE* file)
+ {
+ print_resources(file);
+ }
};
class XBT_PUBLIC Subset {
this->event_set.clear();
}
-void Jedule::addMetaInfo(char *key, char *value) {
+void Jedule::add_meta_info(char* key, char* value)
+{
xbt_assert(key != nullptr);
xbt_assert(value != nullptr);
this->meta_info.insert({key, value});
}
-void Jedule::writeOutput(FILE *file) {
+void Jedule::write_output(FILE* file)
+{
if (not this->event_set.empty()) {
fprintf(file, "<jedule>\n");
}
}
-void Event::addResources(std::vector<sg_host_t> *host_selection)
+void Event::add_resources(std::vector<sg_host_t>* host_selection)
{
get_resource_selection_by_hosts(this->resource_subsets, host_selection);
}
-void Event::addCharacteristic(char *characteristic)
+void Event::add_characteristic(char* characteristic)
{
xbt_assert( characteristic != nullptr );
this->characteristics_list.push_back(characteristic);
}
-void Event::addInfo(char* key, char *value) {
+void Event::add_info(char* key, char* value)
+{
xbt_assert((key != nullptr) && value != nullptr);
this->info_map.insert({key, value});
}
fprintf(jed_file, " <res_util>\n");
for (auto const& subset : *this->resource_subsets) {
fprintf(jed_file, " <select resources=\"");
- fprintf(jed_file, "%s", subset->parent->getHierarchyAsString().c_str());
+ fprintf(jed_file, "%s", subset->parent->get_hierarchy_as_string().c_str());
fprintf(jed_file, ".[%d-%d]", subset->start_idx, subset->start_idx + subset->nres-1);
fprintf(jed_file, "\" />\n");
}
delete child;
}
-void Container::addChild(jed_container_t child)
+void Container::add_child(jed_container_t child)
{
xbt_assert(child != nullptr);
this->children.push_back(child);
child->parent = this;
}
-void Container::addResources(std::vector<sg_host_t> hosts)
+void Container::add_resources(std::vector<sg_host_t> hosts)
{
this->is_lowest = 1;
this->children.clear();
}
}
-void Container::createHierarchy(sg_netzone_t from_as)
+void Container::create_hierarchy(sg_netzone_t from_as)
{
if (from_as->get_children()->empty()) {
// I am no AS
// add hosts to jedule platform
std::vector<sg_host_t> table = from_as->get_all_hosts();
- this->addResources(table);
+ this->add_resources(table);
} else {
for (auto const& nz : *from_as->get_children()) {
jed_container_t child_container = new simgrid::jedule::Container(std::string(nz->get_cname()));
- this->addChild(child_container);
- child_container->createHierarchy(nz);
+ this->add_child(child_container);
+ child_container->create_hierarchy(nz);
}
}
}
-std::vector<int> Container::getHierarchy()
+std::vector<int> Container::get_hierarchy()
{
if(this->parent != nullptr ) {
if (not this->parent->children.empty()) {
// we are in the last level
- return this->parent->getHierarchy();
+ return this->parent->get_hierarchy();
} else {
unsigned int i =0;
int child_nb = -1;
}
xbt_assert( child_nb > - 1);
- std::vector<int> heir_list = this->parent->getHierarchy();
+ std::vector<int> heir_list = this->parent->get_hierarchy();
heir_list.insert(heir_list.begin(), child_nb);
return heir_list;
}
}
}
-std::string Container::getHierarchyAsString()
+std::string Container::get_hierarchy_as_string()
{
std::string output("");
- std::vector<int> heir_list = this->getHierarchy();
+ std::vector<int> heir_list = this->get_hierarchy();
unsigned int length = heir_list.size();
unsigned int i = 0;
return output;
}
-void Container::printResources(FILE * jed_file)
+void Container::print_resources(FILE* jed_file)
{
unsigned int i=0;
xbt_assert(not this->resource_list.empty());
unsigned int res_nb = this->resource_list.size();
- std::string resid = this->getHierarchyAsString();
+ std::string resid = this->get_hierarchy_as_string();
fprintf(jed_file, " <rset id=\"%s\" nb=\"%u\" names=\"", resid.c_str(), res_nb);
for (auto const& res : this->resource_list) {
child->print(jed_file);
}
} else {
- this->printResources(jed_file);
+ this->print_resources(jed_file);
}
fprintf(jed_file, " </res>\n");
}
jed_event_t event = new simgrid::jedule::Event(std::string(SD_task_get_name(task)),
SD_task_get_start_time(task), SD_task_get_finish_time(task), "SD");
- event->addResources(task->allocation);
+ event->add_resources(task->allocation);
my_jedule->event_set.push_back(event);
}
my_jedule = new simgrid::jedule::Jedule();
jed_container_t root_container = new simgrid::jedule::Container(std::string(root_comp->get_cname()));
- root_container->createHierarchy(root_comp);
+ root_container->create_hierarchy(root_comp);
my_jedule->root_container = root_container;
}
FILE *fh = fopen(fname, "w");
- my_jedule->writeOutput(fh);
+ my_jedule->write_output(fh);
fclose(fh);
xbt_free(fname);