/* argv[2] is the number of pieces */
if (argc > 2) {
piece_count = xbt_str_parse_int(argv[2], "Invalid number of pieces: %s");
- XBT_DEBUG("piece_count set to %d", piece_count);
+ XBT_DEBUG("piece_count set to %u", piece_count);
} else {
- XBT_DEBUG("No piece_count specified, defaulting to %d", piece_count);
+ XBT_DEBUG("No piece_count specified, defaulting to %u", piece_count);
}
broadcaster_t bc = broadcaster_init(host_list, piece_count);
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
int done = 0;
message_t msg = MSG_task_get_data(task);
- XBT_DEBUG("Peer %s got message of type %d\n", peer->me, msg->type);
+ XBT_DEBUG("Peer %s got message of type %u\n", peer->me, msg->type);
if (msg->type == MESSAGE_BUILD_CHAIN)
peer_init_chain(peer, msg);
else if (msg->type == MESSAGE_SEND_DATA) {
- xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %d before initialization", msg->type);
+ xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %u before initialization", msg->type);
if (peer->next != NULL)
peer_forward_msg(peer, msg);
peer->pieces++;
if (idx != -1) {
comm = xbt_dynar_get_as(peer->pending_recvs, idx, msg_comm_t);
status = MSG_comm_get_status(comm);
- XBT_DEBUG("peer_wait_for_message: error code = %d", status);
+ XBT_DEBUG("peer_wait_for_message: error code = %u", status);
xbt_assert(status == MSG_OK, "peer_wait_for_message() failed");
task = MSG_comm_get_task(comm);
XBT_INFO("# Add one more process on each VM");
xbt_dynar_foreach(vms, i, vm) {
unsigned int index = i + xbt_dynar_length(vms);
- char *vm_name = bprintf("VM%02d", i);
- char *pr_name = bprintf("WRK%02d", index);
+ char *vm_name = bprintf("VM%02u", i);
+ char *pr_name = bprintf("WRK%02u", index);
XBT_INFO("put a process (%s) on %s", pr_name, vm_name);
MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm);
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
{
unsigned int cpt;
node_contact_t contact;
- XBT_INFO("Searching %08x, size %d", answer->destination_id, answer->size);
+ XBT_INFO("Searching %08x, size %u", answer->destination_id, answer->size);
xbt_dynar_foreach(answer->nodes, cpt, contact) {
- XBT_INFO("Node %08x: %08x is at distance %d", cpt, contact->id, contact->distance);
+ XBT_INFO("Node %08x: %08x is at distance %u", cpt, contact->id, contact->distance);
}
}
-/* Copyright (c) 2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2012, 2014-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
XBT_INFO("I couldn't join the network :(");
}
XBT_DEBUG("I'm leaving the network");
- XBT_INFO("%d/%d FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
+ XBT_INFO("%u/%u FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
node_free(node);
return 0;
answers++;
nodes_added = answer_merge(node_list, data->answer);
- XBT_DEBUG("Received an answer from %s (%s) with %ld nodes on it",
- data->answer_to, data->issuer_host_name, xbt_dynar_length(data->answer->nodes));
+ XBT_DEBUG("Received an answer from %s (%s) with %lu nodes on it", data->answer_to, data->issuer_host_name,
+ xbt_dynar_length(data->answer->nodes));
task_free(node->task_received);
} else {
if (count_in_stats)
node->find_node_success++;
if (queries > 4)
- XBT_VERB("FIND_NODE on %08x success in %d steps", id_to_find, steps);
+ XBT_VERB("FIND_NODE on %08x success in %u steps", id_to_find, steps);
node_routing_table_update(node, id_to_find);
} else {
if (count_in_stats) {
node->find_node_failed++;
- XBT_VERB("%08x not found in %d steps", id_to_find, steps);
+ XBT_VERB("%08x not found in %u steps", id_to_find, steps);
}
}
answer_free(node_list);
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
node->id = node_id;
node->table = routing_table_init(node_id);
- snprintf(node->mailbox,MAILBOX_NAME_SIZE-1, "%d", node_id);
+ snprintf(node->mailbox, MAILBOX_NAME_SIZE - 1, "%u", node_id);
node->find_node_failed = 0;
node->find_node_success = 0;
/** @brief Gets the mailbox name of a host given its identifier */
void get_node_mailbox(unsigned int id, char *mailbox)
{
- snprintf(mailbox,MAILBOX_NAME_SIZE-1, "%d", id);
+ snprintf(mailbox, MAILBOX_NAME_SIZE - 1, "%u", id);
}
/** Constructor, build a new contact information. */
for (unsigned int i = 0; i <= identifier_size; i++) {
if (!xbt_dynar_is_empty(table->buckets[i].nodes)) {
- XBT_INFO("Bucket number %d: ", i);
+ XBT_INFO("Bucket number %u: ", i);
xbt_dynar_foreach(table->buckets[i].nodes, j, value) {
- XBT_INFO("Element %d: %08x", j, value);
+ XBT_INFO("Element %u: %08x", j, value);
}
}
}
-/* Copyright (c) 2013-2015. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
static int max_simulation_time = 1000;
typedef struct s_node {
- int id; //128bits generated random(2^128 -1)
- int known_id;
+ unsigned id; //128bits generated random(2^128 -1)
+ unsigned known_id;
char mailbox[MAILBOX_NAME_SIZE]; // my mailbox name (string representation of the id)
- int namespace_set[NAMESPACE_SIZE];
- int neighborhood_set[NEIGHBORHOOD_SIZE];
- int routing_table[LEVELS_COUNT][LEVEL_SIZE];
+ unsigned namespace_set[NAMESPACE_SIZE];
+ unsigned neighborhood_set[NEIGHBORHOOD_SIZE];
+ unsigned routing_table[LEVELS_COUNT][LEVEL_SIZE];
int ready;
msg_comm_t comm_receive; // current communication to receive
xbt_dynar_t pending_tasks;
typedef s_node_t* node_t;
typedef struct s_state {
- int id;
- int namespace_set[NAMESPACE_SIZE];
- int neighborhood_set[NEIGHBORHOOD_SIZE];
- int routing_table[LEVELS_COUNT][LEVEL_SIZE];
+ unsigned id;
+ unsigned namespace_set[NAMESPACE_SIZE];
+ unsigned neighborhood_set[NEIGHBORHOOD_SIZE];
+ unsigned routing_table[LEVELS_COUNT][LEVEL_SIZE];
} s_state_t;
typedef s_state_t* state_t;
typedef struct s_task_data {
e_task_type_t type; // type of task
- int sender_id; // id parameter (used by some types of tasks)
+ unsigned sender_id; // id parameter (used by some types of tasks)
//int request_finger; // finger parameter (used by some types of tasks)
- int answer_id; // answer (used by some types of tasks)
+ unsigned answer_id; // answer (used by some types of tasks)
char answer_to[MAILBOX_NAME_SIZE]; // mailbox to send an answer to (if any)
//const char* issuer_host_name; // used for logging
int steps;
}
static void print_node_id(node_t node) {
- XBT_INFO(" Id: %i '%08x' ", node->id, node->id);
+ XBT_INFO(" Id: %u '%08x' ", node->id, node->id);
}
static void print_node_neighborood_set(node_t node) {
int j;
int min;
int max;
- int next;
+ unsigned next;
msg_task_t task_sent;
task_data_t req_data;
task_data_t task_data = (task_data_t) MSG_task_get_data(task);
e_task_type_t type = task_data->type;
// If the node is not ready keep the task for later
if (node->ready != 0 && !(type==TASK_JOIN_LAST_REPLY || type==TASK_JOIN_REPLY)) {
- XBT_DEBUG("Task pending %i", type);
+ XBT_DEBUG("Task pending %u", type);
xbt_dynar_push(node->pending_tasks, &task);
return;
}
task_data->steps++;
task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, task_data);
if (MSG_task_send_with_timeout(task_sent, mailbox, timeout)== MSG_TIMEOUT) {
- XBT_DEBUG("Timeout expired when forwarding join to next %d", next);
+ XBT_DEBUG("Timeout expired when forwarding join to next %u", next);
task_free(task_sent);
}
type = TASK_JOIN_REPLY;
req_data->state = node_get_state(node);
task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
if (MSG_task_send_with_timeout(task_sent, task_data->answer_to, timeout)== MSG_TIMEOUT) {
- XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %d", node->id);
+ XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %u", node->id);
task_free(task_sent);
}
break;
node->ready--;
// if the node is ready, do all the pending tasks and send update to known nodes
if (node->ready==0) {
- XBT_DEBUG("Node %i is ready!!!", node->id);
+ XBT_DEBUG("Node %u is ready!!!", node->id);
while(xbt_dynar_length(node->pending_tasks)){
msg_task_t task;
xbt_dynar_shift(node->pending_tasks, &task);
break;
/* Received an update of state */
case TASK_UPDATE:
- XBT_DEBUG("Task update %i !!!", node->id);
+ XBT_DEBUG("Task update %u !!!", node->id);
/* Update namespace ses */
- XBT_INFO("Task update from %i !!!", task_data->sender_id);
+ XBT_INFO("Task update from %u !!!", task_data->sender_id);
XBT_INFO("Node:");
print_node_id(node);
print_node_namespace_set(node);
msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
XBT_DEBUG("Trying to join Pastry ring... (with node %s)", mailbox);
if (MSG_task_send_with_timeout(task_sent, mailbox, timeout)== MSG_TIMEOUT) {
- XBT_DEBUG("Timeout expired when joining ring with node %d", node->known_id);
+ XBT_DEBUG("Timeout expired when joining ring with node %u", node->known_id);
task_free(task_sent);
}
-/* Copyright (c) 2010-2015. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
/* 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. */
long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
MSG_task_destroy(task1);
task1 = NULL;
- XBT_INFO("Received %lu", val1);
+ XBT_INFO("Received %ld", val1);
MSG_task_receive(&task2, "mymailbox");
long val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s");
MSG_task_destroy(task2);
task2 = NULL;
- XBT_INFO("Received %lu", val2);
+ XBT_INFO("Received %ld", val2);
MC_assert(MIN(val1, val2) == 1);
MSG_task_receive(&task1, "mymailbox");
val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
MSG_task_destroy(task1);
- XBT_INFO("Received %lu", val1);
+ XBT_INFO("Received %ld", val1);
MSG_task_receive(&task2, "mymailbox");
val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s");
MSG_task_destroy(task2);
- XBT_INFO("Received %lu", val2);
+ XBT_INFO("Received %ld", val2);
XBT_INFO("OK");
return 0;
MSG_comm_wait(comm2, -1);
long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
- XBT_INFO("Received %lu", val1);
+ XBT_INFO("Received %ld", val1);
MC_assert(val1 == 2);
/* simple test trying to load a DOT file. */
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
break;
default:
- xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+ xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
}
SD_task_destroy(task);
}
/* simple test trying to load a DAX file. */
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task));
break;
default:
- xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+ xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
}
SD_task_destroy(task);
}
/* simple test trying to load a DOT file. */
-/* Copyright (c) 2010-2016. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
break;
default:
- xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+ xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
}
SD_task_destroy(task);
}
tmpS>>=1;
}
for(i=0;i<numSources;i++){
- snprintf(nm,BLOCK_SIZE,"Source.%d",i);
- nd=newNode(nm);
- AttachNode(dg,nd);
+ snprintf(nm, BLOCK_SIZE, "Source.%u", i);
+ nd = newNode(nm);
+ AttachNode(dg, nd);
}
for(j=0;j<numOfLayers;j++){
mask=0x00000001<<j;
for(i=0;i<numSources;i++){
- snprintf(nm,BLOCK_SIZE,"Comparator.%d",(i+j*firstLayerNode));
+ snprintf(nm, BLOCK_SIZE, "Comparator.%u", (i + j * firstLayerNode));
nd=newNode(nm);
AttachNode(dg,nd);
ndoff=i&(~mask);
}
mask=0x00000001<<numOfLayers;
for(i=0;i<numSources;i++){
- snprintf(nm,BLOCK_SIZE,"Sink.%d",i);
+ snprintf(nm, BLOCK_SIZE, "Sink.%u", i);
nd=newNode(nm);
AttachNode(dg,nd);
ndoff=i&(~mask);
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */
/* 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. */
void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
- XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
+ XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id());
xbt_assert(not privateLinks_.empty(),
"Cluster routing: no links attached to the source node - did you use host_link tag?");
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved. */
/* 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. */
if (dst->isRouter() || src->isRouter())
return;
- XBT_VERB("dragonfly getLocalRout from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
+ XBT_VERB("dragonfly getLocalRout from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
dst->id());
if ((src->id() == dst->id()) && hasLoopback_) {
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved. */
/* 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. */
/* Let's find the source and the destination in our internal structure */
auto searchedNode = this->computeNodes_.find(src->id());
- xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%d] in the fat tree",
+ xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%u] in the fat tree",
src->name().c_str(), src->id());
FatTreeNode* source = searchedNode->second;
searchedNode = this->computeNodes_.find(dst->id());
- xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%d] in the fat tree",
+ xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%u] in the fat tree",
dst->name().c_str(), dst->id());
FatTreeNode* destination = searchedNode->second;
- XBT_VERB("Get route and latency from '%s' [%d] to '%s' [%d] in a fat tree", src->name().c_str(), src->id(),
+ XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->name().c_str(), src->id(),
dst->name().c_str(), dst->id());
/* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */
if (this->nodesByLevel_[0] != this->nodes_.size()) {
surf_parse_error("The number of provided nodes does not fit with the wanted topology."
- " Please check your platform description (We need %d nodes, we got %zu)",
+ " Please check your platform description (We need %u nodes, we got %zu)",
this->nodesByLevel_[0], this->nodes_.size());
return;
}
for (unsigned int i = 0; i < this->levels_; i++) {
for (unsigned int j = 0; j < this->nodesByLevel_[i + 1]; j++) {
FatTreeNode* newNode = new FatTreeNode(this->cluster_, --k, i + 1, j);
- XBT_DEBUG("We create the switch %d(%d,%d)", newNode->id, newNode->level, newNode->position);
+ XBT_DEBUG("We create the switch %d(%u,%u)", newNode->id, newNode->level, newNode->position);
newNode->children.resize(this->lowerLevelNodesNumber_[i] * this->lowerLevelPortsNumber_[i]);
if (i != this->levels_ - 1) {
newNode->parents.resize(this->upperLevelNodesNumber_[i + 1] * this->lowerLevelPortsNumber_[i + 1]);
{
FatTreeLink* newLink;
newLink = new FatTreeLink(this->cluster_, child, parent);
- XBT_DEBUG("Creating a link between the parent (%d,%d,%u) and the child (%d,%d,%u)", parent->level, parent->position,
+ XBT_DEBUG("Creating a link between the parent (%u,%u,%u) and the child (%u,%u,%u)", parent->level, parent->position,
parentPort, child->level, child->position, childPort);
parent->children[parentPort] = newLink;
child->parents[childPort] = newLink;
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */
/* 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. */
void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat)
{
- XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", src->cname(), src->id(), dst->cname(), dst->id());
+ XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->cname(), src->id(), dst->cname(), dst->id());
unsigned int table_size = getTableSize();
sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id());
"Refusing to create a second NetZone called '%s'.", name);
netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast<NetZoneImpl*>(father));
- XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netpoint_->id());
+ XBT_DEBUG("NetZone '%s' created with the id '%u'", name, netpoint_->id());
}
NetZoneImpl::~NetZoneImpl()
{
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved. */
/* 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. */
void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
- XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
+ XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
dst->id());
if (dst->isRouter() || src->isRouter())
assert(linkOffset >= 0);
}
- XBT_DEBUG("torus_get_route_and_latency - current_node: %i, next_node: %u, linkOffset is %i", current_node,
+ XBT_DEBUG("torus_get_route_and_latency - current_node: %u, next_node: %u, linkOffset is %i", current_node,
next_node, linkOffset);
break;
}
void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
- XBT_DEBUG("vivaldi getLocalRoute from '%s'[%d] '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
+ XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id());
if (src->isNetZone()) {
std::string srcName = "router_" + src->name();
switch(diff) {
case TYPE_DIFF:
- res = bprintf("%s Different type for communication #%d", type, cursor);
+ res = bprintf("%s Different type for communication #%u", type, cursor);
break;
case RDV_DIFF:
- res = bprintf("%s Different rdv for communication #%d", type, cursor);
+ res = bprintf("%s Different rdv for communication #%u", type, cursor);
break;
case TAG_DIFF:
- res = bprintf("%s Different tag for communication #%d", type, cursor);
+ res = bprintf("%s Different tag for communication #%u", type, cursor);
break;
case SRC_PROC_DIFF:
- res = bprintf("%s Different source for communication #%d", type, cursor);
+ res = bprintf("%s Different source for communication #%u", type, cursor);
break;
case DST_PROC_DIFF:
- res = bprintf("%s Different destination for communication #%d", type, cursor);
+ res = bprintf("%s Different destination for communication #%u", type, cursor);
break;
case DATA_SIZE_DIFF:
- res = bprintf("%s\n Different data size for communication #%d", type, cursor);
+ res = bprintf("%s\n Different data size for communication #%u", type, cursor);
break;
case DATA_DIFF:
- res = bprintf("%s\n Different data for communication #%d", type, cursor);
+ res = bprintf("%s\n Different data for communication #%u", type, cursor);
break;
default:
res = nullptr;
simgrid::mc::State* state = stack_.back().get();
XBT_DEBUG("**************************************************");
- XBT_DEBUG("Exploration depth = %zi (state = %d, interleaved processes = %zd)", stack_.size(), state->num,
+ XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), state->num,
state->interleaveSize());
/* Update statistics */
XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.",
visited_state->original_num == -1 ? visited_state->num : visited_state->original_num);
else
- XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size());
+ XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size());
if (not this->initial_communications_pattern_done)
this->initial_communications_pattern_done = 1;
/* Trash the current state, no longer needed */
- XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size());
+ XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size());
stack_.pop_back();
visited_state = nullptr;
stack_.pop_back();
if (state->interleaveSize() && stack_.size() < (std::size_t)_sg_mc_max_depth) {
/* We found a back-tracking point, let's loop */
- XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+ XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
stack_.push_back(std::move(state));
this->restoreState();
- XBT_DEBUG("Back-tracking to state %d at depth %zi done", stack_.back()->num, stack_.size());
+ XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
break;
} else {
- XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size() + 1);
+ XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
}
}
}
-/* Copyright (c) 2011-2015. The SimGrid Team.
+/* Copyright (c) 2011-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
for (auto& s : this->getTextualTrace())
XBT_INFO("%s", s.c_str());
simgrid::mc::session->logState();
- XBT_INFO("Counter-example depth : %zd", depth);
+ XBT_INFO("Counter-example depth : %zu", depth);
}
std::vector<std::string> LivenessChecker::getTextualTrace() // override
/* Update current state in buchi automaton */
simgrid::mc::property_automaton->current_state = current_pair->automaton_state;
- XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size = %zd, pair_num = %d, requests = %d)",
- current_pair->depth, current_pair->search_cycle,
- current_pair->graph_state->interleaveSize(),
- current_pair->num,
- current_pair->requests);
+ XBT_DEBUG(
+ "********************* ( Depth = %d, search_cycle = %d, interleave size = %zu, pair_num = %d, requests = %d)",
+ current_pair->depth, current_pair->search_cycle, current_pair->graph_state->interleaveSize(), current_pair->num,
+ current_pair->requests);
if (current_pair->requests == 0) {
this->backtrack();
simgrid::mc::State* state = stack_.back().get();
XBT_DEBUG("**************************************************");
- XBT_DEBUG("Exploration depth=%zi (state=%p, num %d)(%zu interleave)",
- stack_.size(), state, state->num, state->interleaveSize());
+ XBT_DEBUG("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num,
+ state->interleaveSize());
mc_model_checker->visited_states++;
// req is now the transition of the process that was selected to be executed
if (req == nullptr) {
- XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size() + 1);
+ XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size() + 1);
this->backtrack();
continue;
if (state->interleaveSize()
&& stack_.size() < (std::size_t) _sg_mc_max_depth) {
/* We found a back-tracking point, let's loop */
- XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+ XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
stack_.push_back(std::move(state));
this->restoreState();
- XBT_DEBUG("Back-tracking to state %d at depth %zi done",
- stack_.back()->num, stack_.size());
+ XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
break;
} else {
- XBT_DEBUG("Delete state %d at depth %zi",
- state->num, stack_.size() + 1);
+ XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
}
}
}
#else
#ifdef MC_VERBOSE
- XBT_VERB("(%d - %d) Different local variables between stacks %d", num1,
- num2, cursor + 1);
+ XBT_VERB("(%d - %d) Different local variables between stacks %u", num1, num2, cursor + 1);
#endif
return 1;
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
// It's supposed to be possible in DWARF2 but I couldn't find its semantic
// in the spec.
default:
- xbt_die("Can't handle form class (%i) / form 0x%x as DW_AT_member_location",
- (int) form_class, form);
+ xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form);
}
}
break;
default:
- xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location "
- "in <%" PRIx64 ">%s",
- form, form, (int) form_class, (int) form_class,
- (uint64_t) variable->id,
- variable->name.c_str());
+ xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%" PRIx64 ">%s", (unsigned)form, form,
+ (unsigned)form_class, (int)form_class, (uint64_t)variable->id, variable->name.c_str());
}
// Handle start_scope:
case simgrid::dwarf::FormClass::RangeListPtr: // TODO
default:
- xbt_die
- ("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s",
- form, (int) form_class, name == nullptr ? "?" : name);
+ xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form,
+ (unsigned)form_class, name == nullptr ? "?" : name);
}
}
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
while (*current) {
simgrid::mc::Transition item;
- int count = sscanf(current, "%u/%u", &item.pid, &item.argument);
+ int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
if(count != 2 && count != 1)
throw std::runtime_error("Could not parse record path");
res.push_back(item);
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
s_xbt_dynar_t d;
as.read_bytes(&d, sizeof(d), addr);
if (i >= d.used)
- xbt_die("Out of bound index %zi/%lu", i, d.used);
+ xbt_die("Out of bound index %zu/%lu", i, d.used);
if (len != d.elmsize)
xbt_die("Bad size in simgrid::mc::read_element");
as.read_bytes(local, len, remote(xbt_dynar_get_ptr(&d, i)));
switch (message->type) {
case MC_MESSAGE_DEADLOCK_CHECK:
- xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zu != %zu)",
+ xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zd != %zu)",
received_size, sizeof(mc_message_t));
handleDeadlockCheck(message);
break;
case MC_MESSAGE_CONTINUE:
- xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zu != %zu)",
+ xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zd != %zu)",
received_size, sizeof(mc_message_t));
handleContinue(message);
return;
case MC_MESSAGE_SIMCALL_HANDLE:
xbt_assert(received_size == sizeof(s_mc_message_simcall_handle_t),
- "Unexpected size for SIMCALL_HANDLE (%zu != %zu)", received_size,
+ "Unexpected size for SIMCALL_HANDLE (%zd != %zu)", received_size,
sizeof(s_mc_message_simcall_handle_t));
handleSimcall((s_mc_message_simcall_handle_t*)message_buffer);
break;
case MC_MESSAGE_RESTORE:
- xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zu != %zu)",
+ xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zd != %zu)",
received_size, sizeof(mc_message_t));
handleRestore((s_mc_message_restore_t*)message_buffer);
break;
case MC_MESSAGE_ACTOR_ENABLED:
xbt_assert(received_size == sizeof(s_mc_message_actor_enabled_t),
- "Unexpected size for ACTOR_ENABLED (%zu != %zu)", received_size,
+ "Unexpected size for ACTOR_ENABLED (%zd != %zu)", received_size,
sizeof(s_mc_message_actor_enabled_t));
handleActorEnabled((s_mc_message_actor_enabled_t*)message_buffer);
break;
simgrid::mc::Variable* var = this->find_variable(name);
xbt_assert(var->address, "No simple location for this variable");
xbt_assert(var->type->full_type, "Partial type for %s, cannot check size", name);
- xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zi, was %zi)", name,
+ xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zu, was %zu)", name,
size, (size_t)var->type->full_type->byte_size);
this->read_bytes(target, size, remote(var->address));
}
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
int MSG_barrier_wait(msg_bar_t bar) {
xbt_mutex_acquire(bar->mutex);
bar->arrived_processes++;
- XBT_DEBUG("waiting %p %d/%d", bar, bar->arrived_processes, bar->expected_processes);
+ XBT_DEBUG("waiting %p %u/%u", bar, bar->arrived_processes, bar->expected_processes);
if (bar->arrived_processes == bar->expected_processes) {
xbt_cond_broadcast(bar->cond);
xbt_mutex_release(bar->mutex);
return;
}
if (not(old_stack.ss_flags & SS_DISABLE)) {
- XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zd, flags=%x). Restore it.",
- old_stack.ss_sp, old_stack.ss_size, old_stack.ss_flags);
+ XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zu, flags=%x). Restore it.", old_stack.ss_sp,
+ old_stack.ss_size, (unsigned)old_stack.ss_flags);
sigaltstack(&old_stack, nullptr);
}
-
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* If the mutex is not owned by the issuer, that's not good */
if (issuer != this->owner)
- THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
+ THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%lu), not by you.",
this->owner->cname(), this->owner->pid);
if (xbt_swag_size(this->sleeping) > 0) {
unsigned int size = comm->size();
unsigned int rank = comm->rank();
- XBT_DEBUG(
- "coll:tuned:allgather_ompi_bruck rank %d", rank);
+ XBT_DEBUG("coll:tuned:allgather_ompi_bruck rank %u", rank);
sdtype->extent(&slb, &sext);
else
segsize = 1024 << 3;
- XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5d", rank, root, segsize);
+ XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5u", rank, root, segsize);
if (size == 1) {
return MPI_SUCCESS;
sendtmpbuf = (char *)recvbuf;
}
- XBT_DEBUG( "coll:tuned:reduce_generic count %d, msg size %ld, segsize %ld, max_requests %d", original_count, (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment, max_outstanding_reqs);
+ XBT_DEBUG("coll:tuned:reduce_generic count %d, msg size %lu, segsize %lu, max_requests %d", original_count,
+ (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment,
+ max_outstanding_reqs);
rank = comm->rank();
size_t typelng;
int fanout = comm->size()/2;
- XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5d", comm->rank(), fanout, segsize);
+ XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5u", comm->rank(), fanout, segsize);
/**
* Determine number of segments and number of elements
segsize = 64*1024;
}
- XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5d",
- comm->rank(), segsize);
+ XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5u", comm->rank(), segsize);
COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
// Binary_32K
segsize = 32*1024;
- XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5d",
- comm->rank(), segsize);
+ XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5u", comm->rank(), segsize);
COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
segsize = 1024;
}
- XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5d",
- comm->rank(), segsize);
+ XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5u", comm->rank(), segsize);
COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
return smpi_coll_tuned_ompi_reduce_generic( sendbuf, recvbuf, count, datatype,
rank = comm->rank();
size = comm->size();
- XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5d",
- rank, segsize);
+ XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5u", rank, segsize);
/**
* Determine number of segments and number of elements
int status;
do {
- snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffff);
+ snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffffU);
file_descriptor = shm_open(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
} while (file_descriptor == -1 && errno == EEXIST);
if (file_descriptor < 0) {
static char *get_mailbox_name(char *str, int index)
{
- snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast<int> (sizeof(int) * 2), index);
+ snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast<int>(sizeof(int) * 2), static_cast<unsigned>(index));
return str;
}
static char *get_mailbox_name_small(char *str, int index)
{
- snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast<int> (sizeof(int) * 2), index);
+ snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast<int>(sizeof(int) * 2), static_cast<unsigned>(index));
return str;
}
size_t start_block_offset = ALIGN_UP(start_offset, smpi_shared_malloc_blocksize);
size_t stop_block_offset = ALIGN_DOWN(stop_offset, smpi_shared_malloc_blocksize);
for (unsigned block_id=0, i = start_block_offset / smpi_shared_malloc_blocksize; i < stop_block_offset / smpi_shared_malloc_blocksize; block_id++, i++) {
- XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %d", block_id);
+ XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %u", block_id);
void* pos = (void*)((unsigned long)mem + i * smpi_shared_malloc_blocksize);
void* res = mmap(pos, smpi_shared_malloc_blocksize, PROT_READ | PROT_WRITE, mmap_flag,
huge_fd, 0);
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
};
char* F2C::get_key(char* key, int id) {
- std::snprintf(key, KEY_SIZE, "%x",id);
+ std::snprintf(key, KEY_SIZE, "%x", (unsigned)id);
return key;
}
char* F2C::get_key_id(char* key, int id) {
- std::snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index());
+ std::snprintf(key, KEY_SIZE, "%x_%d", (unsigned)id, smpi_process()->index());
return key;
}
simgrid::kernel::routing::NetPoint* netpoint =
new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
- XBT_DEBUG("Router '%s' has the id %d", name, netpoint->id());
+ XBT_DEBUG("Router '%s' has the id %u", name, netpoint->id());
if (coords && strcmp(coords, ""))
new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords);
if (as_cluster->privateLinks_.find(netpoint->id()) != as_cluster->privateLinks_.end())
surf_parse_error("Host_link for '%s' is already defined!",hostlink->id);
- XBT_DEBUG("Push Host_link for host '%s' to position %d", netpoint->cname(), netpoint->id());
+ XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->cname(), netpoint->id());
as_cluster->privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
}
double Model::nextOccuringEventLazy(double now)
{
- XBT_DEBUG("Before share resources, the size of modified actions set is %zd", modifiedSet_->size());
+ XBT_DEBUG("Before share resources, the size of modified actions set is %zu", modifiedSet_->size());
lmm_solve(maxminSystem_);
- XBT_DEBUG("After share resources, The size of modified actions set is %zd", modifiedSet_->size());
+ XBT_DEBUG("After share resources, The size of modified actions set is %zu", modifiedSet_->size());
while (not modifiedSet_->empty()) {
Action *action = &(modifiedSet_->front());
explicit MockedResource() : simgrid::surf::Resource(nullptr, "fake", nullptr) {}
void apply_event(tmgr_trace_event_t event, double value)
{
- XBT_VERB("t=%.1f: Change value to %lg (idx: %d)", thedate, value, event->idx);
+ XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx);
tmgr_trace_event_unref(&event);
}
bool isUsed() { return true; }
res->apply_event(it, value);
whereto->push_back(tmgr::DatedValue(thedate, value));
} else {
- XBT_DEBUG("%.1f: ignore an event (idx: %d)\n", thedate, it->idx);
+ XBT_DEBUG("%.1f: ignore an event (idx: %u)\n", thedate, it->idx);
}
}
tmgr_finalize();
std::vector<std::string> addrs(count);
for (std::size_t i = 0; i < count; i++) {
/* retrieve this address */
- XBT_DEBUG("Retrieving address number %zd from '%s'", i, backtrace_syms[i]);
+ XBT_DEBUG("Retrieving address number %zu from '%s'", i, backtrace_syms[i]);
char buff[256];
snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1);
char* p = strchr(buff, ']');
addrs[i] = buff;
else
addrs[i] = "0x0";
- XBT_DEBUG("Set up a new address: %zd, '%s'", i, addrs[i].c_str());
+ XBT_DEBUG("Set up a new address: %zu, '%s'", i, addrs[i].c_str());
/* Add it to the command line args */
stream << addrs[i] << ' ';
}
char line_func[1024];
char line_pos[1024];
for (std::size_t i = 0; i < count; i++) {
- XBT_DEBUG("Looking for symbol %zd, addr = '%s'", i, addrs[i].c_str());
+ XBT_DEBUG("Looking for symbol %zu, addr = '%s'", i, addrs[i].c_str());
if (fgets(line_func, 1024, pipe)) {
line_func[strlen(line_func) - 1] = '\0';
} else {
- XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str());
+ XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str());
strncpy(line_func, "???",3);
}
if (fgets(line_pos, 1024, pipe)) {
line_pos[strlen(line_pos) - 1] = '\0';
} else {
- XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str());
+ XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str());
strncpy(line_pos, backtrace_syms[i],1024);
}
/* Damn. The symbol is in a dynamic library. Let's get wild */
char maps_buff[512];
- long int offset = 0;
+ unsigned long int offset = 0;
char* p;
int found = 0;
char* maps_name = bprintf("/proc/%d/maps", (int) getpid());
FILE* maps = fopen(maps_name, "r");
- long int addr = strtol(addrs[i].c_str(), &p, 16);
+ unsigned long int addr = strtoul(addrs[i].c_str(), &p, 16);
if (*p != '\0') {
- XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)",
- addrs[i].c_str(), addr);
+ XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)", addrs[i].c_str(), addr);
}
- XBT_DEBUG("addr=%s (as string) =%#lx (as number)",
- addrs[i].c_str(), addr);
+ XBT_DEBUG("addr=%s (as string) =%#lx (as number)", addrs[i].c_str(), addr);
while (not found) {
- long int first;
- long int last;
+ unsigned long int first;
+ unsigned long int last;
if (fgets(maps_buff, 512, maps) == nullptr)
break;
newsize--;
dict->table_size = newsize;
dict->table = currcell;
- XBT_DEBUG("REHASH (%d->%d)", oldsize, newsize);
+ XBT_DEBUG("REHASH (%u->%u)", oldsize, newsize);
for (unsigned i = 0; i < oldsize; i++, currcell++) {
if (*currcell == nullptr) /* empty cell */
/* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD */
/* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead */
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
size_t rem = sz % alignment[i];
if (rem != 0 || sz == 0) {
size_t sz2 = sz - rem + alignment[i];
- XBT_DEBUG("pthread_attr_setstacksize failed for %zd, try again with %zd", sz, sz2);
+ XBT_DEBUG("pthread_attr_setstacksize failed for %zu, try again with %zu", sz, sz2);
sz = sz2;
res = pthread_attr_setstacksize(&thread_attr, sz);
}
}
if (res == EINVAL)
- XBT_WARN("invalid stack size (maybe too big): %zd", sz);
+ XBT_WARN("invalid stack size (maybe too big): %zu", sz);
else if (res != 0)
- XBT_WARN("unknown error %d in pthread stacksize setting: %zd", res, sz);
+ XBT_WARN("unknown error %d in pthread stacksize setting: %zu", res, sz);
}
void xbt_os_thread_setguardsize(int guard_size)
size_t sz = guard_size;
int res = pthread_attr_setguardsize(&thread_attr, sz);
if (res)
- XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zd", res, sz);
+ XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zu", res, sz);
#endif
}
} else if (error==MSG_TRANSFER_FAILURE) {
XBT_INFO(" Receive message: TRANSFERT_FAILURE");
} else {
- XBT_INFO(" Receive message: %d", error);
+ XBT_INFO(" Receive message: %u", error);
}
XBT_INFO(" RX Done");
return 0;
switch (args[0][test - 1]) {
case 'r':
- XBT_INFO("Test %d: r (regular send)", test);
+ XBT_INFO("Test %u: r (regular send)", test);
mbox->put((void*)mboxName, 42.0);
break;
case 'R':
- XBT_INFO("Test %d: R (sleep + regular send)", test);
+ XBT_INFO("Test %u: R (sleep + regular send)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->put((void*)mboxName, 42.0);
break;
case 'i':
- XBT_INFO("Test %d: i (asynchronous isend)", test);
+ XBT_INFO("Test %u: i (asynchronous isend)", test);
mbox->put_async((void*)mboxName, 42.0)->wait();
break;
case 'I':
- XBT_INFO("Test %d: I (sleep + isend)", test);
+ XBT_INFO("Test %u: I (sleep + isend)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->put_async((void*)mboxName, 42.0)->wait();
break;
case 'd':
- XBT_INFO("Test %d: d (detached send)", test);
+ XBT_INFO("Test %u: d (detached send)", test);
mbox->put_init((void*)mboxName, 42.0)->detach();
break;
case 'D':
- XBT_INFO("Test %d: D (sleep + detached send)", test);
+ XBT_INFO("Test %u: D (sleep + detached send)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->put_init((void*)mboxName, 42.0)->detach();
break;
default:
- xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]);
+ xbt_die("Unknown sender spec for test %u: '%c'", test, args[0][test - 1]);
}
- XBT_INFO("Test %d OK", test);
+ XBT_INFO("Test %u OK", test);
}
simgrid::s4u::this_actor::sleep_for(0.5);
// FIXME: we should test what happens when the process ends before the end of remote comm instead of hiding it
switch (args[0][test - 1]) {
case 'r':
- XBT_INFO("Test %d: r (regular receive)", test);
+ XBT_INFO("Test %u: r (regular receive)", test);
received = mbox->get();
break;
case 'R':
- XBT_INFO("Test %d: R (sleep + regular receive)", test);
+ XBT_INFO("Test %u: R (sleep + regular receive)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
received = mbox->get();
break;
case 'i':
- XBT_INFO("Test %d: i (asynchronous irecv)", test);
+ XBT_INFO("Test %u: i (asynchronous irecv)", test);
mbox->get_async(&received)->wait();
break;
case 'I':
- XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test);
+ XBT_INFO("Test %u: I (sleep + asynchronous irecv)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->get_async(&received)->wait();
break;
case 'p':
- XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test);
+ XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
mbox->setReceiver(Actor::self());
received = mbox->get();
break;
case 'P':
- XBT_INFO("Test %d: P (sleep + regular receive on permanent mailbox)", test);
+ XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->setReceiver(Actor::self());
received = mbox->get();
break;
case 'j':
- XBT_INFO("Test %d: j (irecv on permanent mailbox)", test);
+ XBT_INFO("Test %u: j (irecv on permanent mailbox)", test);
mbox->setReceiver(Actor::self());
mbox->get_async(&received)->wait();
break;
case 'J':
- XBT_INFO("Test %d: J (sleep + irecv on permanent mailbox)", test);
+ XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->setReceiver(Actor::self());
mbox->get_async(&received)->wait();
break;
default:
- xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]);
+ xbt_die("Unknown receiver spec for test %u: '%c'", test, args[0][test - 1]);
}
xbt_assert(strcmp(static_cast<char*>(received), mboxName) == 0);
xbt_free(received);
xbt_free(mboxName);
- XBT_INFO("Test %d OK", test);
+ XBT_INFO("Test %u OK", test);
}
simgrid::s4u::this_actor::sleep_for(0.5);
}
if (!rbuf)
fprintf(stderr, "\trbuf of %d bytes\n", MAX_BUF);
if (!recvcounts)
- fprintf(stderr, "\trecvcounts of %zd bytes\n", comm_size * sizeof(int));
+ fprintf(stderr, "\trecvcounts of %zu bytes\n", comm_size * sizeof(int));
if (!displs)
- fprintf(stderr, "\tdispls of %zd bytes\n", comm_size * sizeof(int));
+ fprintf(stderr, "\tdispls of %zu bytes\n", comm_size * sizeof(int));
fflush(stderr);
MPI_Abort(MPI_COMM_WORLD, -1);
}
* this can generate a file that diff, for example,
* believes is a binary file */
if (isprint((int) (s1[j].c))) {
- fprintf(stderr, "Got s[%d].c = %c; expected %c\n",
- j, s1[j].c, j + status.MPI_SOURCE + 'a');
+ fprintf(stderr, "Got s[%d].c = %c; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a');
}
else {
- fprintf(stderr, "Got s[%d].c = %x; expected %c\n",
- j, (int) s1[j].c, j + status.MPI_SOURCE + 'a');
+ fprintf(stderr, "Got s[%d].c = %hhx; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a');
}
}
}
if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
MPI_Type_size(MPI_LONG_DOUBLE, &type_size);
if (type_size != sizeof(long double)) {
- printf("type_size != sizeof(long double) : (%d != %zd)\n",
- type_size, sizeof(long double));
+ printf("type_size != sizeof(long double) : (%d != %zu)\n", type_size, sizeof(long double));
++errs;
}
}
if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
MPI_Type_size(MPI_C_LONG_DOUBLE_COMPLEX, &type_size);
if (type_size != sizeof(long double _Complex)) {
- printf("type_size != sizeof(long double _Complex) : (%d != %zd)\n",
- type_size, sizeof(long double _Complex));
+ printf("type_size != sizeof(long double _Complex) : (%d != %zu)\n", type_size,
+ sizeof(long double _Complex));
++errs;
}
}
myname, j, world_rank, errloc - 1);
p1 = (char *) inbufs[j];
p2 = (char *) outbufs[j];
- fprintf(stderr, "Got %x expected %x\n", p1[errloc - 1], p2[errloc - 1]);
+ fprintf(stderr, "Got %hhx expected %hhx\n", p1[errloc - 1], p2[errloc - 1]);
err++;
}
}
typename, typenum, world_rank, errloc - 1, size_bytes);
p1 = (char *) inbuf;
p2 = (char *) outbuf;
- fprintf(stderr, "Got %x expected %x\n", p2[errloc - 1], p1[errloc - 1]);
+ fprintf(stderr, "Got %hhx expected %hhx\n", p2[errloc - 1], p1[errloc - 1]);
}
return errloc;
}
float mean_date= acc_date/(float)testcount;
float stdev_date= sqrt(acc_date2/(float)testcount-mean_date*mean_date);
- fprintf(stderr,
- "%ix One shot execution time for a total of %d constraints, "
- "%d variables with %d active constraint each, concurrency in [%i,%i] and max concurrency share %i\n",
- testcount,nb_cnst, nb_var, nb_elem, (1<<pw_base_limit), (1<<pw_base_limit)+(1<<pw_max_limit), max_share);
+ fprintf(stderr, "%ix One shot execution time for a total of %u constraints, "
+ "%u variables with %u active constraint each, concurrency in [%i,%i] and max concurrency share %u\n",
+ testcount, nb_cnst, nb_var, nb_elem, (1 << pw_base_limit), (1 << pw_base_limit) + (1 << pw_max_limit),
+ max_share);
if(mode==3)
fprintf(stderr, "Execution time: %g +- %g microseconds \n",mean_date, stdev_date);
for (i = 0; i < TESTSIZE; i++) {
size = size_of_block(i);
pointers[i] = mmalloc(heapA, size);
- XBT_INFO("%d bytes allocated with offset %tx", size, ((char*)pointers[i])-((char*)heapA));
+ XBT_INFO("%d bytes allocated with offset %zx", size, (size_t)((char*)pointers[i] - (char*)heapA));
}
XBT_INFO("All blocks were correctly allocated. Free every second block");
for (i = 0; i < TESTSIZE; i+=2) {