case TASK_FIND_SUCCESSOR_ANSWER:
case TASK_GET_PREDECESSOR_ANSWER:
- XBT_DEBUG("Ignoring unexpected task of type %d (%p)", type, task);
+ XBT_DEBUG("Ignoring unexpected task of type %d (%p)", (int)type, task);
task_free(task);
break;
}
if (res != MSG_OK) {
XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request (task %p): %d",
- task_sent, res);
+ task_sent, (int)res);
stop = 1;
MSG_comm_destroy(node->comm_receive);
node->comm_receive = NULL;
if (res != MSG_OK) {
XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request (task %p): %d",
- task_sent, res);
+ task_sent, (int)res);
stop = 1;
MSG_comm_destroy(node->comm_receive);
node->comm_receive = NULL;
request->peer.name = NULL;
request->peer.port = xbt_socket_my_port(measMasterIn);
XBT_DEBUG
- ("Handshaking with %s:%d to connect it back on my %d (bufsize=%ld, msg_size=%ld, msg_amount=%ld)",
+ ("Handshaking with %s:%d to connect it back on my %d (bufsize=%lu, msg_size=%lu, msg_amount=%lu)",
xbt_socket_peer_name(peer), xbt_socket_peer_port(peer),
request->peer.port, request->buf_size, request->msg_size,
request->msg_amount);
xbt_socket_peer_name(peer), request_ack->peer.port);
}
XBT_DEBUG
- ("Got ACK; conduct the experiment (msg_size = %ld, msg_amount=%ld)",
+ ("Got ACK; conduct the experiment (msg_size = %lu, msg_amount=%lu)",
request->msg_size, request->msg_amount);
*sec = 0;
- XBT_DEBUG("Ask for a BW test between %s:%d and %s:%d", from_name, from_port,
+ XBT_DEBUG("Ask for a BW test between %s:%u and %s:%u", from_name, from_port,
to_name, to_port);
gras_msg_rpccall(sock, 20 * 60, "BW request", &request, &result);
if (bw)
*bw = result->bw;
- XBT_VERB("BW test (%s:%d -> %s:%d) took %f sec (%f kb/s)",
+ XBT_VERB("BW test (%s:%u -> %s:%u) took %f sec (%f kb/s)",
from_name, from_port, to_name, to_port,
result->sec, ((double) result->bw) / 1024.0);
xbt_socket_t peer, asker;
asker = gras_msg_cb_ctx_from(ctx);
- XBT_VERB("Asked by %s:%d to conduct a bw XP with %s:%d (request: %ld %ld)",
+ XBT_VERB("Asked by %s:%d to conduct a bw XP with %s:%d (request: %lu %lu)",
xbt_socket_peer_name(asker), xbt_socket_peer_port(asker),
request->peer.name, request->peer.port,
request->msg_size, request->msg_amount);
xbt_socket_t sock;
sat_request_t request = xbt_new(s_sat_request_t, 1);
- XBT_VERB("Start from_name %s:%d -> to_name %s:%d",
+ XBT_VERB("Start from_name %s:%u -> to_name %s:%u",
from_name, from_port, to_name, to_port);
sock = gras_socket_client(from_name, from_port);
/* Negociate the saturation with the peer */
sat_request_t request = xbt_new(s_sat_request_t, 1);
- XBT_DEBUG("Begin to saturate to %s:%d", to_name, to_port);
+ XBT_DEBUG("Begin to saturate to %s:%u", to_name, to_port);
memset(&msg_got, 0, sizeof(msg_got));
request->msg_size = msg_size;
1, /* at least one sec */
&sec, &bw);
msg_size = request->msg_size = (int) bw;
- XBT_DEBUG("Saturate with packets of %d bytes", request->msg_size);
+ XBT_DEBUG("Saturate with packets of %u bytes", request->msg_size);
}
/* Launch the saturation */
free(request);
gras_socket_close(peer_cmd);
- XBT_INFO("Saturation(%s:%d->%s:%d) started", gras_os_myname(),
+ XBT_INFO("Saturation(%s:%d->%s:%u) started", gras_os_myname(),
gras_os_myport(), to_name, to_port);
/* Start experiment */
/* Check whether the experiment has to be terminated by now */
elapsed = gras_os_time() - start;
- XBT_DEBUG("elapsed %f duration %f (msg_size=%d)", elapsed, duration,
+ XBT_DEBUG("elapsed %f duration %f (msg_size=%u)", elapsed, duration,
msg_size);
} while (saturate_further && (duration == 0 || elapsed < duration));
bw_res_t answer = xbt_new(s_bw_res_t, 1);
s_gras_msg_cb_ctx_t ctx;
- XBT_INFO("Saturation from %s:%d to %s:%d stopped by %s:%d",
+ XBT_INFO("Saturation from %s:%d to %s:%u stopped by %s:%d",
gras_os_myname(), gras_os_myport(), to_name, to_port,
xbt_socket_peer_name(msg_got.expe),
xbt_socket_peer_port(msg_got.expe));
free(answer);
} else {
XBT_INFO
- ("Saturation from %s:%d to %s:%d elapsed after %f sec (achieving %f kb/s)",
+ ("Saturation from %s:%d to %s:%u elapsed after %f sec (achieving %f kb/s)",
gras_os_myname(), gras_os_myport(), to_name, to_port, elapsed,
bw / 1024.0);
}
{
xbt_socket_t sock = gras_socket_client(from_name, from_port);
bw_res_t answer;
- XBT_VERB("Ask %s:%d to stop the saturation", from_name, from_port);
+ XBT_VERB("Ask %s:%u to stop the saturation", from_name, from_port);
TRY {
gras_msg_rpccall(sock, 60, "amok_bw_sat stop", NULL, &answer);
}
CATCH_ANONYMOUS {
- RETHROWF("Cannot ask %s:%d to stop saturation: %s", from_name, from_port);
+ RETHROWF("Cannot ask %s:%u to stop saturation: %s", from_name, from_port);
}
gras_socket_close(sock);
if (time)
volatile unsigned int cpt2 = cpt;
if (!ran_ok) {
XBT_DEBUG
- ("Use the callback #%d (@%p) for incomming msg '%s' (payload_size=%d)",
+ ("Use the callback #%u (@%p) for incomming msg '%s' (payload_size=%d)",
cpt + 1, cb, msg.type->name, msg.payl_size);
if (!cb(&ctx, msg.payl)) {
/* cb handled the message */
ran_ok = 1;
} else {
RETHROWF
- ("Callback #%d (@%p) to message '%s' (payload size: %d) raised an exception: %s",
+ ("Callback #%u (@%p) to message '%s' (payload size: %d) raised an exception: %s",
cpt + 1, cb, msg.type->name, msg.payl_size);
}
}
default:
THROWF(unknown_error, 0,
- "Cannot handle messages of kind %d yet", msg.type->kind);
+ "Cannot handle messages of kind %d yet", (int)msg.type->kind);
}
}
}
}
if (!found)
- XBT_VERB("Ignoring removal of unexisting callback to msg id %d",
+ XBT_VERB("Ignoring removal of unexisting callback to msg id %u",
msgtype->code);
}
break;
default:
- THROWF(unknown_error, 0, "Unknown msg kind %d", kind);
+ THROWF(unknown_error, 0, "Unknown msg kind %d", (int)kind);
}
xbt_datadesc_send(sock, string_type, &msgtype->name);
xbt_dynar_foreach(_gras_rpc_cancelled, cursor, rpc_ctx) {
if (msg->ID == rpc_ctx->ID && msg->kind == e_gras_msg_kind_rpcanswer) {
XBT_VERB
- ("Got an answer to the already canceled (timeouted?) RPC %ld. Ignore it (leaking the payload!).",
+ ("Got an answer to the already canceled (timeouted?) RPC %lu. Ignore it (leaking the payload!).",
msg->ID);
xbt_dynar_cursor_rm(_gras_rpc_cancelled, &cursor);
return 1;
_gras_rpc_cancelled = xbt_dynar_new(sizeof(ctx), NULL);
xbt_dynar_push(_gras_rpc_cancelled, &ctx);
XBT_INFO
- ("canceled RPC %ld pushed onto the stack (%s from %s:%d) Reason: %s",
+ ("canceled RPC %lu pushed onto the stack (%s from %s:%d) Reason: %s",
ctx->ID, ctx->msgtype->name,
xbt_socket_peer_name(ctx->expeditor),
xbt_socket_peer_port(ctx->expeditor), e.msg);
memcpy(&e, received.payl, received.payl_size);
free(received.payl);
XBT_VERB("Raise a remote exception cat:%d coming from %s (%s)",
- e.category, e.host, e.msg);
+ (int)e.category, e.host, e.msg);
__xbt_running_ctx_fetch()->exception.msg = e.msg;
__xbt_running_ctx_fetch()->exception.category = e.category;
__xbt_running_ctx_fetch()->exception.value = e.value;
sock_data->rdv_client : sock_data->rdv_server);
xbt_dynar_push(comms, &(sock_data->comm_recv));
}
- XBT_VERB("Wait on %ld 'sockets'", xbt_dynar_length(comms));
+ XBT_VERB("Wait on %lu 'sockets'", xbt_dynar_length(comms));
/* Wait for the end of any of these communications */
got = simcall_comm_waitany(comms);
for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
_xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
if (sock == sock_iter) {
- XBT_DEBUG("remove sock cursor %d dize %lu\n", cursor,
+ XBT_DEBUG("remove sock cursor %u dize %lu\n", cursor,
xbt_dynar_length(sockets));
xbt_dynar_cursor_rm(sockets, &cursor);
if (sock->plugin->socket_close)
int status = 0;
status = read(sock->sd, data + got, (long int) size);
- XBT_DEBUG("read(%d, %p, %ld);", sock->sd, data + got, size);
+ XBT_DEBUG("read(%d, %p, %lu);", sock->sd, data + got, size);
if (status < 0) {
THROWF(system_error, 0, "read(%d,%p,%d) failed: %s",
if (sock->incoming && !sock->outgoing && sockdata->server_port >= 0) {
/* server mode socket. Unregister it from 'OS' tables */
xbt_dynar_foreach(hd->ports, cpt, pr) {
- XBT_DEBUG("Check pr %d of %lu", cpt, xbt_dynar_length(hd->ports));
+ XBT_DEBUG("Check pr %u of %lu", cpt, xbt_dynar_length(hd->ports));
if (pr->port == sockdata->server_port) {
xbt_dynar_cursor_rm(hd->ports, &cpt);
XBT_OUT();
xbt_dynar_foreach(_gras_procdata_fabrics, cursor, fab) {
if (cursor + 1 <= xbt_set_length(pd->libdata)) {
- XBT_DEBUG("Skip fabric %d: there is already %ld libdata",
+ XBT_DEBUG("Skip fabric %u: there is already %lu libdata",
cursor, xbt_set_length(pd->libdata));
continue; /* allow to recall this function to get recently added fabrics */
}
- XBT_DEBUG("Go ahead for cursor %d, there is %ld libdata",
+ XBT_DEBUG("Go ahead for cursor %u, there is %lu libdata",
cursor, xbt_set_length(pd->libdata));
- xbt_assert(fab.name, "Name of fabric #%d is NULL!", cursor);
+ xbt_assert(fab.name, "Name of fabric #%u is NULL!", cursor);
XBT_DEBUG("Create the procdata for %s", fab.name);
/* Check for our own errors */
unsigned int cpt;
s_gras_msg_t msg;
XBT_WARN
- ("process %d terminated, but %ld messages are still queued. Message list:",
+ ("process %d terminated, but %lu messages are still queued. Message list:",
gras_os_getpid(), xbt_dynar_length(msg_pd->msg_queue));
xbt_dynar_foreach(msg_pd->msg_queue, cpt, msg) {
XBT_WARN(" Message %s (%s) from %s@%s:%d", msg.type->name,
simdata->isused=0;
- XBT_DEBUG("Execution task '%s' finished in state %d", task->name, comp_state);
+ XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
if (comp_state == SIMIX_DONE) {
/* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
simdata->computation_amount = 0.0;
comp_state = simcall_host_execution_wait(simdata->compute);
p_simdata->waiting_action = NULL;
- XBT_DEBUG("Finished waiting for execution of action %p, state = %d", simdata->compute, comp_state);
+ XBT_DEBUG("Finished waiting for execution of action %p, state = %d", simdata->compute, (int)comp_state);
simdata->isused=0;
unsigned int cursor;
SD_task_t task;
xbt_dynar_foreach(result, cursor, task) {
- XBT_INFO("Task %d", cursor);
+ XBT_INFO("Task %u", cursor);
SD_task_dump(task);
}
}
}
}
XBT_INFO(" - amount: %.0f", SD_task_get_amount(task));
- XBT_INFO(" - Dependencies to satisfy: %d", task->unsatisfied_dependencies);
+ XBT_INFO(" - Dependencies to satisfy: %u", task->unsatisfied_dependencies);
if (!xbt_dynar_is_empty(task->tasks_before)) {
XBT_INFO(" - pre-dependencies:");
xbt_dynar_foreach(task->tasks_before, counter, dependency) {
xbt_assert(__SD_task_is_runnable_or_in_fifo(task),
"Task '%s' is not runnable or in a fifo! Task state: %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
xbt_assert(task->workstation_list != NULL,
"Task '%s': workstation_list is NULL!",
SD_task_get_name(task));
__SD_task_destroy_scheduling_data(task); /* now the scheduling data are not useful anymore */
__SD_task_set_state(task, SD_RUNNING);
xbt_assert(__SD_task_is_running(task), "Bad state of task '%s': %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
}
xbt_assert(__SD_task_is_runnable(task),
"Task '%s' is not runnable! Task state: %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
for (i = 0; i < task->workstation_nb; i++) {
}
__SD_task_set_state(task, SD_IN_FIFO);
xbt_assert(__SD_task_is_in_fifo(task), "Bad state of task '%s': %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
XBT_DEBUG("Task '%s' state is now SD_IN_FIFO", SD_task_get_name(task));
} else {
__SD_task_really_run(task);
xbt_assert(__SD_task_is_running(task),
"The task must be running! Task state: %d",
- SD_task_get_state(task));
+ (int)SD_task_get_state(task));
xbt_assert(task->workstation_list != NULL,
"Task '%s': workstation_list is NULL!",
SD_task_get_name(task));
for (i = 0; i < task->workstation_nb; i++) {
workstation = task->workstation_list[i];
XBT_DEBUG("Workstation '%s': access_mode = %d",
- SD_workstation_get_name(workstation), workstation->access_mode);
+ SD_workstation_get_name(workstation), (int)workstation->access_mode);
if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
xbt_assert(workstation->task_fifo != NULL,
"Workstation '%s' has sequential access but no fifo!",
xbt_assert(__SD_task_is_in_fifo(candidate),
"Bad state of candidate '%s': %d",
SD_task_get_name(candidate),
- SD_task_get_state(candidate));
+ (int)SD_task_get_state(candidate));
}
XBT_DEBUG("Candidate in fifo: %p", candidate);
xbt_assert(__SD_task_is_in_fifo(candidate),
"Bad state of candidate '%s': %d",
- SD_task_get_name(candidate), SD_task_get_state(candidate));
+ SD_task_get_name(candidate), (int)SD_task_get_state(candidate));
for (j = 0; j < candidate->workstation_nb && can_start; j++) {
workstation = candidate->workstation_list[j];
/* finally execute the task */
XBT_DEBUG("Task '%s' state: %d", SD_task_get_name(candidate),
- SD_task_get_state(candidate));
+ (int)SD_task_get_state(candidate));
__SD_task_really_run(candidate);
XBT_DEBUG
xbt_assert(__SD_task_is_running(candidate),
"Bad state of task '%s': %d",
SD_task_get_name(candidate),
- SD_task_get_state(candidate));
+ (int)SD_task_get_state(candidate));
XBT_DEBUG("Okay, the task is running.");
} /* can start */
action_description = "I/O";
break;
}
- XBT_INFO("Process %ld (%s@%s): waiting for %s action %p (%s) in state %d to finish",
+ XBT_INFO("Process %lu (%s@%s): waiting for %s action %p (%s) in state %d to finish",
process->pid, process->name, process->smx_host->name,
action_description, process->waiting_action,
- process->waiting_action->name, process->waiting_action->state);
+ process->waiting_action->name, (int)process->waiting_action->state);
}
else {
- XBT_INFO("Process %ld (%s@%s)", process->pid, process->name, process->smx_host->name);
+ XBT_INFO("Process %lu (%s@%s)", process->pid, process->name, process->smx_host->name);
}
}
}
{
smx_action_t action = simcall->host_execution_wait.execution;
- XBT_DEBUG("Wait for execution of action %p, state %d", action, action->state);
+ XBT_DEBUG("Wait for execution of action %p, state %d", action, (int)action->state);
/* Associate this simcall to the action */
xbt_fifo_push(action->simcalls, simcall);
default:
xbt_die("Internal error in SIMIX_execution_finish: unexpected action state %d",
- action->state);
+ (int)action->state);
}
simcall->issuer->waiting_action = NULL;
simcall->host_execution_wait.result = action->state;
default:
xbt_die("Internal error in SIMIX_io_finish: unexpected action state %d",
- action->state);
+ (int)action->state);
}
simcall->issuer->waiting_action = NULL;
SIMIX_simcall_answer(simcall);
}
XBT_DEBUG("Sorry, communication action %p does not match our needs:"
" its type is %d but we are looking for a comm of type %d",
- action, action->comm.type, type);
+ action, (int)action->comm.type, (int)type);
}
XBT_DEBUG("No matching communication action found");
return NULL;
void SIMIX_comm_destroy(smx_action_t action)
{
XBT_DEBUG("Destroy action %p (refcount: %d), state: %d",
- action, action->comm.refcount, action->state);
+ action, action->comm.refcount, (int)action->state);
if (action->comm.refcount <= 0) {
xbt_backtrace_display_current();
if (action->comm.rdv)
SIMIX_rdv_remove(action->comm.rdv, action);
- XBT_DEBUG("SIMIX_comm_finish: action state = %d", action->state);
+ XBT_DEBUG("SIMIX_comm_finish: action state = %d", (int)action->state);
/* Check out for errors */
switch (action->state) {
break;
default:
- xbt_die("Unexpected action state in SIMIX_comm_finish: %d", action->state);
+ xbt_die("Unexpected action state in SIMIX_comm_finish: %d", (int)action->state);
}
/* if there is an exception during a waitany or a testany, indicate the position of the failed communication */
action->state = SIMIX_DONE;
XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d",
- action, action->state, action->comm.src_proc, action->comm.dst_proc, action->comm.detached);
+ action, (int)action->state, action->comm.src_proc, action->comm.dst_proc, action->comm.detached);
/* destroy the surf actions associated with the Simix communication */
SIMIX_comm_destroy_internal_actions(action);
if (action->comm.src_proc == process) {
XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p",
- action, action->comm.detached, action->state, action->comm.src_proc, action->comm.dst_proc);
+ action, action->comm.detached, (int)action->state, action->comm.src_proc, action->comm.dst_proc);
action->comm.src_proc = NULL;
if (action->comm.detached) {
}
else if (action->comm.dst_proc == process){
XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
- action, action->state, action->comm.src_proc, action->comm.dst_proc);
+ action, (int)action->state, action->comm.src_proc, action->comm.dst_proc);
action->comm.dst_proc = NULL;
if (action->comm.detached && action->comm.refcount == 1
default:
xbt_die("Internal error in SIMIX_process_suspend: unexpected action type %d",
- process->waiting_action->type);
+ (int)process->waiting_action->type);
}
}
}
default:
xbt_die("Internal error in SIMIX_process_resume: unexpected action type %d",
- process->waiting_action->type);
+ (int)process->waiting_action->type);
}
}
else {
{
if (self != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), self->simcall.call);
+ SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
SIMIX_process_yield(self);
} else {
SIMIX_simcall_pre(&self->simcall, 0);
void SIMIX_simcall_answer(smx_simcall_t simcall)
{
if (simcall->issuer != simix_global->maestro_process){
- XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), simcall->call,
+ XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call,
simcall->issuer->name, simcall->issuer);
simcall->issuer->simcall.call = SIMCALL_NONE;
xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer);
/** @brief Initialize a semaphore */
smx_sem_t SIMIX_sem_init(unsigned int value)
{
- XBT_IN("(%d)",value);
+ XBT_IN("(%u)",value);
s_smx_process_t p;
smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
*cfg = xbt_cfg_new();
xbt_assert(type >= xbt_cfgelm_int && type <= xbt_cfgelm_peer,
"type of %s not valid (%d should be between %d and %d)",
- name, type, xbt_cfgelm_int, xbt_cfgelm_peer);
+ name, (int)type, xbt_cfgelm_int, xbt_cfgelm_peer);
res = xbt_dict_get_or_null((xbt_dict_t) * cfg, name);
if (res) {
res = xbt_new(s_xbt_cfgelm_t, 1);
XBT_DEBUG("Register cfg elm %s (%s) (%d to %d %s (=%d) @%p in set %p)",
- name, desc, min, max, xbt_cfgelm_type_name[type], type, res,
+ name, desc, min, max, xbt_cfgelm_type_name[type], (int)type, res,
*cfg);
res->desc = xbt_strdup(desc);
break;
default:
- XBT_ERROR("%d is an invalide type code", type);
+ XBT_ERROR("%d is an invalide type code", (int)type);
}
xbt_dict_set((xbt_dict_t) * cfg, name, res, NULL);
"Can't get the type of '%s' since this variable does not exist",
name);
- XBT_INFO("type in variable = %d", variable->type);
+ XBT_INFO("type in variable = %d", (int)variable->type);
return variable->type;
}
break;
default:
- xbt_die("Config element variable %s not valid (type=%d)", name, type);
+ xbt_die("Config element variable %s not valid (type=%d)", name, (int)type);
}
}
variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
XBT_DEBUG("Variable: %d to %d %s (=%d) @%p",
variable->min, variable->max,
- xbt_cfgelm_type_name[variable->type], variable->type, variable);
+ xbt_cfgelm_type_name[variable->type], (int)variable->type, variable);
if (variable->max == 1) {
if (!xbt_dynar_is_empty(variable->content)) {
unsigned int old = *(unsigned int *) data;
unsigned int new = xbt_cbps_i_pop(vars);
- XBT_DEBUG("push %d x %d as a size", old, new);
+ XBT_DEBUG("push %u x %u as a size", old, new);
xbt_cbps_i_push(vars, (int) (old * new));
}
unsigned long int old = *(unsigned long int *) data;
unsigned long int new = xbt_cbps_i_pop(vars);
- XBT_DEBUG("push %ld x %ld as a size", old, new);
+ XBT_DEBUG("push %lu x %lu as a size", old, new);
xbt_cbps_i_push(vars, (int) (old * new));
}
printf(" alignment[");
for (cpt = 0; cpt < xbt_arch_count; cpt++) {
- printf("%s%s%ld%s",
+ printf("%s%s%lu%s",
cpt > 0 ? ", " : "",
cpt == GRAS_THISARCH ? ">" : "",
ddt->alignment[cpt], cpt == GRAS_THISARCH ? "<" : "");
printf(" aligned_size[");
for (cpt = 0; cpt < xbt_arch_count; cpt++) {
- printf("%s%s%ld%s",
+ printf("%s%s%lu%s",
cpt > 0 ? ", " : "",
cpt == GRAS_THISARCH ? ">" : "",
ddt->aligned_size[cpt], cpt == GRAS_THISARCH ? "<" : "");
struct_data = ddt->category.struct_data;
xbt_dynar_foreach(struct_data.fields, cpt, field) {
- printf(">>> Dump field #%d (%s) (offset=%ld)\n",
+ printf(">>> Dump field #%u (%s) (offset=%ld)\n",
cpt, field->name, field->offset[GRAS_THISARCH]);
xbt_datadesc_type_dump(field->type);
- printf("<<< end dump field #%d (%s)\n", cpt, field->name);
+ printf("<<< end dump field #%u (%s)\n", cpt, field->name);
}
}
fflush(stdout);
field->name = (char *) strdup(name);
XBT_DEBUG("----------------");
- XBT_DEBUG("PRE s={size=%ld,align=%ld,asize=%ld}",
+ XBT_DEBUG("PRE s={size=%ld,align=%lu,asize=%lu}",
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
struct_type->aligned_size[GRAS_THISARCH]);
XBT_DEBUG("Push a %s into %s at offset %ld.",
field_type->name, struct_type->name,
field->offset[GRAS_THISARCH]);
- XBT_DEBUG(" f={size=%ld,align=%ld,asize=%ld}",
+ XBT_DEBUG(" f={size=%ld,align=%lu,asize=%lu}",
field_type->size[GRAS_THISARCH],
field_type->alignment[GRAS_THISARCH],
field_type->aligned_size[GRAS_THISARCH]);
- XBT_DEBUG(" s={size=%ld,align=%ld,asize=%ld}",
+ XBT_DEBUG(" s={size=%ld,align=%lu,asize=%lu}",
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
struct_type->aligned_size[GRAS_THISARCH]);
for (arch = 0; arch < xbt_arch_count; arch++) {
struct_type->size[arch] = struct_type->aligned_size[arch];
}
- XBT_DEBUG("structure %s closed. size=%ld,align=%ld,asize=%ld",
+ XBT_DEBUG("structure %s closed. size=%ld,align=%lu,asize=%lu",
struct_type->name,
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
}
if (d1->alignment[cpt] != d2->alignment[cpt]) {
- XBT_DEBUG("ddt_cmp: %s->alignment=%ld != %s->alignment=%ld (on %s)",
+ XBT_DEBUG("ddt_cmp: %s->alignment=%lu != %s->alignment=%lu (on %s)",
d1->name, d1->alignment[cpt], d2->name, d2->alignment[cpt],
xbt_arches[cpt].name);
return d1->alignment[cpt] > d2->alignment[cpt] ? 1 : -1;
if (d1->aligned_size[cpt] != d2->aligned_size[cpt]) {
XBT_DEBUG
- ("ddt_cmp: %s->aligned_size=%ld != %s->aligned_size=%ld (on %s)",
+ ("ddt_cmp: %s->aligned_size=%lu != %s->aligned_size=%lu (on %s)",
d1->name, d1->aligned_size[cpt], d2->name,
d2->aligned_size[cpt], xbt_arches[cpt].name);
return d1->aligned_size[cpt] > d2->aligned_size[cpt] ? 1 : -1;
field_desc_2 = field2->type;
ret = xbt_datadesc_type_cmp(field_desc_1, field_desc_2);
if (ret) {
- XBT_DEBUG("%s->field[%d]=%s != %s->field[%d]=%s",
+ XBT_DEBUG("%s->field[%u]=%s != %s->field[%u]=%s",
d1->name, cpt, field1->name, d2->name, cpt, field2->name);
return ret;
}
xbt_assert(int_type);
}
- XBT_DEBUG("send_int(%u)", *i);
+ XBT_DEBUG("send_int(%d)", *i);
xbt_trp_send(sock, (char *) i, int_type->size[GRAS_THISARCH], stable);
}
xbt_dd_convert_elm(int_type, 1, r_arch, ptr, i);
free(ptr);
}
- XBT_DEBUG("recv_int(%u)", *i);
+ XBT_DEBUG("recv_int(%d)", *i);
}
/*
if (XBT_LOG_ISENABLED(xbt_ddt_exchange, xbt_log_priority_verbose)) {
if (sub_type == xbt_datadesc_by_name("unsigned int")) {
- XBT_VERB("Copied value for field '%s': %d (type: unsigned int)",
+ XBT_VERB("Copied value for field '%s': %u (type: unsigned int)",
field->name, *(unsigned int *) field_dst);
} else if (sub_type == xbt_datadesc_by_name("int")) {
XBT_VERB("Copied value for field '%s': %d (type: int)",
} else if (sub_type ==
xbt_datadesc_by_name("unsigned long int")) {
XBT_VERB
- ("Copied value for field '%s': %ld (type: unsigned long int)",
+ ("Copied value for field '%s': %lu (type: unsigned long int)",
field->name, *(unsigned long int *) field_dst);
} else if (sub_type == xbt_datadesc_by_name("long int")) {
XBT_VERB("Copied value for field '%s': %ld (type: long int)",
type->name);
xbt_assert(field_num < xbt_dynar_length(union_data.fields),
- "union field selector of %s returned %d but there is only %lu fields",
+ "union field selector of %s returned %u but there is only %lu fields",
type->name, field_num,
xbt_dynar_length(union_data.fields));
sub_type = array_data.type;
elm_size = sub_type->aligned_size[GRAS_THISARCH];
if (sub_type->category_code == e_xbt_datadesc_type_cat_scalar) {
- XBT_VERB("Array of %ld scalars, copy it in one shot", array_count);
+ XBT_VERB("Array of %lu scalars, copy it in one shot", array_count);
memcpy(dst, src,
sub_type->aligned_size[GRAS_THISARCH] * array_count);
count += sub_type->aligned_size[GRAS_THISARCH] * array_count;
&& sub_type->category.array_data.type->category_code ==
e_xbt_datadesc_type_cat_scalar) {
- XBT_VERB("Array of %ld fixed array of scalars, copy it in one shot",
+ XBT_VERB("Array of %lu fixed array of scalars, copy it in one shot",
array_count);
memcpy(dst, src,
sub_type->category.array_data.
* array_count * sub_type->category.array_data.fixed_size;
} else {
- XBT_VERB("Array of %ld stuff, copy it in one after the other",
+ XBT_VERB("Array of %lu stuff, copy it in one after the other",
array_count);
for (cpt = 0; cpt < array_count; cpt++) {
- XBT_VERB("Copy the %dth stuff out of %ld", cpt, array_count);
+ XBT_VERB("Copy the %uth stuff out of %lu", cpt, array_count);
count +=
xbt_datadesc_memcpy_rec(state, refs, sub_type, src_ptr,
dst_ptr, 0, detect_cycle
if (field.tm.is_ref)
PARSE_ERROR
("Not enough XBT_ANNOTATE to deal with all dereferencing levels of %s (%d '*' left)",
- field.name, field.tm.is_ref);
+ field.name, (int)field.tm.is_ref);
XBT_VERB("Append field '%s' to %p", field.name, (void *) struct_type);
xbt_datadesc_struct_append(struct_type, field.name, field.type);
xbt_dictelm_t current, previous = NULL;
xbt_assert(dict);
- XBT_DEBUG("ADD %.*s hash = %d, size = %d, & = %d", key_len, key, hash_code,
+ XBT_DEBUG("ADD %.*s hash = %u, size = %d, & = %u", key_len, key, hash_code,
dict->table_size, hash_code & dict->table_size);
current = dict->table[hash_code & dict->table_size];
while (current != NULL &&
continue;
if (size == 0)
continue;
- printf("%delm x %u cells; ", count, size);
+ printf("%uelm x %u cells; ", count, size);
}
}
printf("\n");
continue;
if (size == 0)
continue;
- printf("%delm x %d cells; ", count, size);
+ printf("%uelm x %d cells; ", count, size);
avg += count * size;
total_count += size;
}
}
if((d1->elmsize)!=(d2->elmsize))
{
- XBT_DEBUG("Size of elmsize d1=%ld d2=%ld",d1->elmsize,d2->elmsize);
+ XBT_DEBUG("Size of elmsize d1=%lu d2=%lu",d1->elmsize,d2->elmsize);
xbt_dynar_free(&d2);
return 1; // xbt_die
}
if(xbt_dynar_length(d1) != xbt_dynar_length(d2))
{
- XBT_DEBUG("Size of dynar d1=%ld d2=%ld",xbt_dynar_length(d1),xbt_dynar_length(d2));
+ XBT_DEBUG("Size of dynar d1=%lu d2=%lu",xbt_dynar_length(d1),xbt_dynar_length(d2));
xbt_dynar_free(&d2);
return 1;
}
for (cursor = 0; cursor < NB_ELEM; cursor++) {
iptr = xbt_dynar_get_ptr(d, cursor);
xbt_test_assert(cursor == *iptr,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* 3. Traverse the dynar using the neat macro to that extend */
xbt_dynar_foreach(d, cursor, cpt) {
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* end_of_traversal */
/* 3. Traverse the dynar */
xbt_dynar_foreach(d, cursor, cpt) {
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* end_of_traversal */
xbt_dynar_set_as(d, cpt, int, cpt);
xbt_dynar_foreach(d, cursor, cpt)
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
for (cpt = 0; cpt < NB_ELEM; cpt++) {
int val;
xbt_dynar_remove_at(d,0,&val);
xbt_test_assert(cpt == val,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
xbt_test_assert(xbt_dynar_is_empty(d),
/* 3. Traverse the dynar */
xbt_dynar_foreach(d, cursor, cpt) {
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* end_of_traversal */
int val;
xbt_dynar_remove_at(d,xbt_dynar_length(d)-1,&val);
xbt_test_assert(cpt == val,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
xbt_test_assert(xbt_dynar_is_empty(d),
}
/* 2. Traverse the dynar with the macro */
xbt_dynar_foreach(d, iter, s1) {
- sprintf(buf, "%d", NB_ELEM - iter - 1);
+ sprintf(buf, "%u", NB_ELEM - iter - 1);
xbt_test_assert(!strcmp(buf, s1),
"The retrieved value is not the same than the injected one (%s!=%s)",
buf, s1);
xbt_dynar_t edges = xbt_graph_get_edges (span);
unsigned int cpt;
xbt_node_t node;
- fprintf (file, "%ld\n", xbt_dynar_length (nodes));
+ fprintf (file, "%lu\n", xbt_dynar_length (nodes));
xbt_dynar_foreach (nodes, cpt, node) {
if (nname){
fprintf (file, "%s\n", nname(node));
fprintf (file, "%p\n", node);
}
}
- fprintf (file, "%ld\n", xbt_dynar_length (edges));
+ fprintf (file, "%lu\n", xbt_dynar_length (edges));
xbt_edge_t edge;
xbt_dynar_foreach (edges, cpt, edge) {
xbt_node_t source = xbt_graph_edge_get_source (edge);
elm->ID = _xbt_set_get_id(set);
xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
xbt_dynar_set(set->dynar, elm->ID, &elm);
- XBT_DEBUG("Insertion of key '%s' (id %d)", elm->name, elm->ID);
+ XBT_DEBUG("Insertion of key '%s' (id %u)", elm->name, elm->ID);
xbt_ex_free(e);
}
if (found) {
if (elm == found_in_dict) {
XBT_DEBUG
- ("Ignoring request to insert the same element twice (key %s ; id %d)",
+ ("Ignoring request to insert the same element twice (key %s ; id %u)",
elm->name, elm->ID);
return;
} else {
elm->ID = found_in_dict->ID;
- XBT_DEBUG("Reinsertion of key %s (id %d)", elm->name, elm->ID);
+ XBT_DEBUG("Reinsertion of key %s (id %u)", elm->name, elm->ID);
xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm,
free_func);
xbt_dynar_set(set->dynar, elm->ID, &elm);
xbt_test_add("Search by name %s", key);
elm = (my_elem_t) xbt_set_get_by_name(head, key);
- xbt_test_log(" Found %s (under ID %d)\n",
+ xbt_test_log(" Found %s (under ID %u)\n",
elm ? elm->data : "(null)", elm ? elm->ID : -1);
if (strcmp(key, elm->name))
THROWF(mismatch_error, 0, "The key (%s) is not the one expected (%s)",
elm ? elm->name : "(null)", elm ? elm->data : "(null)");
if (id != elm->ID)
THROWF(mismatch_error, 0,
- "The found ID (%d) is not the one expected (%d)", elm->ID, id);
+ "The found ID (%u) is not the one expected (%d)", elm->ID, id);
if (strcmp(key, elm->name))
THROWF(mismatch_error, 0, "The key (%s) is not the one expected (%s)",
elm->name, key);
xbt_set_foreach(set, cursor, elm) {
xbt_test_assert(elm, "Dude ! Got a null elm during traversal!");
- xbt_test_log("Id(%d): %s->%s\n", elm->ID, elm->name, elm->data);
+ xbt_test_log("Id(%u): %s->%s\n", elm->ID, elm->name, elm->data);
xbt_test_assert(!strcmp(elm->name, elm->data),
"Key(%s) != value(%s). Abording", elm->name,
elm->data);
debuged_add(set, "12anew", "12anew");
elm = (my_elem_t) xbt_set_get_by_id(set, 1);
- xbt_test_assert(elm->ID == 1, "elm->ID is %d but should be 1", elm->ID);
+ xbt_test_assert(elm->ID == 1, "elm->ID is %u but should be 1", elm->ID);
xbt_set_free(&set);
}
{
unsigned int i, j;
- fprintf(stderr, ">>> Matrix %s dump (%d x %d)\n", name, matrix->lines,
+ fprintf(stderr, ">>> Matrix %s dump (%u x %u)\n", name, matrix->lines,
matrix->rows);
for (i = 0; i < matrix->lines; i++) {
fprintf(stderr, " ");
for (j = 0; j < matrix->rows; j++) {
if (coords)
- fprintf(stderr, " (%d,%d)=", i, j);
+ fprintf(stderr, " (%u,%u)=", i, j);
else
fprintf(stderr, " ");
display_fun(xbt_matrix_get_ptr(matrix, i, j));
unsigned int i, j;
XBT_DEBUG
- ("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)",
+ ("Copy a %ux%u submatrix from %ux%u(of %ux%u) to %ux%u (of %ux%u)",
lsize, rsize, lpos_src, rpos_src, src->lines, src->rows, lpos_dst,
rpos_dst, dst->lines, dst->rows);
unsigned int i, j, k;
xbt_assert(A->lines == C->lines,
- "A->lines != C->lines (%d vs %d)", A->lines, C->lines);
+ "A->lines != C->lines (%u vs %u)", A->lines, C->lines);
xbt_assert(B->rows == C->rows);
for (i = 0; i < C->lines; i++)
for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
XBT_CDEBUG(xbt_trp_meas,
- "Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
+ "Sent %lu msgs of %lu (size of each: %lu) to %s:%d",
sent_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
peer->plugin->raw_send(peer, chunk, msg_size);
}
XBT_CDEBUG(xbt_trp_meas,
- "Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
+ "Sent %lu msgs of %lu (size of each: %lu) to %s:%d", sent_sofar,
msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
XBT_CDEBUG(xbt_trp_meas,
- "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
+ "Recvd %lu msgs of %lu (size of each: %lu) from %s:%d",
got_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
(peer->plugin->raw_recv) (peer, chunk, msg_size);
}
XBT_CDEBUG(xbt_trp_meas,
- "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
+ "Recvd %lu msgs of %lu (size of each: %lu) from %s:%d",
got_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
return;
}
/* Start all workers */
- XBT_DEBUG("Dopar for %ld elements", xbt_dynar_length(datas));
+ XBT_DEBUG("Dopar for %lu elements", xbt_dynar_length(datas));
xbt_dynar_foreach(datas, cursor, data) {
worker_data_t w = xbt_new0(s_worker_data_t, 1);
w->data = datas;
int status = 0;
status = tcp_write(sock->sd, data, (size_t) size);
- XBT_DEBUG("write(%d, %p, %ld);", sock->sd, data, size);
+ XBT_DEBUG("write(%d, %p, %lu);", sock->sd, data, size);
if (status < 0) {
#ifdef EWOULDBLOCK
#endif
continue;
- THROWF(system_error, 0, "write(%d,%p,%ld) failed: %s",
+ THROWF(system_error, 0, "write(%d,%p,%lu) failed: %s",
sock->sd, data, size, sock_errstr(sock_errno));
}
while (size > got) {
int status = 0;
- XBT_DEBUG("read(%d, %p, %ld) got %d so far (%s)",
+ XBT_DEBUG("read(%d, %p, %lu) got %d so far (%s)",
sock->sd, data + got, bufsize, got,
hexa_str((unsigned char *) data, got, 0));
status = tcp_read(sock->sd, data + got, (size_t) bufsize);
if (status < 0) {
THROWF(system_error, 0,
- "read(%d,%p,%d) from %s:%d failed: %s; got %d so far",
- sock->sd, data + got, (int) size, xbt_socket_peer_name(sock),
+ "read(%d,%p,%lu) from %s:%d failed: %s; got %d so far",
+ sock->sd, data + got, size, xbt_socket_peer_name(sock),
xbt_socket_peer_port(sock), sock_errstr(sock_errno), got);
}
XBT_DEBUG("Got %d more bytes (%s)", status,
/* size of the chunk to receive in that shot */
long int thissize =
min(size - chunk_pos, data->buffsize - data->out_buf.size);
- XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%ld, ctn=(%s)",
- (int) data->out_buf.size,
- ((int) data->out_buf.size) + thissize - 1, size,
+ XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%lu, ctn=(%s)",
+ data->out_buf.size,
+ data->out_buf.size + thissize - 1, size,
hexa_str((unsigned char *) chunk, thissize, 0));
memcpy(data->out_buf.data + data->out_buf.size, chunk + chunk_pos,
data->out_buf.size += thissize;
chunk_pos += thissize;
- XBT_DEBUG("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)",
+ XBT_DEBUG("New pos = %d; Still to send = %lu of %lu; ctn sofar=(%s)",
data->out_buf.size, size - chunk_pos, size,
hexa_str((unsigned char *) chunk, chunk_pos, 0));
data->in_buf.pos += thissize;
chunk_pos += thissize;
- XBT_DEBUG("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
+ XBT_DEBUG("New pos = %d; Still to receive = %lu of %lu. Ctn so far=(%s)",
data->in_buf.pos, size - chunk_pos, size,
hexa_str((unsigned char *) chunk, chunk_pos, 0));
}
if (direction == READ || direction == COPY) {
xbt_assert(i->c1 == j->c1);
xbt_assert(i->c2 == j->c2);
- xbt_assert(i->l1 == j->l1, "i->l1(=%ld) != j->l1(=%ld)", i->l1,
+ xbt_assert(i->l1 == j->l1, "i->l1(=%lu) != j->l1(=%lu)", i->l1,
j->l1);
xbt_assert(i->l2 == j->l2);
free(j);
xbt_assert(p->c1 == q->c1);
xbt_assert(p->c2 == q->c2);
xbt_assert(p->l1 == p->l1,
- "for cpt=%d i->l1(=%ld) != j->l1(=%ld)", cpt, p->l1,
+ "for cpt=%d i->l1(=%lu) != j->l1(=%lu)", cpt, p->l1,
q->l1);
xbt_assert(q->l2 == p->l2);
}
snprintf(name, sizeof name, "DEFAULT");
break;
default:
- snprintf(name, sizeof name, "UNKNOWN(%d)", mode);
+ snprintf(name, sizeof name, "UNKNOWN(%d)", (int)mode);
break;
}
return name;
XBT_INFO("<%s> No output before timeout", rctx->filepos);
XBT_ERROR("Test suite `%s': NOK (<%s> timeout after %d sec)",
testsuite_name, rctx->filepos, timeout_value);
- XBT_DEBUG("<%s> Interrupted = %d", rctx->filepos, rctx->interrupted);
+ XBT_DEBUG("<%s> Interrupted = %d", rctx->filepos, (int)rctx->interrupted);
if (!rctx->interrupted) {
xbt_os_mutex_release(rctx->interruption);
rctx_armageddon(rctx, 3);
if (signals[i].number == got)
return (signals[i].name);
- return bprintf("SIG UNKNOWN (%d)", got);
+ return bprintf("SIG UNKNOWN (%u)", got);
}