m_task_t task = NULL;
int a;
int id = 0;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
int limited_latency=0;
+#endif
double remaining = 0;
char id_alias[10];
for (id = 0; id < NTASKS; id++) {
if (gl_task_array[id] == NULL) {
} else if (gl_task_array[id] == task) {
+#ifdef HAVE_LATENCY_BOUND_TRACKING
limited_latency = MSG_task_is_latency_bounded(gl_task_array[id]);
if(limited_latency){
INFO1("WARNING FLOW[%d] is limited by latency!!", id);
}
+#endif
INFO5
("===> Estimated Bw of FLOW[%d] : %f ; message from %s to %s with remaining : %f",
id, gl_data_size[id] / elapsed_time, masternames[id],
slavenames[id], 0.0);
} else {
remaining = MSG_task_get_remaining_communication(gl_task_array[id]);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
limited_latency = MSG_task_is_latency_bounded(gl_task_array[id]);
if(limited_latency){
INFO1("WARNING FLOW[%d] is limited by latency!!", id);
}
+#endif
INFO5
("===> Estimated Bw of FLOW[%d] : %f ; message from %s to %s with remaining : %f",
id, (gl_data_size[id] - remaining) / elapsed_time, masternames[id],
XBT_PUBLIC(double) SIMIX_action_get_remains(smx_action_t action);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
XBT_PUBLIC(int) SIMIX_action_is_latency_bounded(smx_action_t action);
+#endif
XBT_PUBLIC(e_surf_action_state_t) SIMIX_action_get_state(smx_action_t action);
XBT_INLINE XBT_PUBLIC(void) SIMIX_communication_cancel(smx_comm_t comm);
XBT_PUBLIC(void) SIMIX_communication_destroy(smx_comm_t comm);
XBT_PUBLIC(double) SIMIX_communication_get_remains(smx_comm_t comm);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
XBT_PUBLIC(int) SIMIX_communication_is_latency_bounded(smx_comm_t comm);
+#endif
XBT_PUBLIC(void *) SIMIX_communication_get_data(smx_comm_t comm);
XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm);
lmm_constraint_t lmm_get_first_active_constraint(lmm_system_t sys);
lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t sys,
lmm_constraint_t cnst);
-
+#ifdef HAVE_LATENCY_BOUND_TRACKING
XBT_PUBLIC(int) lmm_is_variable_limited_by_latency(lmm_variable_t var);
+#endif
void *lmm_constraint_id(lmm_constraint_t cnst);
void *lmm_variable_id(lmm_variable_t var);
the task is completed) */
double remains; /**< How much of that cost remains to
* be done in the currently running task */
+#ifdef HAVE_LATENCY_BOUND_TRACKING
int latency_limited; /**< Set to 1 if is limited by latency, 0 otherwise */
+#endif
double start; /**< start time */
double finish; /**< finish time : this is modified during the run
void (*set_max_duration) (surf_action_t action, double duration);/**< Set the max duration of an action*/
void (*set_priority) (surf_action_t action, double priority);/**< Set the priority of an action */
double (*get_remains) (surf_action_t action);/**< Get the remains of an action */
+#ifdef HAVE_LATENCY_BOUND_TRACKING
int (*get_latency_limited) (surf_action_t action);/**< Return 1 if action is limited by latency, 0 otherwise */
+#endif
xbt_dict_t resource_set;
return SIMIX_communication_get_remains(task->simdata->comm);
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
/** \ingroup m_task_management
* \brief Return 1 if communication task is limited by latency, 0 otherwise
*
DEBUG1("calling SIMIX_communication_is_latency_bounded(%p)", task->simdata->comm);
return SIMIX_communication_is_latency_bounded(task->simdata->comm);
}
+#endif
/** \ingroup m_task_management
* \brief Returns the size of the data attached to a task #m_task_t.
return surf_workstation_model->get_remains(action->surf_action);
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
XBT_INLINE int SIMIX_action_is_latency_bounded(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
return surf_workstation_model->get_latency_limited(action->surf_action);
}
+#endif
smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb,
smx_host_t * host_list,
/* Pimple to get an histogram of message sizes in the simulation */
xbt_dict_t msg_sizes = NULL;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
xbt_dict_t latency_limited_dict = NULL;
+#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
"Logging specific to SIMIX (network)");
{
VERB2("Destroy communication %p; refcount initially %d",comm,comm->refcount);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
//save is latency limited flag to use afterwards
if (latency_limited_dict == NULL) {
latency_limited_dict = xbt_dict_new();
DEBUG2("adding key %p with latency limited value %d to the dict", comm, SIMIX_action_is_latency_bounded(comm->act));
xbt_dicti_set(latency_limited_dict, (uintptr_t)comm, SIMIX_action_is_latency_bounded(comm->act));
}
+#endif
comm->refcount--;
if(comm->refcount > 0)
return SIMIX_action_get_remains(comm->act);
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
/**
* \brief verify if communication is latency bounded
* \param comm The communication
DEBUG1("calling SIMIX_action_is_latency_bounded(%p)", comm->act);
return SIMIX_action_is_latency_bounded(comm->act);
}
+#endif
/******************************************************************************/
/* SIMIX_network_copy_data callbacks */
return xbt_swag_getNext(cnst, (sys->active_constraint_set).offset);
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
XBT_INLINE int lmm_is_variable_limited_by_latency(lmm_variable_t var)
{
return (double_equals(var->bound, var->value));
}
+#endif
/** \brief Update the constraint set propagating recursively to
return;
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
int net_get_link_latency(surf_action_t action)
{
return action->latency_limited;
}
+#endif
double net_action_get_remains(surf_action_t action)
{
#define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable) )))
xbt_swag_foreach(action, running_actions) {
- if( lmm_is_variable_limited_by_latency(action->variable) ){
- (action->generic_action).latency_limited = 1;
- }else{
- (action->generic_action).latency_limited = 0;
- }
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+ if( lmm_is_variable_limited_by_latency(action->variable) ){
+ (action->generic_action).latency_limited = 1;
+ }else{
+ (action->generic_action).latency_limited = 0;
+ }
+#endif
if (action->latency > 0) {
if (min < 0)
min = action->latency;
action =
surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
surf_network_model, failed);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
(action->generic_action).latency_limited = 0;
+#endif
xbt_swag_insert(action, action->generic_action.state_set);
action->rate = rate;
surf_network_model->action_cancel = net_action_cancel;
surf_network_model->action_recycle = net_action_recycle;
surf_network_model->get_remains = net_action_get_remains;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
surf_network_model->get_latency_limited = net_get_link_latency;
+#endif
surf_network_model->model_private->resource_used = net_resource_used;
surf_network_model->model_private->share_resources = net_share_resources;
surf_network_model->action_cancel = netcste_action_cancel;
surf_network_model->action_recycle = net_action_recycle;
surf_network_model->get_remains = net_action_get_remains;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
surf_network_model->get_latency_limited = net_get_link_latency;
+#endif
surf_network_model->model_private->resource_used = netcste_resource_used;
surf_network_model->model_private->share_resources = netcste_share_resources;
routing_model_create(sizeof(network_link_GTNETS_t), NULL);
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
static int get_latency_limited(surf_action_t action){
return 0;
}
+#endif
#ifdef HAVE_GTNETS
void surf_network_model_init_GTNETS(const char *filename)
define_callbacks(filename);
xbt_dynar_push(model_list, &surf_network_model);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
surf_network_model->get_latency_limited = get_latency_limited;
+#endif
if(sg_gtnets_jitter > 0.0){
gtnets_set_jitter(sg_gtnets_jitter);
double weight;
lmm_variable_t variable;
double rate;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
int latency_limited;
+#endif
int suspended;
#ifdef HAVE_TRACING
xbt_dict_set(coords, A_surfxml_host_id,coord,NULL);
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
static int netviva_get_latency_limited(surf_action_t action){
return 0;
}
+#endif
+
void surf_network_model_init_Vivaldi(const char *filename)
{
xbt_assert(surf_network_model == NULL);
surf_network_model->action_cancel = netviva_action_cancel;
surf_network_model->action_recycle = netviva_action_recycle;
surf_network_model->get_remains = netviva_action_get_remains;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
surf_network_model->get_latency_limited = netviva_get_latency_limited;
+#endif
surf_network_model->model_private->resource_used = netviva_resource_used;
surf_network_model->model_private->share_resources = netviva_share_resources;
void net_action_recycle(surf_action_t action);
double net_action_get_remains(surf_action_t action);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
int net_get_link_latency(surf_action_t action);
+#endif
void net_action_set_max_duration(surf_action_t action, double duration);
/*
* Returns the initial path. On Windows the initial path is
DIE_IMPOSSIBLE;
}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
static int ws_get_latency_limited(surf_action_t action)
{
if (action->model_type == surf_network_model)
INFO0("You tried to ask if a non network action is limited by latency, aborting...");
DIE_IMPOSSIBLE;
}
+#endif
static double ws_action_get_remains(surf_action_t action)
{
surf_workstation_model->set_max_duration = ws_action_set_max_duration;
surf_workstation_model->set_priority = ws_action_set_priority;
surf_workstation_model->get_remains = ws_action_get_remains;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
surf_workstation_model->get_latency_limited = ws_get_latency_limited;
+#endif
surf_workstation_model->extension.workstation.execute = ws_execute;
surf_workstation_model->extension.workstation.sleep = ws_action_sleep;