)
set(SMPI_SRC
+ src/smpi/instr_smpi.c
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_c99.c
src/surf/cpu_cas01.c
src/surf/cpu_ti.c
src/surf/fair_bottleneck.c
+ src/surf/instr_routing.c
+ src/surf/instr_surf.c
src/surf/lagrange.c
src/surf/maxmin.c
src/surf/network.c
)
set(MSG_SRC
+ src/msg/instr_msg_process.c
+ src/msg/instr_msg_task.c
src/msg/msg_actions.c
src/msg/msg_config.c
src/msg/msg_deployment.c
set(TRACING_SRC
src/instr/instr_config.c
src/instr/instr_interface.c
- src/instr/instr_msg_process.c
- src/instr/instr_msg_task.c
src/instr/instr_paje_containers.c
src/instr/instr_paje_trace.c
src/instr/instr_paje_header.c
src/instr/instr_paje_values.c
src/instr/instr_private.h
src/instr/instr_resource_utilization.c
- src/instr/instr_routing.c
- src/instr/instr_smpi.c
- src/instr/instr_surf.c
)
set(JEDULE_SRC
${SIMGRID_SRC}
${SIMIX_SRC}
${SURF_SRC}
+ ${SMPI_SRC}
+ ${TRACING_SRC}
${XBT_SRC}
)
if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
name = xbt_str_join_array(action, " ");
-#ifdef HAVE_TRACING
- int rank = get_rank(MSG_process_get_name(MSG_process_self()));
- int dst_traced = get_rank(action[2]);
- TRACE_smpi_ptp_in(rank, rank, dst_traced, "send");
- TRACE_smpi_send(rank, rank, dst_traced);
-#endif
-
XBT_DEBUG("Entering Send: %s (size: %lg)", name, size);
if (size<65536) {
action_Isend(action);
XBT_VERB("%s %f", name, MSG_get_clock() - clock);
free(name);
-
-#ifdef HAVE_TRACING
- TRACE_smpi_ptp_out(rank, rank, dst_traced, "send");
-#endif
-
asynchronous_cleanup();
}
if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
name = xbt_str_join_array(action, " ");
-#ifdef HAVE_TRACING
- int rank = get_rank(MSG_process_get_name(MSG_process_self()));
- int src_traced = get_rank(action[2]);
- TRACE_smpi_ptp_in(rank, src_traced, rank, "recv");
-#endif
-
XBT_DEBUG("Receiving: %s", name);
msg_error_t res = MSG_task_receive(&task, mailbox_name);
// MSG_task_receive(&task, MSG_process_get_name(MSG_process_self()));
}
free(name);
-#ifdef HAVE_TRACING
- TRACE_smpi_ptp_out(rank, src_traced, rank, "recv");
- TRACE_smpi_recv(rank, src_traced, rank);
-#endif
-
asynchronous_cleanup();
}
process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
XBT_DEBUG("Irecv on %s", MSG_process_get_name(MSG_process_self()));
-#ifdef HAVE_TRACING
- int rank = get_rank(MSG_process_get_name(MSG_process_self()));
- int src_traced = get_rank(action[2]);
- globals->last_Irecv_sender_id = src_traced;
- MSG_process_set_data(MSG_process_self(), (void *) globals);
-
- TRACE_smpi_ptp_in(rank, src_traced, rank, "Irecv");
-#endif
sprintf(mailbox, "%s_%s", action[2],
MSG_process_get_name(MSG_process_self()));
XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
-#ifdef HAVE_TRACING
- TRACE_smpi_ptp_out(rank, src_traced, rank, "Irecv");
-#endif
-
asynchronous_cleanup();
}
if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
name = xbt_str_join_array(action, " ");
-#ifdef HAVE_TRACING
- process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
- int src_traced = counters->last_Irecv_sender_id;
- int rank = get_rank(MSG_process_get_name(MSG_process_self()));
- TRACE_smpi_ptp_in(rank, src_traced, rank, "wait");
-#endif
XBT_DEBUG("Entering %s", name);
comm = xbt_dynar_pop_as(globals->irecvs,msg_comm_t);
XBT_VERB("%s %f", name, MSG_get_clock() - clock);
free(name);
-#ifdef HAVE_TRACING
- TRACE_smpi_ptp_out(rank, src_traced, rank, "wait");
- TRACE_smpi_recv(rank, src_traced, rank);
-#endif
-
}
/* FIXME: that's a poor man's implementation: we should take the message exchanges into account */
static void action_init(const char *const *action)
{
-#ifdef HAVE_TRACING
- TRACE_smpi_init(get_rank(MSG_process_get_name(MSG_process_self())));
-#endif
XBT_DEBUG("Initialize the counters");
process_globals_t globals = (process_globals_t) calloc(1, sizeof(s_process_globals_t));
globals->isends = xbt_dynar_new(sizeof(msg_comm_t),NULL);
static void action_finalize(const char *const *action)
{
-#ifdef HAVE_TRACING
- TRACE_smpi_finalize(get_rank(MSG_process_get_name(MSG_process_self())));
-#endif
process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
if (globals){
xbt_dynar_free_container(&(globals->isends));
*
* @{
*/
+
typedef struct xbt_node *xbt_node_t;
typedef struct xbt_edge *xbt_edge_t;
typedef struct xbt_graph *xbt_graph_t;
+/* Node structure */
+/* Be carfull of what you do with this structure */
+/* typedef struct xbt_node *xbt_node_t; */
+typedef struct xbt_node {
+ xbt_dynar_t out;
+ xbt_dynar_t in; /* not used when the graph is directed */
+ double position_x; /* positive value: negative means undefined */
+ double position_y; /* positive value: negative means undefined */
+ void *data; /* user data */
+ void *xbtdata; /* private xbt data: should be reinitialized at the
+ beginning of your algorithm if you need to use it */
+} s_xbt_node_t;
+
+/* edge structure */
+/* Be carfull of what you do with this structure */
+/* typedef struct xbt_edge *xbt_edge_t; */
+typedef struct xbt_edge {
+ xbt_node_t src;
+ xbt_node_t dst;
+ void *data; /* user data */
+ void *xbtdata; /* private xbt data: should be reinitialized at the
+ beginning of your algorithm if you need to use it */
+ double length; /* positive value: negative means undefined */
+} s_xbt_edge_t;
+
+/* Graph structure */
+/* Be carfull of what you do with this structure */
+/* typedef struct xbt_graph *xbt_graph_t; */
+typedef struct xbt_graph {
+ xbt_dynar_t nodes;
+ xbt_dynar_t edges;
+ unsigned short int directed;
+ void *data; /* user data */
+ void *xbtdata; /* private xbt data: should be reinitialized at the
+ beginning of your algorithm if you need to use it */
+} s_xbt_graph_t;
+
/* API */
XBT_PUBLIC(xbt_graph_t) xbt_graph_new_graph(unsigned short int directed,
void *data);
+int TRACE_start (void);
+int TRACE_end (void);
+void TRACE_global_init(int *argc, char **argv);
void TRACE_help(int detailed);
+void TRACE_surf_resource_utilization_alloc(void);
+void TRACE_surf_resource_utilization_release(void);
+void TRACE_add_start_function(void (*func)(void));
+void TRACE_add_end_function(void (*func)(void));
--- /dev/null
+#include "smpi/smpi.h"
+
+/********** Tracing **********/
+/* from smpi_instr.c */
+void TRACE_smpi_alloc(void);
+void TRACE_smpi_release(void);
+void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation);
+void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation);
+void TRACE_smpi_send(int rank, int src, int dst);
+void TRACE_smpi_recv(int rank, int src, int dst);
+void TRACE_smpi_init(int rank);
+void TRACE_smpi_finalize(int rank);
#include "xbt/swag.h"
#include "xbt/dynar.h"
#include "xbt/dict.h"
+#include "xbt/graph.h"
#include "xbt/misc.h"
#include "xbt/file_stat.h"
#include "portable.h"
*/
const char *__surf_get_initial_path(void);
+/********** Tracing **********/
+/* from surf_instr.c */
+void TRACE_surf_action(surf_action_t surf_action, const char *category);
+void TRACE_surf_alloc(void);
+void TRACE_surf_release(void);
+
+/* instr_routing.c */
+void instr_routing_define_callbacks (void);
+void instr_new_variable_type (const char *new_typename, const char *color);
+void instr_new_user_variable_type (const char *father_type, const char *new_typename, const char *color);
+void instr_new_user_state_type (const char *father_type, const char *new_typename);
+void instr_new_value_for_user_state_type (const char *typename, const char *value, const char *color);
+int instr_platform_traced (void);
+xbt_graph_t instr_routing_platform_graph (void);
+void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
+
SG_END_DECL()
#endif /* _SURF_SURF_H */
#include "instr/instr_private.h"
#include "simgrid/sg_config.h"
+#include "surf/surf.h"
#ifdef HAVE_TRACING
static int trace_configured = 0;
static int trace_active = 0;
+
+
static void TRACE_getopts(void)
{
trace_enabled = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING);
trace_basic = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_BASIC);
}
+xbt_dynar_t TRACE_start_functions = NULL;
+void TRACE_add_start_function(void (*func)()) {
+ if (TRACE_start_functions==NULL)
+ TRACE_start_functions = xbt_dynar_new(sizeof(void (*)()), NULL);
+ xbt_dynar_push(TRACE_start_functions, &func);
+}
+
int TRACE_start()
{
TRACE_getopts();
declared_marks = xbt_dict_new_homogeneous (xbt_free);
user_host_variables = xbt_dict_new_homogeneous (xbt_free);
user_link_variables = xbt_dict_new_homogeneous (xbt_free);
- TRACE_surf_alloc();
- TRACE_smpi_alloc();
+
+ if (TRACE_start_functions!=NULL) {
+ void (*func)();
+ unsigned int iter = xbt_dynar_length(TRACE_start_functions);
+ xbt_dynar_foreach(TRACE_start_functions, iter, func) {
+ func();
+ }
+ }
return 0;
}
+xbt_dynar_t TRACE_end_functions = NULL;
+void TRACE_add_end_function(void (*func)(void)) {
+ if (TRACE_end_functions==NULL)
+ TRACE_end_functions = xbt_dynar_new(sizeof(void (*) (void)), NULL);
+ xbt_dynar_push(TRACE_end_functions, &func);
+}
+
int TRACE_end()
{
if (!trace_active)
PJ_type_free_all();
PJ_container_release();
PJ_type_release();
- TRACE_smpi_release();
- TRACE_surf_release();
+
+ if (TRACE_end_functions!=NULL) {
+ void (*func) (void);
+ unsigned int iter;
+ xbt_dynar_foreach(TRACE_end_functions, iter, func) {
+ func();
+ }
+ }
+
xbt_dict_free(&user_link_variables);
xbt_dict_free(&user_host_variables);
xbt_dict_free(&declared_marks);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "instr/instr_private.h"
+#include "xbt/lib.h"
+#include "surf/surf.h"
+#include "surf/surf_routing.h"
#ifdef HAVE_TRACING
#ifndef INSTR_PRIVATE_H_
#define INSTR_PRIVATE_H_
+#include "instr/instr.h"
#include "instr/instr_interface.h"
#include "simgrid_config.h"
#define INSTR_DEFAULT_STR_SIZE 500
-#include "msg/msg.h"
-#include "simdag/private.h"
-#include "simix/smx_private.h"
-#include "xbt/graph_private.h"
+#include "xbt/graph.h"
+#include "xbt/dict.h"
+#include "simgrid/platf.h"
typedef enum {
PAJE_DefineContainerType,
void new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer, const char *value, const char *key);
void new_pajeNewEvent (double timestamp, container_t container, type_t type, val_t value);
-/* declaration of instrumentation functions from msg_task_instr.c */
-void TRACE_msg_set_task_category(msg_task_t task, const char *category);
-void TRACE_msg_task_create(msg_task_t task);
-void TRACE_msg_task_execute_start(msg_task_t task);
-void TRACE_msg_task_execute_end(msg_task_t task);
-void TRACE_msg_task_destroy(msg_task_t task);
-void TRACE_msg_task_get_start(void);
-void TRACE_msg_task_get_end(double start_time, msg_task_t task);
-int TRACE_msg_task_put_start(msg_task_t task); //returns TRUE if the task_put_end must be called
-void TRACE_msg_task_put_end(void);
-
-/* declaration of instrumentation functions from msg_process_instr.c */
-char *instr_process_id (msg_process_t proc, char *str, int len);
-char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len);
-void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host,
- msg_host_t new_host);
-void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host);
-void TRACE_msg_process_destroy (const char *process_name, int process_pid, msg_host_t host);
-void TRACE_msg_process_kill(msg_process_t process);
-void TRACE_msg_process_suspend(msg_process_t process);
-void TRACE_msg_process_resume(msg_process_t process);
-void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c
-void TRACE_msg_process_sleep_out(msg_process_t process);
-void TRACE_msg_process_end(msg_process_t process);
-
-/* from surf_instr.c */
-void TRACE_surf_alloc(void);
-void TRACE_surf_release(void);
-void TRACE_surf_host_set_power(double date, const char *resource, double power);
-void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
-void TRACE_surf_link_set_latency(double date, const char *resource, double latency);
-void TRACE_surf_action(surf_action_t surf_action, const char *category);
-
//for tracing gtnets
void TRACE_surf_gtnets_communicate(void *action, void *src, void *dst);
-/* from smpi_instr.c */
-void TRACE_internal_smpi_set_category (const char *category);
-const char *TRACE_internal_smpi_get_category (void);
-void TRACE_smpi_alloc(void);
-void TRACE_smpi_release(void);
-void TRACE_smpi_init(int rank);
-void TRACE_smpi_finalize(int rank);
-void TRACE_smpi_collective_in(int rank, int root, const char *operation);
-void TRACE_smpi_collective_out(int rank, int root, const char *operation);
-void TRACE_smpi_computing_init(int rank);
-void TRACE_smpi_computing_out(int rank);
-void TRACE_smpi_computing_in(int rank);
-void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation);
-void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation);
-void TRACE_smpi_send(int rank, int src, int dst);
-void TRACE_smpi_recv(int rank, int src, int dst);
-
/* from instr_config.c */
-int TRACE_start (void);
-int TRACE_end (void);
int TRACE_needs_platform (void);
int TRACE_is_enabled(void);
int TRACE_platform(void);
char *TRACE_get_filename(void);
char *TRACE_get_viva_uncat_conf (void);
char *TRACE_get_viva_cat_conf (void);
-void TRACE_global_init(int *argc, char **argv);
void TRACE_generate_viva_uncat_conf (void);
void TRACE_generate_viva_cat_conf (void);
void instr_pause_tracing (void);
double now,
double delta);
void TRACE_surf_resource_utilization_alloc(void);
-void TRACE_surf_resource_utilization_release(void);
/* instr_paje.c */
extern xbt_dict_t trivaNodeTypes;
val_t PJ_value_get (const char *name, const type_t father);
void PJ_value_free (val_t value);
-/* instr_routing.c */
-void instr_routing_define_callbacks (void);
-void instr_new_variable_type (const char *new_typename, const char *color);
-void instr_new_user_variable_type (const char *father_type, const char *new_typename, const char *color);
-void instr_new_user_state_type (const char *father_type, const char *new_typename);
-void instr_new_value_for_user_state_type (const char *typename, const char *value, const char *color);
-int instr_platform_traced (void);
-xbt_graph_t instr_routing_platform_graph (void);
-void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
-
#endif /* HAVE_TRACING */
#ifdef HAVE_JEDULE
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "instr/instr_private.h"
+#include "msg_private.h"
#include "mc/mc.h"
+#include "msg/datatypes.h"
+#include "simix/smx_process_private.h"
+
#ifdef HAVE_TRACING
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "instr/instr_private.h"
+#include "msg_private.h"
+#include "msg/datatypes.h"
#include "mc/mc.h"
+
#ifdef HAVE_TRACING
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg, instr, "MSG");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "instr/instr_interface.h"
#include "msg_private.h"
#include "msg_mailbox.h"
#include "mc/mc.h"
return;
#ifdef HAVE_TRACING
- TRACE_surf_release();
+ TRACE_surf_resource_utilization_release();
#endif
/* initialization of the action module */
void MSG_post_create_environment(void);
+/********** Tracing **********/
+/* declaration of instrumentation functions from msg_task_instr.c */
+void TRACE_msg_set_task_category(msg_task_t task, const char *category);
+void TRACE_msg_task_create(msg_task_t task);
+void TRACE_msg_task_execute_start(msg_task_t task);
+void TRACE_msg_task_execute_end(msg_task_t task);
+void TRACE_msg_task_destroy(msg_task_t task);
+void TRACE_msg_task_get_start(void);
+void TRACE_msg_task_get_end(double start_time, msg_task_t task);
+int TRACE_msg_task_put_start(msg_task_t task); //returns TRUE if the task_put_end must be called
+void TRACE_msg_task_put_end(void);
+
+/* declaration of instrumentation functions from msg_process_instr.c */
+char *instr_process_id (msg_process_t proc, char *str, int len);
+char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len);
+void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host,
+ msg_host_t new_host);
+void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host);
+void TRACE_msg_process_destroy (const char *process_name, int process_pid, msg_host_t host);
+void TRACE_msg_process_kill(msg_process_t process);
+void TRACE_msg_process_suspend(msg_process_t process);
+void TRACE_msg_process_resume(msg_process_t process);
+void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c
+void TRACE_msg_process_sleep_out(msg_process_t process);
+void TRACE_msg_process_end(msg_process_t process);
+
SG_END_DECL()
#endif
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "private.h"
+#include "instr/instr_interface.h"
#include "xbt/sysdep.h"
#include "xbt/dynar.h"
#include "surf/surf.h"
#include "xbt/log.h"
#include "xbt/str.h"
#include "xbt/config.h"
-#include "instr/instr_private.h"
#include "surf/surfxml_parse.h"
#ifdef HAVE_LUA
#include <lua.h>
void SD_exit(void)
{
#ifdef HAVE_TRACING
- TRACE_surf_release();
+ TRACE_surf_resource_utilization_release();
#endif
xbt_mallocator_free(sd_global->task_mallocator);
#include "instr/instr_interface.h"
#include "simgrid/simix.h"
#include "simgrid/sg_config.h"
-#include "mc/mc.h"
+#include "smpi/smpi_interface.h"
+#include "mc/mc.h"
+#include "instr/instr.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
"About the configuration of simgrid");
}
}
-
/* callback of the workstation/model variable */
static void _sg_cfg_cb__workstation_model(const char *name, int pos)
{
int default_value_int;
int i;
+ TRACE_add_start_function(TRACE_surf_alloc);
+ TRACE_add_start_function(TRACE_smpi_alloc);
+
+ TRACE_add_end_function(TRACE_smpi_release);
+ TRACE_add_end_function(TRACE_surf_release);
+
/* Create the configuration support */
if (_sg_init_status == 0) { /* Only create stuff if not already inited */
sprintf(description,
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "instr/instr_private.h"
+#include "private.h"
#include "mc/mc.h"
#include <ctype.h>
#include <wchar.h>
#include "xbt.h"
#include "xbt/xbt_os_time.h"
#include "simgrid/simix.h"
-#include "smpi/smpi.h"
+#include "smpi/smpi_interface.h"
#include "smpi/smpif.h"
#include "smpi/smpi_cocci.h"
#include "instr/instr_private.h"
int* recvtype, int* src, int* recvtag,
int* comm, MPI_Status* status, int* ierr);
+/********** Tracing **********/
+/* from smpi_instr.c */
+void TRACE_internal_smpi_set_category (const char *category);
+const char *TRACE_internal_smpi_get_category (void);
+void TRACE_smpi_collective_in(int rank, int root, const char *operation);
+void TRACE_smpi_collective_out(int rank, int root, const char *operation);
+void TRACE_smpi_computing_init(int rank);
+void TRACE_smpi_computing_out(int rank);
+void TRACE_smpi_computing_in(int rank);
#endif
XBT_PUBLIC_DATA(int) surfxml_bufferstack_size;
+/********** Tracing **********/
+/* from surf_instr.c */
+void TRACE_surf_host_set_power(double date, const char *resource, double power);
+void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
+void TRACE_surf_link_set_latency(double date, const char *resource, double latency);
+
+
#endif /* _SURF_SURF_PRIVATE_H */
#ifndef _XBT_GRAPH_PRIVATE_H
#define _XBT_GRAPH_PRIVATE_H
#include "xbt/dynar.h"
+#include "xbt/graph.h"
#define NOT_EXPLORED 0
#define CURRENTLY_EXPLORING 1
#define ALREADY_EXPLORED 2
-/* Node structure */
-/* typedef struct xbt_node *xbt_node_t; */
-typedef struct xbt_node {
- xbt_dynar_t out;
- xbt_dynar_t in; /* not used when the graph is directed */
- double position_x; /* positive value: negative means undefined */
- double position_y; /* positive value: negative means undefined */
- void *data; /* user data */
- void *xbtdata; /* private xbt data: should be reinitialized at the
- beginning of your algorithm if you need to use it */
-} s_xbt_node_t;
-
-/* edge structure */
-/* typedef struct xbt_edge *xbt_edge_t; */
-typedef struct xbt_edge {
- xbt_node_t src;
- xbt_node_t dst;
- void *data; /* user data */
- void *xbtdata; /* private xbt data: should be reinitialized at the
- beginning of your algorithm if you need to use it */
- double length; /* positive value: negative means undefined */
-} s_xbt_edge_t;
-
-/* Graph structure */
-/* typedef struct xbt_graph *xbt_graph_t; */
-typedef struct xbt_graph {
- xbt_dynar_t nodes;
- xbt_dynar_t edges;
- unsigned short int directed;
- void *data; /* user data */
- void *xbtdata; /* private xbt data: should be reinitialized at the
- beginning of your algorithm if you need to use it */
-} s_xbt_graph_t;
void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d,
xbt_node_t * p);
void xbt_graph_depth_visit(xbt_graph_t g, xbt_node_t n,