SET(HAVE_TRACING 1)
endif(enable_tracing)
+if(enable_jedule)
+ SET(HAVE_JEDULE 1)
+endif(enable_jedule)
+
if(enable_latency_bound_tracking)
SET(HAVE_LATENCY_BOUND_TRACKING 1)
else(enable_latency_bound_tracking)
src/instr/instr_private.h
)
+
+set(JEDULE_SRC
+ include/instr/jedule/jedule_events.h
+ include/instr/jedule/jedule_output.h
+ include/instr/jedule/jedule_platform.h
+ include/instr/jedule/jedule_sd_binding.h
+ src/instr/jedule/jedule_events.c
+ src/instr/jedule/jedule_output.c
+ src/instr/jedule/jedule_platform.c
+ src/instr/jedule/jedule_sd_binding.c
+)
+
set(RUBY_SRC
src/simix/smx_context_ruby.c
src/bindings/ruby/rb_msg_process.c
${GRAS_COMMON_SRC}
${GRAS_SG_SRC}
${AMOK_SRC}
+ ${JEDULE_SRC}
)
if(HAVE_MC)
option(enable_print_message "Enable print message during config." off)
option(enable_model-checking "" off)
option(enable_lib_static "" off)
+option(enable_jedule "Jedule output of SimDAG." off)
if(enable_supernovae AND enable_model-checking)
set(enable_model-checking false CACHE TYPE INTERNAL FORCE)
message(" Supernovae mode: ${enable_supernovae}")
message(" Model checking : ${enable_model-checking}")
message(" Tracing mode : ${enable_tracing}")
+message(" Jedule mode : ${enable_jedule}")
message(" Latency bound : ${enable_latency_bound_tracking}")
message(" Graphviz mode : ${HAVE_GRAPHVIZ}")
message("")
#ifndef JEDULE_EVENTS_H_
#define JEDULE_EVENTS_H_
-#include "jedule_platform.h"
+#include "simgrid_config.h"
#include "xbt/dynar.h"
#include "xbt/dict.h"
+#include "instr/jedule/jedule_platform.h"
+
+
+#ifdef HAVE_JEDULE
+
struct jed_event {
int event_id;
char *name;
void jed_event_add_info(jed_event_t event, char *key, char *value);
+#endif
+
#endif /* JEDULE_EVENTS_H_ */
#ifndef JEDULE_OUTPUT_H_
#define JEDULE_OUTPUT_H_
+#include "simgrid_config.h"
+
+#include <stdio.h>
+
#include "jedule_events.h"
#include "jedule_platform.h"
-xbt_dynar_t jedule_event_list;
+#ifdef HAVE_JEDULE
-void init_jedule_output();
+extern xbt_dynar_t jedule_event_list;
-void cleanup_jedule();
+void jedule_init_output();
+
+void jedule_cleanup_output();
void jedule_store_event(jed_event_t event);
-void write_jedule_output(char *filename, jedule_t jedule,
+void write_jedule_output(FILE *file, jedule_t jedule,
xbt_dynar_t event_list, xbt_dict_t meta_info_dict);
+#endif
+
#endif /* JEDULE_OUTPUT_H_ */
#ifndef JED_SIMGRID_PLATFORM_H_
#define JED_SIMGRID_PLATFORM_H_
+#include "simgrid_config.h"
+
#include "xbt/dynar.h"
#include "xbt/hash.h"
+#ifdef HAVE_JEDULE
+
typedef struct jed_simgrid_container s_jed_simgrid_container_t,
*jed_simgrid_container_t;
*/
+#endif
+
#endif /* JED_SIMGRID_PLATFORM_H_ */
#ifndef JEDULE_SD_BINDING_H_
#define JEDULE_SD_BINDING_H_
+#include "simgrid_config.h"
+
+#include "simdag/private.h"
+#include "simdag/datatypes.h"
+#include "simdag/simdag.h"
+
+#ifdef HAVE_JEDULE
+
void jedule_log_sd_event(SD_task_t task);
void jedule_setup_platform();
+void jedule_sd_init();
+
+void jedule_sd_cleanup();
+
+void jedule_sd_dump();
+
#endif /* JEDULE_SD_BINDING_H_ */
+
+
+#endif
/* Tracing SimGrid */
#cmakedefine HAVE_TRACING @HAVE_TRACING@
+/* Jedule output */
+#cmakedefine HAVE_JEDULE @HAVE_JEDULE@
+
/* Tracking of latency bound */
#cmakedefine HAVE_LATENCY_BOUND_TRACKING @HAVE_LATENCY_BOUND_TRACKING@
#include <stdlib.h>
#include <string.h>
-#include "jedule_events.h"
-#include "jedule_platform.h"
-
#include "xbt/dict.h"
#include "xbt/dynar.h"
#include "xbt/asserts.h"
+#include "instr/jedule/jedule_events.h"
+#include "instr/jedule/jedule_platform.h"
+
+#ifdef HAVE_JEDULE
+
void jed_event_add_resources(jed_event_t event, xbt_dynar_t host_selection) {
xbt_dynar_t resource_subset_list;
jed_res_subset_t res_set;
free(event);
}
+
+#endif
#include <stdlib.h>
#include <string.h>
-#include "jedule_output.h"
+#include "instr/jedule/jedule_output.h"
#include "xbt/dynar.h"
#include "xbt/asserts.h"
+#ifdef HAVE_JEDULE
+
/*********************************************************/
+xbt_dynar_t jedule_event_list;
+
static FILE *jed_file;
static void print_platform(jed_simgrid_container_t root_container);
xbt_dict_cursor_t cursor=NULL;
char *key,*data;
- xbt_dict_foreach(key_value_dict,cursor,key,data) {
- fprintf(jed_file, "<prop key=\"%s\" values=\"%s\" />\n",key,data);
+ if( key_value_dict != NULL ) {
+ xbt_dict_foreach(key_value_dict,cursor,key,data) {
+ fprintf(jed_file, "<prop key=\"%s\" values=\"%s\" />\n",key,data);
+ }
}
}
}
-void write_jedule_output(char *filename, jedule_t jedule,
+void write_jedule_output(FILE *file, jedule_t jedule,
xbt_dynar_t event_list, xbt_dict_t meta_info_dict) {
- xbt_assert( filename != NULL );
+// xbt_assert( jed_file != NULL );
- jed_file = fopen(filename, "w");
- xbt_assert( jed_file != NULL );
+ jed_file = file;
fprintf(jed_file, "<jedule>\n");
fprintf(jed_file, "</jedule>\n");
- fclose(jed_file);
-
}
-void init_jedule_output() {
+void jedule_init_output() {
jedule_event_list = xbt_dynar_new(sizeof(jed_event_t), NULL);
}
-void cleanup_jedule() {
+void jedule_cleanup_output() {
xbt_dynar_free(&jedule_event_list);
}
xbt_dynar_push(jedule_event_list, &event);
}
-
+#endif
#include "xbt/asserts.h"
#include "xbt/dynar.h"
-#include "jedule_platform.h"
+#include "instr/jedule/jedule_platform.h"
+
+#ifdef HAVE_JEDULE
/********************************************************************/
/********************************************************************/
static int compare_hostnames(const void *host1, const void *host2) {
- return strcmp ((char*)host1, (char*)host2);
+ const char *hp1 = *((const char**) host1);
+ const char *hp2 = *((const char**) host2);
+ return strcmp (hp1, hp2);
}
static int compare_ids(const void *num1, const void *num2) {
parent->last_id = 0;
parent->resource_list = xbt_dynar_new(sizeof(char *), NULL);
-
xbt_dynar_sort (host_names, &compare_hostnames);
xbt_dynar_foreach(host_names, iter, host_name) {
xbt_dict_free(&container_name2container);
}
-
+#endif
*/
+#include <stdio.h>
+
#include "xbt/asserts.h"
#include "xbt/dynar.h"
+#include "surf/surf_private.h"
+#include "surf/surf.h"
+
+#include "instr/jedule/jedule_sd_binding.h"
+#include "instr/jedule/jedule_events.h"
+#include "instr/jedule/jedule_platform.h"
+#include "instr/jedule/jedule_output.h"
+
+#ifdef HAVE_JEDULE
+
+jedule_t jedule;
+
void jedule_log_sd_event(SD_task_t task) {
xbt_dynar_t host_list;
jed_event_t event;
xbt_dynar_push(host_list, &hostname);
}
- create_jed_event(&event, SD_task_get_name(task), task->start_time,
- task->finish_time, "SD");
+ create_jed_event(&event,
+ SD_task_get_name(task),
+ task->start_time,
+ task->finish_time,
+ "SD");
jed_event_add_resources(event, host_list);
-
jedule_store_event(event);
xbt_dynar_free(&host_list);
}
+static void create_hierarchy(routing_component_t current_comp,
+ jed_simgrid_container_t current_container) {
+ xbt_dict_cursor_t cursor = NULL;
+ char *key;
+ routing_component_t elem;
+ network_element_t network_elem;
+
+ if( xbt_dict_length(current_comp->routing_sons) == 0 ) {
+ // I am no AS
+ // add hosts to jedule platform
+ xbt_dynar_t hosts;
+
+ hosts = xbt_dynar_new(sizeof(char*), NULL);
+
+ xbt_dict_foreach(current_comp->to_index, cursor, key, network_elem) {
+ char *hostname;
+ printf("key %s value %d\n", key, network_elem);
+ //xbt_dynar_push_as(hosts, char*, key);
+ hostname = strdup(key);
+ xbt_dynar_push(hosts, &hostname);
+ }
+
+ jed_simgrid_add_resources(current_container, hosts);
+
+ } else {
+ xbt_dict_foreach(current_comp->routing_sons, cursor, key, elem) {
+ jed_simgrid_container_t child_container;
+ jed_simgrid_create_container(&child_container, elem->name);
+ jed_simgrid_add_container(current_container, child_container);
+ printf("name : %s\n", elem->name);
+ create_hierarchy(elem, child_container);
+ }
+ }
+}
void jedule_setup_platform() {
+ routing_component_t root_comp;
+ e_surf_network_element_type_t type;
+
+ jed_simgrid_container_t root_container;
+
+
+ jed_create_jedule(&jedule);
+
+ root_comp = global_routing->root;
+ printf("root name %s\n", root_comp->name);
+ // that doesn't work
+ type = root_comp->get_network_element_type(root_comp->name);
+ jed_simgrid_create_container(&root_container, root_comp->name);
+ jedule->root_container = root_container;
+ create_hierarchy(root_comp, root_container);
+
+}
+
+
+void jedule_sd_cleanup() {
+
+ jedule_cleanup_output();
+}
+
+void jedule_sd_init() {
+
+ jedule_init_output();
+}
+
+void jedule_sd_dump() {
+
+ write_jedule_output(stdout, jedule, jedule_event_list, NULL);
}
+
+#endif
#endif
#ifdef HAVE_JEDULE
-#include "instr/jedule/jedule_output.h"
+#include "instr/jedule/jedule_sd_binding.h"
#endif
XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag");
#endif
#ifdef HAVE_JEDULE
- init_jedule_output();
+ jedule_sd_init();
#endif
}
sd_global->task_number = 0;
#ifdef HAVE_JEDULE
- cleanup_jedule();
- init_jedule_output();
+ jedule_sd_cleanup();
+ jedule_sd_init();
#endif
} else {
TRACE_end();
#endif
#ifdef HAVE_JEDULE
- cleanup_jedule();
+ jedule_sd_dump();
+ jedule_sd_cleanup();
#endif
DEBUG0("Exiting Surf...");
task->finish_time =
surf_workstation_model->action_get_finish_time(task->surf_action);
task->remains = 0;
+#ifdef HAVE_JEDULE
+ jedule_log_sd_event(task);
+#endif
break;
case SD_FAILED:
task->state_set = sd_global->failed_task_set;
TRACE_surf_action(task->surf_action, task->category);
#endif
-#ifdef HAVE_JEDULE
- jedule_log_sd_event(task);
-#endif
-
__SD_task_destroy_scheduling_data(task); /* now the scheduling data are not useful anymore */
__SD_task_set_state(task, SD_RUNNING);
xbt_assert2(__SD_task_is_running(task), "Bad state of task '%s': %d",
new_component->generic_routing.finalize = full_finalize;
new_component->generic_routing.to_index = xbt_dict_new();
new_component->generic_routing.bypassRoutes = xbt_dict_new();
+ new_component->generic_routing.get_network_element_type = get_network_element_type;
return new_component;
}
new_component->generic_routing.finalize = floyd_finalize;
new_component->generic_routing.to_index = xbt_dict_new();
new_component->generic_routing.bypassRoutes = xbt_dict_new();
+ new_component->generic_routing.get_network_element_type = get_network_element_type;
return new_component;
}
new_component->cached = cached;
new_component->generic_routing.to_index = xbt_dict_new();
new_component->generic_routing.bypassRoutes = xbt_dict_new();
+ new_component->generic_routing.get_network_element_type = get_network_element_type;
return new_component;
}
new_component->generic_routing.get_latency = generic_get_link_latency;
new_component->generic_routing.get_bypass_route = rulebased_get_bypass_route;
new_component->generic_routing.finalize = rulebased_finalize;
+ new_component->generic_routing.get_network_element_type = get_network_element_type;
/* initialization of internal structures */
new_component->dict_processing_units = xbt_dict_new();
new_component->dict_autonomous_systems = xbt_dict_new();