XBT_PUBLIC_CLASS Event{
private:
- ~Event()=default;
+ virtual ~Event()=default;
public:
Event(std::string name, double start_time, double end_time, std::string type)
: name(name), start_time(start_time), end_time(end_time), type(type){}
XBT_PUBLIC_CLASS Container {
public:
Container(std::string name);
- ~Container()=default;
+ virtual ~Container()=default;
private:
int last_id;
- int is_lowest;
+ int is_lowest = 0;
public:
std::string name;
std::unordered_map<const char*, int> name2id;
- Container *parent;
+ Container *parent = nullptr;
std::vector<Container*> children;
std::vector<sg_host_t> resource_list;
void addChild(Container* child);
SG_BEGIN_DECL()
typedef simgrid::jedule::Container * jed_container_t;
+/* FIXME: jedule_container should be objectified too */
/** selection of a subset of resources from the original set */
struct jed_res_subset {
jed_container_t parent;
typedef struct jed_res_subset s_jed_res_subset_t, *jed_res_subset_t;
+/* FIXME: jedule should be objectified too */
+
typedef struct jedule_struct {
jed_container_t root_container;
std::unordered_map<char*, char*> jedule_meta_info;
namespace simgrid{
namespace jedule{
+ /* FIXME: this should could maybe be merged into the destructor? */
void Event::deleteEvent(){
while (!this->resource_subsets.empty()){
xbt_free(this->resource_subsets.back());
#if HAVE_JEDULE
-#define STR_BUF_SIZE 1024
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_out, jedule, "Logging specific to Jedule output");
xbt_dynar_t jedule_event_list;
Container::Container(std::string name)
: name(name) {
- this->is_lowest = 0;
- this->parent = nullptr;
-
xbt_dict_set(container_name2container, this->name.c_str(), this, nullptr);
}
}
void Container::printResources(FILE * jed_file){
- unsigned int res_nb;
unsigned int i=0;
xbt_assert(!this->resource_list.empty());
- res_nb = this->resource_list.size();
-
+ unsigned int 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);
return *((int*) num1) - *((int*) num2);
}
+/* FIXME: That should be the destructor, shouldnt it? */
static void jed_free_container(jed_container_t container) {
if(!container->children.empty()) {
for (auto child: container->children){