- unsigned int iter;
- char *host_name;
- char *buf;
-
- parent->is_lowest = 1;
- xbt_dynar_free(&parent->container_children);
- parent->container_children = NULL;
- parent->name2id = xbt_dict_new_homogeneous(xbt_free_f);
- parent->last_id = 0;
- parent->resource_list = xbt_dynar_new(sizeof(char *), NULL);
-
- xbt_dynar_sort_strings(host_names);
-
- xbt_dynar_foreach(host_names, iter, host_name) {
- buf = bprintf("%d", parent->last_id);
- (parent->last_id)++;
- xbt_dict_set(parent->name2id, host_name, buf, NULL);
- xbt_dict_set(host2_simgrid_parent_container, host_name, parent, NULL);
- xbt_dynar_push(parent->resource_list, &host_name);
+ res_nb = this->resource_list.size();
+
+ std::string resid = this->getHierarchyAsString();
+
+ fprintf(jed_file, " <rset id=\"%s\" nb=\"%u\" names=\"", resid.c_str(), res_nb);
+ for (auto res: this->resource_list) {
+ const char * res_name = sg_host_get_name(res);
+ fprintf(jed_file, "%s", res_name);
+ if( i != res_nb-1 ) {
+ fprintf(jed_file, "|");
+ }
+ i++;