*/
#define XBT_CRITICAL(...) XBT_LOG(xbt_log_priority_critical, __VA_ARGS__)
-/** @ingroup XBT_log
- * @hideinitializer
- * @brief Log at TRACE priority that we entered in current function.
- */
-#define XBT_IN XBT_IN_F("")
-
/** @ingroup XBT_log
* @hideinitializer
* @brief Log at TRACE priority that we entered in current function, appending a user specified format.
*/
-#define XBT_IN_F(...) XBT_IN_F_(__VA_ARGS__, "")
-#define XBT_IN_F_(fmt, ...) \
+#define XBT_IN(...) XBT_IN_(__VA_ARGS__, "")
+#define XBT_IN_(fmt, ...) \
XBT_LOG(xbt_log_priority_trace, ">> begin of %s" fmt "%s", \
_XBT_FUNCTION, __VA_ARGS__)
* @hideinitializer
* @brief Log at TRACE priority that we exited the current function.
*/
-#define XBT_OUT XBT_LOG(xbt_log_priority_trace, "<< end of %s", _XBT_FUNCTION)
+#define XBT_OUT() XBT_LOG(xbt_log_priority_trace, "<< end of %s", _XBT_FUNCTION)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log at TRACE priority a message indicating that we reached that point.
*/
-#define XBT_HERE XBT_LOG(xbt_log_priority_trace, "-- was here")
+#define XBT_HERE() XBT_LOG(xbt_log_priority_trace, "-- was here")
SG_END_DECL()
#endif /* ! _XBT_LOG_H_ */
{
gras_datadesc_type_t res;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
res = xbt_new0(s_gras_datadesc_type_t, 1);
res->name = (char *) strdup(name);
xbt_set_add(gras_datadesc_set_local, (xbt_set_elm_t) res,
gras_ddt_freev);
- XBT_OUT;
+ XBT_OUT();
return res;
}
gras_datadesc_type_t res;
long int arch;
- XBT_IN;
+ XBT_IN("");
res = gras_datadesc_by_name_or_null(name);
if (res) {
xbt_assert1(res->category_code == e_gras_datadesc_type_cat_scalar,
res->category_code = e_gras_datadesc_type_cat_scalar;
res->category.scalar_data.encoding = encoding;
res->category.scalar_data.type = type;
- XBT_OUT;
+ XBT_OUT();
return res;
}
void gras_dd_cat_field_free(void *f)
{
gras_dd_cat_field_t field = *(gras_dd_cat_field_t *) f;
- XBT_IN;
+ XBT_IN("");
if (field) {
if (field->name)
free(field->name);
free(field);
}
- XBT_OUT;
+ XBT_OUT();
}
/** \brief Declare a new structure description */
gras_datadesc_type_t res;
long int arch;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
/* FIXME: Check that field redefinition matches */
res->category.struct_data.fields =
xbt_dynar_new(sizeof(gras_dd_cat_field_t), gras_dd_cat_field_free);
- XBT_OUT;
+ XBT_OUT();
return res;
}
xbt_assert2(field_type,
"Cannot add the field '%s' into struct '%s': its type is NULL",
name, struct_type->name);
- XBT_IN_F("(%s %s.%s;)", field_type->name, struct_type->name, name);
+ XBT_IN("(%s %s.%s;)", field_type->name, struct_type->name, name);
if (struct_type->category.struct_data.closed) {
XBT_DEBUG
("Ignoring request to add field to struct %s (closed. Redefinition?)",
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
struct_type->aligned_size[GRAS_THISARCH]);
- XBT_OUT;
+ XBT_OUT();
}
/** \brief Close a structure description
void gras_datadesc_struct_close(gras_datadesc_type_t struct_type)
{
int arch;
- XBT_IN;
+ XBT_IN("");
struct_type->category.struct_data.closed = 1;
for (arch = 0; arch < gras_arch_count; arch++) {
struct_type->size[arch] = struct_type->aligned_size[arch];
gras_datadesc_type_t res;
int arch;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
xbt_assert0(selector,
"Attempt to creat an union without field_count function");
gras_dd_cat_field_t field;
int arch;
- XBT_IN_F("(%s %s.%s;)", field_type->name, union_type->name, name);
+ XBT_IN("(%s %s.%s;)", field_type->name, union_type->name, name);
xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
"Cannot add a dynamically sized field in union %s",
union_type->name);
gras_datadesc_by_name("data pointer");
int arch;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
xbt_assert1(res->category_code == e_gras_datadesc_type_cat_ref,
gras_datadesc_by_name("data pointer");
int arch;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
gras_datadesc_type_t res;
int arch;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
xbt_assert1(res->category_code == e_gras_datadesc_type_cat_array,
gras_datadesc_type_t res;
int arch;
- XBT_IN_F("(%s)", name);
+ XBT_IN("(%s)", name);
xbt_assert1(dynamic_size,
"'%s' is a dynamic array without size discriminant", name);
/* local functions */
static void parse_type_modifier(type_modifier_t type_modifier)
{
- XBT_IN;
+ XBT_IN("");
do {
if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_STAR) {
/* This only used when parsing 'short *' since this function returns when int, float, double,... is encountered */
break;
}
} while (1);
- XBT_OUT;
+ XBT_OUT();
}
static void print_type_modifier(s_type_modifier_t tm)
{
int i;
- XBT_IN;
+ XBT_IN("");
if (tm.is_unsigned)
printf("(unsigned) ");
if (tm.is_short)
for (i = 0; i < tm.is_ref; i++)
printf("(ref) ");
- XBT_OUT;
+ XBT_OUT();
}
static void change_to_fixed_array(xbt_dynar_t dynar, long int size)
s_identifier_t former, array;
memset(&array, 0, sizeof(array));
- XBT_IN;
+ XBT_IN("");
xbt_dynar_pop(dynar, &former);
array.type_name = (char *) xbt_malloc(strlen(former.type->name) + 48);
XBT_DEBUG("Array specification (size=%ld, elm='%s'), change pushed type",
array.name = former.name;
xbt_dynar_push(dynar, &array);
- XBT_OUT;
+ XBT_OUT();
}
static void change_to_ref(xbt_dynar_t dynar)
s_identifier_t former, ref;
memset(&ref, 0, sizeof(ref));
- XBT_IN;
+ XBT_IN("");
xbt_dynar_pop(dynar, &former);
ref.type_name = (char *) xbt_malloc(strlen(former.type->name) + 2);
XBT_DEBUG("Ref specification (elm='%s'), change pushed type",
ref.name = former.name;
xbt_dynar_push(dynar, &ref);
- XBT_OUT;
+ XBT_OUT();
}
static void change_to_ref_pop_array(xbt_dynar_t dynar)
s_identifier_t former, ref;
memset(&ref, 0, sizeof(ref));
- XBT_IN;
+ XBT_IN("");
xbt_dynar_pop(dynar, &former);
ref.type = gras_datadesc_ref_pop_arr(former.type); /* redeclaration are ignored */
ref.type_name = (char *) strdup(ref.type->name);
free(former.type_name);
xbt_dynar_push(dynar, &ref);
- XBT_OUT;
+ XBT_OUT();
}
static void change_to_dynar_of(xbt_dynar_t dynar,
s_identifier_t former, ref;
memset(&ref, 0, sizeof(ref));
- XBT_IN;
+ XBT_IN("");
xbt_dynar_pop(dynar, &former);
ref.type = gras_datadesc_dynar(subtype, NULL); /* redeclaration are ignored */
ref.type_name = (char *) strdup(ref.type->name);
free(former.type_name);
xbt_dynar_push(dynar, &ref);
- XBT_OUT;
+ XBT_OUT();
}
static void change_to_matrix_of(xbt_dynar_t dynar,
s_identifier_t former, ref;
memset(&ref, 0, sizeof(ref));
- XBT_IN;
+ XBT_IN("");
xbt_dynar_pop(dynar, &former);
ref.type = gras_datadesc_matrix(subtype, NULL); /* redeclaration are ignored */
ref.type_name = (char *) strdup(ref.type->name);
free(former.type_name);
xbt_dynar_push(dynar, &ref);
- XBT_OUT;
+ XBT_OUT();
}
static void add_free_f(xbt_dynar_t dynar, void_f_pvoid_t free_f)
s_identifier_t former, ref;
memset(&ref, 0, sizeof(ref));
- XBT_IN;
+ XBT_IN("");
xbt_dynar_pop(dynar, &former);
memcpy(former.type->extra, free_f, sizeof(free_f));
xbt_dynar_push(dynar, &former);
- XBT_OUT;
+ XBT_OUT();
}
static void parse_statement(char *definition,
int expect_id_separator = 0;
- XBT_IN;
+ XBT_IN("");
memset(&identifier, 0, sizeof(identifier));
gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_RA) {
- XBT_OUT;
+ XBT_OUT();
THROW0(mismatch_error, 0, "End of the englobing structure or union");
}
if (identifier.tm.is_dynar > 0)
PARSE_ERROR0("xbt_dynar_t field without 'subtype' annotation");
- XBT_OUT;
+ XBT_OUT();
}
static gras_datadesc_type_t parse_struct(char *definition)
gras_datadesc_type_t struct_type;
- XBT_IN;
+ XBT_IN("");
identifiers = xbt_dynar_new(sizeof(s_identifier_t), NULL);
fields_to_push = xbt_dynar_new(sizeof(char *), NULL);
xbt_dynar_free(&identifiers);
xbt_dynar_free(&fields_to_push);
- XBT_OUT;
+ XBT_OUT();
return struct_type;
}
gras_datadesc_type_t struct_desc = NULL;
gras_datadesc_type_t typedef_desc = NULL;
- XBT_IN;
+ XBT_IN("");
memset(&tm, 0, sizeof(tm));
/* get the aliased type */
PARSE_ERROR0
("Unimplemented feature: GRAS_DEFINE_TYPE cannot handle typedef yet");
- XBT_OUT;
+ XBT_OUT();
return typedef_desc;
}
int semicolon_count = 0;
int def_count, C_count;
- XBT_IN;
+ XBT_IN("");
/* reput the \n in place for debug */
for (C_count = 0; C_statement[C_count] != '\0'; C_count++)
if (C_statement[C_count] == ';' || C_statement[C_count] == '{')
xbt_abort();
}
gras_ddt_parse_lex_destroy();
- XBT_OUT;
+ XBT_OUT();
return res;
}
sock_iter->valid = 0; /* don't close it. User may keep references to it */
} else {
/* Got a suited socket ! */
- XBT_OUT;
+ XBT_OUT();
sock_iter->recvd = 1;
XBT_DEBUG("Filled little buffer (%c %x %d)", sock_iter->recvd_val,
sock_iter->recvd_val, recvd);
*dst = sock;
- XBT_OUT;
+ XBT_OUT();
}
/**
gras_socket_t sock_iter = NULL;
unsigned int cursor;
- XBT_IN;
+ XBT_IN("");
XBT_VERB("Close %p", sock);
if (sock == _gras_lastly_selected_socket) {
xbt_assert0(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
/* free the memory */
free(sock);
- XBT_OUT;
+ XBT_OUT();
return;
}
}
sock);
xbt_backtrace_display_current();
}
- XBT_OUT;
+ XBT_OUT();
}
/**
char *chunk = NULL;
unsigned long int sent_sofar;
- XBT_IN;
+ XBT_IN("");
THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
if (gras_if_RL())
free(chunk);
- XBT_OUT;
+ XBT_OUT();
}
/** \brief Receive a chunk of data over a measurement socket
char *chunk = NULL;
unsigned long int got_sofar;
- XBT_IN;
+ XBT_IN("");
THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
free(chunk);
- XBT_OUT;
+ XBT_OUT();
}
/**
unsigned int cpt;
gras_sg_portrec_t pr;
- XBT_IN_F(" (sock=%p)", sock);
+ XBT_IN(" (sock=%p)", sock);
if (!sock)
return;
XBT_DEBUG("Check pr %d of %lu", cpt, xbt_dynar_length(hd->ports));
if (pr->port == sockdata->server_port) {
xbt_dynar_cursor_rm(hd->ports, &cpt);
- XBT_OUT;
+ XBT_OUT();
return;
}
}
/* FIXME: kill the rdv point if receiver side */
free(sock->data);
}
- XBT_OUT;
+ XBT_OUT();
}
typedef struct {
uint32_t hisport;
- XBT_IN;
+ XBT_IN("");
gras_trp_socket_new(1, &res);
sd = accept(sock->sd, (struct sockaddr *) &peer_in, &peer_in_len);
xbt_dynar_push(((gras_trp_procdata_t)
gras_libdata_by_id(gras_trp_libdata_id))->sockets, &res);
- XBT_OUT;
+ XBT_OUT();
return res;
}
int size;
#endif
gras_trp_bufdata_t *data = sock->bufdata;
- XBT_IN;
+ XBT_IN("");
XBT_DEBUG("Flush");
if (data->out == buffering_buf) {
gras_trp_bufdata_t *data = (gras_trp_bufdata_t *) sock->bufdata;
int chunk_pos = 0;
- XBT_IN;
+ XBT_IN("");
while (chunk_pos < size) {
/* size of the chunk to receive in that shot */
gras_trp_bufiov_flush(sock);
}
- XBT_OUT;
+ XBT_OUT();
}
static int
gras_trp_bufdata_t *data = sock->bufdata;
long int chunk_pos = 0;
- XBT_IN;
+ XBT_IN("");
while (chunk_pos < size) {
/* size of the chunk to receive in that shot */
sock->moredata = (data->in_buf.size > data->in_buf.pos);
XBT_DEBUG("There is %smore data", (sock->moredata ? "" : "no "));
- XBT_OUT;
+ XBT_OUT();
return chunk_pos;
}
surf_action_cpu_Cas01_t action = NULL;
cpu_Cas01_t CPU = cpu;
- XBT_IN_F("(%s,%g)", surf_resource_name(CPU), size);
+ XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
action =
surf_action_new(sizeof(s_surf_action_cpu_Cas01_t), size,
surf_cpu_model,
action->generic_action.priority,
CPU->power_scale * CPU->power_peak, 1);
lmm_expand(cpu_maxmin_system, CPU->constraint, action->variable, 1.0);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
if (duration > 0)
duration = MAX(duration, MAXMIN_PRECISION);
- XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
+ XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
action->generic_action.max_duration = duration;
action->suspended = 2;
}
lmm_update_variable_weight(cpu_maxmin_system, action->variable, 0.0);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
static void cpu_action_suspend(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
lmm_update_variable_weight(cpu_maxmin_system,
((surf_action_cpu_Cas01_t)
action)->variable, 0.0);
((surf_action_cpu_Cas01_t) action)->suspended = 1;
}
- XBT_OUT;
+ XBT_OUT();
}
static void cpu_action_resume(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
lmm_update_variable_weight(cpu_maxmin_system,
((surf_action_cpu_Cas01_t)
action)->variable, action->priority);
((surf_action_cpu_Cas01_t) action)->suspended = 0;
}
- XBT_OUT;
+ XBT_OUT();
}
static int cpu_action_is_suspended(surf_action_t action)
static void cpu_action_set_max_duration(surf_action_t action,
double duration)
{
- XBT_IN_F("(%p,%g)", action, duration);
+ XBT_IN("(%p,%g)", action, duration);
action->max_duration = duration;
- XBT_OUT;
+ XBT_OUT();
}
static void cpu_action_set_priority(surf_action_t action, double priority)
{
- XBT_IN_F("(%p,%g)", action, priority);
+ XBT_IN("(%p,%g)", action, priority);
action->priority = priority;
lmm_update_variable_weight(cpu_maxmin_system,
((surf_action_cpu_Cas01_t) action)->variable,
priority);
- XBT_OUT;
+ XBT_OUT();
}
#ifdef HAVE_TRACING
static void cpu_action_set_category(surf_action_t action, const char *category)
{
- XBT_IN_F("(%p,%s)", action, category);
+ XBT_IN("(%p,%s)", action, category);
action->category = xbt_strdup (category);
- XBT_OUT;
+ XBT_OUT();
}
#endif
static double cpu_action_get_remains(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
return action->remains;
- XBT_OUT;
+ XBT_OUT();
}
static e_surf_resource_state_t cpu_get_state(void *cpu)
surf_action_cpu_Cas01_im_t action = NULL;
cpu_Cas01_im_t CPU = cpu;
- XBT_IN_F("(%s,%g)", surf_resource_name(CPU), size);
+ XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
action =
surf_action_new(sizeof(s_surf_action_cpu_Cas01_im_t), size,
surf_cpu_model,
xbt_swag_insert(action, CPU->action_set);
lmm_expand(cpu_im_maxmin_system, CPU->constraint,
GENERIC_LMM_ACTION(action).variable, 1.0);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
if (duration > 0)
duration = MAX(duration, MAXMIN_PRECISION);
- XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
+ XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
action = (surf_action_cpu_Cas01_im_t) cpu_im_execute(cpu, 1.0);
GENERIC_ACTION(action).max_duration = duration;
GENERIC_LMM_ACTION(action).suspended = 2;
lmm_update_variable_weight(cpu_im_maxmin_system,
GENERIC_LMM_ACTION(action).variable, 0.0);
xbt_swag_insert(cpu, cpu_im_modified_cpu);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
static void cpu_im_action_suspend(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
if (((surf_action_lmm_t) action)->suspended != 2) {
lmm_update_variable_weight(cpu_im_maxmin_system,
((surf_action_lmm_t) action)->variable,
((surf_action_cpu_Cas01_im_t) action)->index_heap);
xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
}
- XBT_OUT;
+ XBT_OUT();
}
static void cpu_im_action_resume(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
if (((surf_action_lmm_t) action)->suspended != 2) {
lmm_update_variable_weight(cpu_im_maxmin_system,
((surf_action_lmm_t) action)->variable,
((surf_action_lmm_t) action)->suspended = 0;
xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
}
- XBT_OUT;
+ XBT_OUT();
}
static int cpu_im_action_is_suspended(surf_action_t action)
static void cpu_im_action_set_max_duration(surf_action_t action,
double duration)
{
- XBT_IN_F("(%p,%g)", action, duration);
+ XBT_IN("(%p,%g)", action, duration);
action->max_duration = duration;
/* insert cpu in modified_cpu set to notice the max duration change */
xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
- XBT_OUT;
+ XBT_OUT();
}
static void cpu_im_action_set_priority(surf_action_t action,
double priority)
{
- XBT_IN_F("(%p,%g)", action, priority);
+ XBT_IN("(%p,%g)", action, priority);
action->priority = priority;
lmm_update_variable_weight(cpu_im_maxmin_system,
((surf_action_lmm_t) action)->variable,
priority);
xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
- XBT_OUT;
+ XBT_OUT();
}
#ifdef HAVE_TRACING
static void cpu_im_action_set_category(surf_action_t action,
const char *category)
{
- XBT_IN_F("(%p,%s)", action, category);
+ XBT_IN("(%p,%s)", action, category);
action->category = xbt_strdup (category);
- XBT_OUT;
+ XBT_OUT();
}
#endif
static double cpu_im_action_get_remains(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
/* update remains before return it */
cpu_im_update_remains(ACTION_GET_CPU(action), surf_get_clock());
return action->remains;
- XBT_OUT;
+ XBT_OUT();
}
static e_surf_resource_state_t cpu_im_get_state(void *cpu)
surf_action_cpu_ti_t action = NULL;
cpu_ti_t CPU = cpu;
- XBT_IN_F("(%s,%g)", surf_resource_name(CPU), size);
+ XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
action =
surf_action_new(sizeof(s_surf_action_cpu_ti_t), size, surf_cpu_model,
CPU->state_current != SURF_RESOURCE_ON);
action->suspended = 0; /* Should be useless because of the
calloc but it seems to help valgrind... */
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
if (duration > 0)
duration = MAX(duration, MAXMIN_PRECISION);
- XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
+ XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
action = (surf_action_cpu_ti_t) cpu_ti_execute(cpu, 1.0);
action->generic_action.max_duration = duration;
action->suspended = 2;
cpu_ti_running_action_set_that_does_not_need_being_checked;
xbt_swag_insert(action, ((surf_action_t) action)->state_set);
}
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
static void cpu_ti_action_suspend(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
if (((surf_action_cpu_ti_t) action)->suspended != 2) {
((surf_action_cpu_ti_t) action)->suspended = 1;
xbt_heap_remove(cpu_ti_action_heap,
((surf_action_cpu_ti_t) action)->index_heap);
xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
}
- XBT_OUT;
+ XBT_OUT();
}
static void cpu_ti_action_resume(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
if (((surf_action_cpu_ti_t) action)->suspended != 2) {
((surf_action_cpu_ti_t) action)->suspended = 0;
xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
}
- XBT_OUT;
+ XBT_OUT();
}
static int cpu_ti_action_is_suspended(surf_action_t action)
surf_action_cpu_ti_t ACT = (surf_action_cpu_ti_t) action;
double min_finish;
- XBT_IN_F("(%p,%g)", action, duration);
+ XBT_IN("(%p,%g)", action, duration);
action->max_duration = duration;
}
xbt_heap_push(cpu_ti_action_heap, ACT, min_finish);
- XBT_OUT;
+ XBT_OUT();
}
static void cpu_ti_action_set_priority(surf_action_t action,
double priority)
{
- XBT_IN_F("(%p,%g)", action, priority);
+ XBT_IN("(%p,%g)", action, priority);
action->priority = priority;
xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
- XBT_OUT;
+ XBT_OUT();
}
static double cpu_ti_action_get_remains(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
cpu_ti_update_remaining_amount((cpu_ti_t)
((surf_action_cpu_ti_t) action)->cpu,
surf_get_clock());
return action->remains;
- XBT_OUT;
+ XBT_OUT();
}
static e_surf_resource_state_t cpu_ti_get_state(void *cpu)
double diff_0 = 0.0;
min = max = init;
- XBT_IN;
+ XBT_IN("");
if (init == 0.0) {
min = max = 0.5;
if ((diff_0 = diff(1e-16, var_cnst)) >= 0) {
XBT_CDEBUG(surf_lagrange_dichotomy, "returning 0.0 (diff = %e)", diff_0);
- XBT_OUT;
+ XBT_OUT();
return 0.0;
}
}
XBT_CDEBUG(surf_lagrange_dichotomy, "returning %e", (min + max) / 2.0);
- XBT_OUT;
+ XBT_OUT();
return ((min + max) / 2.0);
}
double diff = 0.0;
double sigma_i = 0.0;
- XBT_IN;
+ XBT_IN("");
elem_list = &(cnst->element_set);
XBT_CDEBUG(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", cnst);
XBT_CDEBUG(surf_lagrange_dichotomy,
"d D/d lambda for cnst (%p) at %1.20f = %1.20f", cnst, lambda,
diff);
- XBT_OUT;
+ XBT_OUT();
return diff;
}
int i;
lmm_element_t elem = NULL;
- XBT_IN_F("(sys=%p, var=%p)", sys, var);
+ XBT_IN("(sys=%p, var=%p)", sys, var);
sys->modified = 1;
for (i = 0; i < var->cnsts_number; i++) {
lmm_update_modified_set(sys, elem->constraint);
}
var->cnsts_number = 0;
- XBT_OUT;
+ XBT_OUT();
}
static void lmm_var_free(lmm_system_t sys, lmm_variable_t var)
lmm_variable_t var = NULL;
int i;
- XBT_IN_F("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)",
+ XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)",
sys, id, weight, bound, number_of_constraints);
var = xbt_mallocator_get(sys->variable_mallocator);
xbt_swag_insert_at_head(var, &(sys->variable_set));
else
xbt_swag_insert_at_tail(var, &(sys->variable_set));
- XBT_OUT;
+ XBT_OUT();
return var;
}
{
lmm_constraint_t useless_cnst = NULL;
- XBT_IN_F("sys=%p, cnst=%p, min_usage=%f", sys, cnst, *min_usage);
+ XBT_IN("sys=%p, cnst=%p, min_usage=%f", sys, cnst, *min_usage);
if (cnst->usage <= 0) {
- XBT_OUT;
+ XBT_OUT();
return;
}
if (cnst->remaining <= 0) {
- XBT_OUT;
+ XBT_OUT();
return;
}
if ((*min_usage < 0) || (*min_usage > cnst->remaining / cnst->usage)) {
} else if (*min_usage == cnst->remaining / cnst->usage) {
xbt_swag_insert(cnst, &(sys->saturated_constraint_set));
}
- XBT_OUT;
+ XBT_OUT();
}
static XBT_INLINE void saturated_variable_set_update(lmm_system_t sys)
if (!(sys->modified))
return;
- XBT_IN_F("(sys=%p)", sys);
+ XBT_IN("(sys=%p)", sys);
/*
* Compute Usage and store the variables that reach the maximum.
if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
lmm_print(sys);
}
- XBT_OUT;
+ XBT_OUT();
}
/* Not a O(1) function */
if (weight == var->weight)
return;
- XBT_IN_F("(sys=%p, var=%p, weight=%f)", sys, var, weight);
+ XBT_IN("(sys=%p, var=%p, weight=%f)", sys, var, weight);
sys->modified = 1;
var->weight = weight;
xbt_swag_remove(var, &(sys->variable_set));
if (!weight)
var->value = 0.0;
- XBT_OUT;
+ XBT_OUT();
}
XBT_INLINE double lmm_get_variable_weight(lmm_variable_t var)
/* LARGE PLATFORMS HACK:
total_route_size = route_size + src->link_nb + dst->nb */
- XBT_IN_F("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+ XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
/* LARGE PLATFORMS HACK:
assert on total_route_size */
latency = global_routing->get_latency(src_name,dst_name);
#endif
xbt_dynar_free(&route);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
{
surf_action_network_Constant_t action = NULL;
- XBT_IN_F("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+ XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
action =
surf_action_new(sizeof(s_surf_action_network_Constant_t), size,
xbt_swag_insert(action, action->generic_action.state_set);
}
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
int i = 0;
int *gtnets_links;
- XBT_IN_F("(src_id=%d, dst_id=%d, links=%p, nb_link=%d)",
+ XBT_IN("(src_id=%d, dst_id=%d, links=%p, nb_link=%d)",
src_id, dst_id, links, nb_link);
/* Build the list of gtnets link IDs */
if (gtnets_add_route(src_id, dst_id, gtnets_links, nb_link)) {
xbt_assert0(0, "Cannot create GTNetS route");
}
- XBT_OUT;
+ XBT_OUT();
}
static void route_onehop_new(int src_id, int dst_id,
/* LARGE PLATFORMS HACK:
total_route_size = route_size + src->link_nb + dst->nb */
- XBT_IN_F("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+ XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
/* LARGE PLATFORMS HACK:
assert on total_route_size */
xbt_assert2(xbt_dynar_length(route),
#endif
xbt_dynar_free(&route);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
e_surf_action_state_t state)
{
surf_action_state_t action_state = &(action->model_type->states);
- XBT_IN_F("(%p,%s)", action, surf_action_state_names[state]);
+ XBT_IN("(%p,%s)", action, surf_action_state_names[state]);
xbt_swag_remove(action, action->state_set);
if (state == SURF_ACTION_READY)
if (action->state_set)
xbt_swag_insert(action, action->state_set);
- XBT_OUT;
+ XBT_OUT();
}
void surf_action_data_set(surf_action_t action, void *data)
static void ptask_action_suspend(surf_action_t action)
{
- XBT_IN_F("(%p))", action);
+ XBT_IN("(%p))", action);
if (((surf_action_workstation_L07_t) action)->suspended != 2) {
((surf_action_workstation_L07_t) action)->suspended = 1;
lmm_update_variable_weight(ptask_maxmin_system,
((surf_action_workstation_L07_t)
action)->variable, 0.0);
}
- XBT_OUT;
+ XBT_OUT();
}
static void ptask_action_resume(surf_action_t action)
surf_action_workstation_L07_t act =
(surf_action_workstation_L07_t) action;
- XBT_IN_F("(%p)", act);
+ XBT_IN("(%p)", act);
if (act->suspended != 2) {
lmm_update_variable_weight(ptask_maxmin_system, act->variable, 1.0);
act->suspended = 0;
}
- XBT_OUT;
+ XBT_OUT();
}
static int ptask_action_is_suspended(surf_action_t action)
static void ptask_action_set_max_duration(surf_action_t action,
double duration)
{ /* FIXME: should inherit */
- XBT_IN_F("(%p,%g)", action, duration);
+ XBT_IN("(%p,%g)", action, duration);
action->max_duration = duration;
- XBT_OUT;
+ XBT_OUT();
}
static void ptask_action_set_priority(surf_action_t action,
double priority)
{ /* FIXME: should inherit */
- XBT_IN_F("(%p,%g)", action, priority);
+ XBT_IN("(%p,%g)", action, priority);
action->priority = priority;
- XBT_OUT;
+ XBT_OUT();
}
static double ptask_action_get_remains(surf_action_t action)
{
- XBT_IN_F("(%p)", action);
+ XBT_IN("(%p)", action);
return action->remains;
- XBT_OUT;
+ XBT_OUT();
}
/**************************************/
{
surf_action_workstation_L07_t action = NULL;
- XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
+ XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
action = (surf_action_workstation_L07_t) ptask_execute(cpu, 1.0);
action->generic_action.max_duration = duration;
action->suspended = 2;
lmm_update_variable_weight(ptask_maxmin_system, action->variable, 0.0);
- XBT_OUT;
+ XBT_OUT();
return (surf_action_t) action;
}
int len;
- XBT_IN;
+ XBT_IN("");
if (!options || !strlen(options)) { /* nothing to do */
return;
}
first argument.
The TRACE priority is not used the same way than the other. You should use
-the #XBT_IN, #XBT_IN_F, #XBT_OUT and #XBT_HERE macros
-instead.
+the #XBT_IN, #XBT_OUT and #XBT_HERE macros instead.
\section log_API_example 2.6 Example of use